Skip to content

Commit

Permalink
cut bootmain to 1 sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Aug 27, 2007
1 parent 8d2e9a4 commit 8e67005
Showing 1 changed file with 8 additions and 28 deletions.
36 changes: 8 additions & 28 deletions bootmain.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 8e67005

Please sign in to comment.