Hi! I've written a prog. that writes a file into the bootsector of a floppy disc. Now I've some questions about the file, that's written to the sector.
1. I know that it must be 512 bytes. How can I fill the rest when it's smaller?
2. Someone told me the last two bytes must be 0AA55h. Is that the same as 0x0AA55 in C?
3. Which extension (format) must the file have? bin?
Please help me!
Bootsector
Re:Bootsector
Any way you want. However, it's conventional to pad it with zeroes. In NASM, you can do this:black.fish wrote:1. I know that it must be 512 bytes. How can I fill the rest when it's smaller?
Code: Select all
times 510-($-$$) db 0 ; make the file the right size
dw 0xAA55 ; magic word for BIOS
Yes, that's right.2. Someone told me the last two bytes must be 0AA55h. Is that the same as 0x0AA55 in C?
The extension doesn't matter, but you need to make sure that your assembler is outputting to flat binary format. On NASM, use the -f bin switch.3. Which extension (format) must the file have? bin?