1N/A/* @r{kernel.c - the C part of the kernel} */ 1N/A/* @r{Copyright (C) 1999 Free Software Foundation, Inc. 1N/A This program is free software; you can redistribute it and/or modify 1N/A it under the terms of the GNU General Public License as published by 1N/A the Free Software Foundation; either version 2 of the License, or 1N/A (at your option) any later version. 1N/A This program is distributed in the hope that it will be useful, 1N/A but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A GNU General Public License for more details. 1N/A You should have received a copy of the GNU General Public License 1N/A along with this program; if not, write to the Free Software 1N/A Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.} */ 1N/A/* @r{Check if the bit BIT in FLAGS is set.} */ 1N/A/* @r{Some screen stuff.} */ 1N/A/* @r{The number of columns.} */ 1N/A/* @r{The number of lines.} */ 1N/A/* @r{The attribute of an character.} */ 1N/A/* @r{The video memory address.} */ 1N/A/* @r{Save the X position.} */ 1N/A/* @r{Save the Y position.} */ 1N/A/* @r{Point to the video memory.} */ 1N/A/* @r{Forward declarations.} */ 1N/A/* @r{Check if MAGIC is valid and print the Multiboot information structure 1N/A pointed by ADDR.} */ 1N/A /* @r{Clear the screen.} */ 1N/A /* @r{Am I booted by a Multiboot-compliant boot loader?} */ 1N/A /* @r{Set MBI to the address of the Multiboot information structure.} */ 1N/A /* @r{Print out the flags.} */ 1N/A /* @r{Are mem_* valid?} */ 1N/A printf (
"mem_lower = %uKB, mem_upper = %uKB\n",
1N/A /* @r{Is boot_device valid?} */ 1N/A /* @r{Is the command line passed?} */ 1N/A /* @r{Are mods_* valid?} */ 1N/A printf (
"mods_count = %d, mods_addr = 0x%x\n",
1N/A printf (
" mod_start = 0x%x, mod_end = 0x%x, string = %s\n",
1N/A /* @r{Bits 4 and 5 are mutually exclusive!} */ 1N/A /* @r{Is the symbol table of a.out valid?} */ 1N/A printf (
"aout_symbol_table: tabsize = 0x%0x, " 1N/A "strsize = 0x%x, addr = 0x%x\n",
1N/A /* @r{Is the section header table of ELF valid?} */ 1N/A " addr = 0x%x, shndx = 0x%x\n",
1N/A /* @r{Are mmap_* valid?} */ 1N/A printf (
"mmap_addr = 0x%x, mmap_length = 0x%x\n",
1N/A " length = 0x%x%x, type = 0x%x\n",
1N/A/* @r{Clear the screen and initialize VIDEO, XPOS and YPOS.} */ 1N/A/* @r{Convert the integer D to a string and save the string in BUF. If 1N/A BASE is equal to 'd', interpret that D is decimal, and if BASE is 1N/A equal to 'x', interpret that D is hexadecimal.} */ 1N/A /* @r{If %d is specified and D is minus, put `-' in the head.} */ 1N/A /* @r{Divide UD by DIVISOR until UD == 0.} */ 1N/A /* @r{Terminate BUF.} */ 1N/A /* @r{Reverse BUF.} */ 1N/A/* @r{Put the character C on the screen.} */ 1N/A if (c ==
'\n' || c ==
'\r')
1N/A/* @r{Format a string and print it on the screen, just like the libc 1N/A function printf.} */