Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ASSEMBLY AND BOOT LOADERS AND SHIT

Name: shit 2011-05-10 6:12

k, so my program needs to boot a hard disk. how the fuck do i do that.
isn't it enough that i read the boot sector to 07c00h, set dl, and jmp there? doesn't seem to work. shit

Name: Anonymous 2011-05-11 8:42

>>18
http://wiki.osdev.org/Bootloader#Booting_multiple_OSes
The easiest way to boot another OS is a mechanism called chainloading. Windows stores something akin to a second-stage bootloader in the boot sector of the partition it was installed in. When installing Linux, writing e.g. LILO or GRUB to the partition boot sector instead of the MBR is also an option. Now, the thing your MBR bootsector can do is to relocate itself (copying from 0x0000:0x7c00 to, traditionally, 0x0060:0x0000), parse the partition table, display some kind of menu and let the user chose which partition to boot from. Then, your (relocated) MBR bootsector would load that partition boot sector to 0x0000:0x7c00, and jump there. The partition boot sector would be none the wiser that there already was a bootsector loaded before, and could actually load yet another bootsector - which is why it's called chainloading.


Thirteen seconds on google.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List