retain floppy formatting when using partcopy

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ubergeek
Posts: 23
Joined: Thu Aug 09, 2007 5:26 am

retain floppy formatting when using partcopy

Post 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?
User avatar
t0xic
Member
Member
Posts: 216
Joined: Sat May 05, 2007 3:16 pm
Location: VA
Contact:

Post 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
ubergeek
Posts: 23
Joined: Thu Aug 09, 2007 5:26 am

Post by ubergeek »

Ok, I get it now. I just have to put all that "fat12 junk" into the top of my file, right?
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post 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
Attachments
BOOTABLE.zip
(4.15 KiB) Downloaded 68 times
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
User avatar
t0xic
Member
Member
Posts: 216
Joined: Sat May 05, 2007 3:16 pm
Location: VA
Contact:

Post 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
ubergeek
Posts: 23
Joined: Thu Aug 09, 2007 5:26 am

Post 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.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post 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
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
Post Reply