Skip to content
Snippets Groups Projects
Commit 8e670053 authored by rsc's avatar rsc
Browse files

cut bootmain to 1 sheet

parent 8d2e9a48
No related branches found
No related tags found
No related merge requests found
// 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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment