Page 1 of 1
retain floppy formatting when using partcopy
Posted: Thu Aug 09, 2007 6:47 pm
by ubergeek
Hi,
I'm currently using partcopy to copy my bootloader to the boot sector of a floppy disk (actually, a virtual floppy disk). The act of copying to the boot sector causes the disk to lose its formatting. How can I avoid this?
Posted: Thu Aug 09, 2007 7:02 pm
by t0xic
You can create a fat-12 able bootsecter. I don't have time right now to post my old one, but just google it or search on the forums and you'll find plenty
edit:
heres the link:
http://www.osdev.org/phpBB2/download.php?id=250
--Michael
Posted: Fri Aug 10, 2007 5:30 am
by ubergeek
Ok, I get it now. I just have to put all that "fat12 junk" into the top of my file, right?
Posted: Fri Aug 10, 2007 8:56 am
by inflater
Hi,
Simple solution for your problem:
You in your bootsector have zeros or ?s in the BPB (or you do not have BPB at all). PARTCOPY will physically write the file to as a bootsector, but Windows (or DOS or Linux or ...) will see that BPB is invalid and it will reply that "disk isn't formatted".
There are three solutions:
1.You would enter these values (sectors per track, bytes per sector) in the BPB manually [replacing the zeros or ?s]. They must be right or else it may not work.
2.You would leave the BPB zeroed and use the BOOTABLE utility in the attachment to copy the boot sector to the floppy (BOOTABLE.EXE will skip the BPB parameters and use default from your [formatted] diskette)
3.Again, you would leave BPB alone and use following commands:
PARTCOPY yourboot.bin 0 3 -f0 0
PARTCOPY yourboot.bin 3E 1C2 -f0 3E
Of course you would replace "yourboot.bin" by the name of your boot file.
//EDIT: Chase, could you please add extensions .COM and .EXE as an allowed extensions for attachment?
Regards,
inflater
Posted: Fri Aug 10, 2007 9:36 am
by t0xic
Yes, you just have to put the fat12 junk lol...
But if you want to open the disk in widnows and copy the file over to the boot disk, then you need a more complicated boot secter. ine just loads from sector 2.
--Michael
Posted: Fri Aug 10, 2007 9:41 am
by ubergeek
Thanks everyone for your help. I think that since my bootloader just loads my kernel from the next couple of sectors, it won't really matter whether or not the floppy is formatted.
I tried using the "BOOTABLE.EXE" utility - it didn't work. It gave an error that said that the formatting types did not match. This might have something to do with the fact that I'm using Virtual Floppy Drive.
Oh well, I'll just forget about the disk's formatting. It doesn't really matter anyway.
Posted: Fri Aug 10, 2007 9:58 am
by inflater
ubergeek wrote:Thanks everyone for your help. I think that since my bootloader just loads my kernel from the next couple of sectors, it won't really matter whether or not the floppy is formatted.
I tried using the "BOOTABLE.EXE" utility - it didn't work. It gave an error that said that the formatting types did not match. This might have something to do with the fact that I'm using Virtual Floppy Drive.
Oh well, I'll just forget about the disk's formatting. It doesn't really matter anyway.
Oh. I thought you use FAT and you aren't making baby steps of your own file system.
BOOTABLE.EXE wouldn't work in that case
Windows says "disk not formatted" because it doesn't contain suitable filesystem that it can read. No, that's not because you are using virtual floppy drive, if you did this with physical diskette, you would get the same result
it won't really matter whether or not the floppy is formatted.
If the floppy wouldn't be formatted low-level during it's creation process... you think so?
If you find an *unformatted* floppy diskette [btw. the original unformatted has 2 MB capacity, but low-level formatting shrinks it into 1,44 MB], please let me know.
But every floppy from, eh, 1997?, is low-level factory formatted.
Note that I mean low-level, the creation of sectors and tracks, not creating FAT filesystem (high-level formatting as does Windows)
Regards
inflater