|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
|||
|
001 /* Copyright (C) 2004 The SOS Team 002 Copyright (C) 1999 Free Software Foundation, Inc. 003 004 This program is free software; you can redistribute it and/or 005 modify it under the terms of the GNU General Public License 006 as published by the Free Software Foundation; either version 2 007 of the License, or (at your option) any later version. 008 009 This program is distributed in the hope that it will be useful, 010 but WITHOUT ANY WARRANTY; without even the implied warranty of 011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 GNU General Public License for more details. 013 014 You should have received a copy of the GNU General Public License 015 along with this program; if not, write to the Free Software 016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 017 USA. 018 */ 019 020 /* Include definitions of the multiboot standard */ 021 #include <bootstrap/multiboot.h> 022 #include <sos/klibc.h> 023 #include <sos/assert.h> 024 #include <drivers/x86_videomem.h> 025 #include <drivers/bochs.h> 026 027 028 029 /* The C entry point of our operating system */ 030 void sos_main(unsigned long magic, unsigned long addr) 031 { 032 unsigned i; 033 034 /* Grub sends us a structure, called multiboot_info_t with a lot of 035 precious informations about the system, see the multiboot 036 documentation for more information. */ 037 multiboot_info_t *mbi; 038 mbi = (multiboot_info_t *) addr; 039 040 /* Setup bochs and console, and clear the console */ 041 sos_bochs_setup(); 042 043 sos_x86_videomem_setup(); 044 sos_x86_videomem_cls(SOS_X86_VIDEO_BG_BLUE); 045 046 /* Greetings from SOS */ 047 if (magic == MULTIBOOT_BOOTLOADER_MAGIC) 048 /* Loaded with Grub */ 049 sos_x86_videomem_printf(1, 0, 050 SOS_X86_VIDEO_FG_YELLOW | SOS_X86_VIDEO_BG_BLUE, 051 "Welcome From GRUB to %s%c RAM is %dMB (upper mem = 0x%x kB)", 052 "SOS", ',', 053 (unsigned)(mbi->mem_upper >> 10) + 1, 054 (unsigned)mbi->mem_upper); 055 else 056 /* Not loaded with grub */ 057 sos_x86_videomem_printf(1, 0, 058 SOS_X86_VIDEO_FG_YELLOW | SOS_X86_VIDEO_BG_BLUE, 059 "Welcome to SOS"); 060 061 sos_bochs_putstring("Message in a bochs\n"); 062 063 064 /* An operatig system never ends */ 065 for (;;) 066 continue; 067 068 return; 069 }
[ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |