Make And Emulate a FAT12 Floppy

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.
Locked
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Make And Emulate a FAT12 Floppy

Post by Nathan »

Hello,
I'm trying to work with BootProg, but one of it's requirements(for the boot sector) is to have a FAT12 formatted floppy, to write the boot loader. I've tried to create the floppy image using Virtual Floppy Drive, MagicISO and WinImage, but used only Virtual Floppy Drive to emulate my floppy image(because I think this is the only program that can emulate floppy's).

When I try to run BOOTABLE.EXE(to write the boot sector, program that is included with BootProg), I got this:

Code: Select all

C:\bootprog> bootable boot.bin A:
Loading a boot sector file...
  OK.
Reading original boot sector...
  OK.
Altering original boot sector...
  FAT types don't match.
    Original FAT type: FAT16
    New      FAT type: FAT12
  Failed.
I don't know what to do. Could you help me?

Best Regards,
Nathan Paulino Campos
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: Make And Emulate a FAT12 Floppy

Post by gravaera »

Maybe you could try reading the error code.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

My floppy image is a FAT16, and it should be FAT12. This is the error(as I can see). :(
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by pcmattman »

dd + mkdosfs.

Don't even need to mount the image.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

pcmattman wrote:dd + mkdosfs.

Don't even need to mount the image.
Yeah, but I need to mount the image, because the program BOOTABLE.EXE just writes to a "physical" drive. :cry:

Also, did you have a good tutorial of how to use dd and mkdosfs using Cygwin?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by pcmattman »

dd + mkdosfs can create a FAT12 image... that you can mount with VFD and use with this "BOOTABLE.EXE" thing you're obsessed with.

It'd be easier to just write your own bootloader.

As for tutorials, you can spend 30 seconds on Google, I'm not doing that for you. Or try "man dd" and "man mkdosfs" and try learning something for yourself for once.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

Ok, I've done better, I got my Linux laptop(an Eee PC 904HD with Ubuntu Hardy Heron), and I will do all, using Wine to help me with the BootProg things. :)
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Tosi »

As far as I know you don't need anything like BootProg on linux.
You can set up a floppy image as a loopback device (see losetup(8)) and then mount it like any other device.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

Tosi wrote:As far as I know you don't need anything like BootProg on linux.
You can set up a floppy image as a loopback device (see losetup(8)) and then mount it like any other device.
Yeah, I know that, but I'm mounting it to a directory(/mnt/os), then when I try to write to the boot sector, like this:

Code: Select all

dd if=/mnt/os of=boot.bin bs=1 count=512 skip=0
I got an error message saying that it's a directory.

What I need to do?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Combuster »

Image

Mounting is for accessing the filesystem. Access the image for writing the bootsector.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

Combuster wrote:Mounting is for accessing the filesystem. Access the image for writing the bootsector.
Using cat for this?
tharkun
Member
Member
Posts: 51
Joined: Sat Mar 21, 2009 1:29 pm
Location: Ireland

Re: Make And Emulate a FAT12 Floppy

Post by tharkun »

Unmount the image, and then dd to the loop back device, replace /dev/loop0 with the name of the loopback device.

Code: Select all

dd if=boot.bin of=/dev/loop0 bs=1 count=512 skip=0
This will write the bootsector to the loop device (and your floppy image)
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

Now I just got a 512 bytes image(that is just the copy of the binary), just like if I do like this:

Code: Select all

cat boot.bin > os.img
Let's do this better, someone creates a FAT12 floppy image, install BootProg on it and send me. [-o<
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Combuster »

Since you're asking for a floppy and not a floppy image, Can we have your post address? I happen to have something :twisted:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Make And Emulate a FAT12 Floppy

Post by Nathan »

Nice joke. :lol:

But on my question that is on the last post, I've asked to a floppy image.
Locked