Hi,
Sophite wrote:So... What should I do now?
For my boot loaders, all I do is put code in the first sector that loads more sectors of the boot loader.
More specifically, I have code in the first sector that loads the second sector, then the second sector contains better error reporting (a bunch of ASCII strings and a routine to convert BIOS error codes into human readable error messages) and loads the third sector, then code in the third sector contains much better disk IO routines (LBA, multi-sector reads, etc) and loads the remainder of the boot loader.
Note that for NASM and "flat binary" you can create your own sections, which can be useful for controlling where things end up. For example, this is what I'm using for one of my boot loaders:
Code: Select all
SECTION .sector1 progbits start=0x0000 vstart=0x2000
SECTION .sector2 progbits start=0x0200 vstart=0x2200
SECTION .sector3 progbits start=0x0400 vstart=0x2400
SECTION .publicKey progbits start=0x0600 vstart=0x2600
SECTION .text progbits follows=.publicKey align=4 vfollows=.publicKey valign=4
SECTION .data progbits follows=.text align=4 vfollows=.text valign=4
SECTION .bss nobits follows=.data align=4
Note: my first sector also relocates itself from 0x00007C00 to 0x00002000, which is why I'm using "vstart=0x2000" and not "vstart=0x7C00".
Cheers,
Brendan