NASM Forum > Example Code

Sample FAT12 boot code

<< < (2/2)

debs3759:
Thanks JennTT.

T145:
What would a sample "LOADER.BIN" look like? Is it alright if such a file is just alone in the same directory as "bootsect.bin," or does it need to be compiled into something like a *.img?

debs3759:

--- Quote from: T145 on November 21, 2019, 03:43:15 AM ---What would a sample "LOADER.BIN" look like? Is it alright if such a file is just alone in the same directory as "bootsect.bin," or does it need to be compiled into something like a *.img?

--- End quote ---

You can either put it in the root directory or in a directory. My code will only search the root directory. You need to load your bin file into memory, then jump to the entry point of your code. Bootsect.bin needs to be loaded to the bootsector of your disc. The code I shared is only for a floppy. Loading your loader from the bootsector of a HDD should be easier, as a floppy disc uses 12 bit FAT, and all other drives (other than very early, small drives) use 16-bit FAT or 32-bit, which is easier to code for. If you get stuck at any point, please post the code you have written, and we will try to help.

I hope I answered your question.

Navigation

[0] Message Index

[*] Previous page

Go to full version