Page 1 of 1
FAT12 Boot Sector
Posted: Mon Jul 31, 2006 11:24 pm
by kenneth_phough
I wrote a FAT12 boot sector but am not sure if it works. I'm going to assume that it doesn't work because I can mount the floppy after I dd my boot.bin to my floppy but I could have done it wrong. This is how I wrote my boot sector to my floppy.
Code: Select all
mkfs -t msdos -I /dev/sda 1440
dd if=boot.bin of=/dev/sda bs=512 count=1
Could this be the problem or my code?
http://www.kenax.byethost9.com/osdev/bo ... sector.asm
Thanks,
Kenneth
Posted: Tue Aug 01, 2006 10:30 am
by Mikae
So, what is the source of your question? Have you doubts about your code, which works with FAT12, or about how you have to move the code to a floppy?
Anyway, this is very strange that you could mount it, because you destroyed MBR partition table. After this, the floppy remains bootable, but I think that you will not able to manage its FS using Windows.
Posted: Wed Aug 02, 2006 3:31 am
by kenneth_phough
I want my floppy to be bootable and at the same time have an FS. I wrote a bootsector that follows the fat12 boot sector format but couldn't write to the floppy and also I am not sure if my code will work because I haven't been able to test it.
Also I haven't been able to format my floppy on SuSE Linux. It says I should use setfdrpm which I haven't been able to work either. (My floppy drive is an external USB FDD)
Yours,
Kenneth
Posted: Wed Aug 02, 2006 4:26 am
by Mikae
Well, I think that the first command was right -- you created the file system, but the second was not -- writing to the first sector you destroyed MBR and its partition table. After that drive became unbootable.
To change
file system boot sector you have to 'dd' your FAT12 code to the first sector of an
active partition, not the
drive itself. To find offset, where active partition begins you may use linux's fdisk.
For now, I think that you have to repartition your drive with fdisk, create file system using mkfs (or just format it under Windows), find where active partition begins and 'dd' your FAT12 code to this sector.
After that, I think you will able to boot from the drive and to test your code
.
Posted: Wed Aug 02, 2006 5:43 am
by joke
Hell, thank you kennenth plough, YOU SAVED ME. Your bootsector contains code for a problem i had, and know i can solve it. A thousand thanks!
Posted: Wed Aug 02, 2006 10:46 pm
by kenneth_phough
@joke:
Your welcome
@Mikae:
Thanks, I got it to work!