I recently wrote a simple bootloader in assembly for floppy disk booting. I used ‘debug’ command on my Windows XP virtual machine, to write on the first sector of floppy disk image. It works, which is good. Now, I am trying to load the second stage bootloader (or kernel) into the memory by reading sectors: I wrote the second stage bootloader to be read as well as modified first stage bootloader.
To make this happen, I need to copy the second stage bootloader into the floppy disk. I clicked the A: icon on the windows explorer, trying to copy it, but the message I got was “The disk in drive A: is not formatted. Do you want to format it now?” At this stage, I got some questions in a row.
My questions are:
-
How do I make windows acknowledge the bootloader I wrote, so that I can copy other files in? (Or is it even possible?)
-
If this is not an option, do I always need to use either “debug” or “partcopy” to copy all other files into the disk?
-
Can I copy the second stage and/or other files into any empty sectors?
-
Debug command is gone in Windows 7 and partcopy windows version didn’t allow me to write on the first sector of the disk. What are the alternatives? (Trying to avoid working on VM.)
I am sorry for asking so many question on one thread. I thought it was easy to ask in one, cause they are all related.
Does your boot sector have a partition table at byte 446? It is needed to have, well.. partitions. A valid file system is also needed.
If there isn’t any valid supported file system, then yes, you will need to use specialized tools to write the data directly to sectors.
If you don’t employ a file system, the entire disk is free to use as you see fit. If you want to use a file system, it will need some sectors to work. Ideally you should also go through the file system to find sector(s) of your second stage.
You could use a specialized tool made specifically for writing boot sectors or disk images, or you could use dd: