flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Boot process |
Author |
|
Platone 18 Jun 2005, 19:08
Who can explane me (eventually with code) what is the boot process and what a bootloader must do?
Tnks |
|||
18 Jun 2005, 19:08 |
|
crc 18 Jun 2005, 19:44
The boot process is pretty simple when it comes down to it. The computer starts (in 16-bit real mode), then passes control to the BIOS. The BIOS then looks for a bootable disk (the exact order varies by BIOS and can often be configured). Normally it'll try a floppy first if you have one, then a CD-ROM, and finally one or more of the hard drives. (Some BIOSes can also boot from a network)
The BIOS will load one sector from the disk (to 0x7c00), checks to see if the last two bytes are 0x55 followed by 0xAA. If they are, the disk is assumed to be bootable. Control is passed to the loaded sector. This first sector is responsible for loading the rest of the operating system. In my OS, it loads the next 8k from the boot floppy, enables the A20 line, then sets up protected mode. It relocates the 8k it loaded to 0x110000. Finally it jumps to 0x110000, where the kernel takes over. The code for my boot loader is at http://retro.tunes.org/repos/retroforth/_darcs/current/native/source/raw.asm It's worth noting that the boot sequence once the first sector gets control is specific to the operating system, so there's no standard beyond that. |
|||
18 Jun 2005, 19:44 |
|
Platone 18 Jun 2005, 20:09
native.bin, in your code, is the kernel to load?
|
|||
18 Jun 2005, 20:09 |
|
Platone 19 Jun 2005, 08:07
well....I write the kernel and compile it as 'native.bin', and compile the bootloader...then I'll put the 2 bin into the floppy?? (for raw... can I use rawwritewin, can't I?)...that's right?
|
|||
19 Jun 2005, 08:07 |
|
crc 19 Jun 2005, 13:09
The raw.bin will include the native.bin file inside itself. So you only have to put raw.bin on the floppy using rawwritewin.
|
|||
19 Jun 2005, 13:09 |
|
Platone 19 Jun 2005, 13:54
tnks for the help
|
|||
19 Jun 2005, 13:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.