xv6

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8e67005320c56cac63654bcf61a8128bd89e4ff9
parent 8d2e9a4867c21f1ff84b78cd82f386394d768b3a
Author: rsc <rsc>
Date:   Mon, 27 Aug 2007 12:48:03 +0000

cut bootmain to 1 sheet

Diffstat:
Mbootmain.c | 36++++++++----------------------------
1 file changed, 8 insertions(+), 28 deletions(-)

diff --git a/bootmain.c b/bootmain.c @@ -1,31 +1,11 @@ -// This a dirt simple boot loader, whose sole job is to boot -// an elf kernel image from the first IDE hard disk. -// -// DISK LAYOUT -// * This program(boot.S and main.c) is the bootloader. It should -// be stored in the first sector of the disk. -// -// * The 2nd sector onward holds the kernel image. -// -// * The kernel image must be in ELF format. -// -// BOOT UP STEPS -// * when the CPU boots it loads the BIOS into memory and executes it -// -// * the BIOS intializes devices, sets up the interrupt routines, and -// reads the first sector of the boot device(e.g., hard-drive) -// into memory and jumps to it. -// -// * Assuming this boot loader is stored in the first sector of the -// hard-drive, this code takes over... -// -// * control starts in bootloader.S -- which sets up protected mode, -// and a stack so C code then run, then calls cmain() -// -// * cmain() in this file takes over, -// reads in the kernel and jumps to it. - -//PAGEBREAK! +// Boot loader. +// +// The BIOS loads boot sector (bootasm.S) from sector 1 of the disk +// into memory and executes it. The boot sector puts the processor +// in 32-bit mode and calls cmain below, which loads an ELF kernel +// image from the disk starting at sector 2 and then jumps to the +// kernel entry routine. + #include "types.h" #include "elf.h" #include "x86.h"