Page 1 of 1

Need help with building process

Posted: Sat Jul 19, 2008 1:40 am
by osdf_1
How can I create floppy images with FAT implemented?
I read Bran's Kernel Development Tutorial and downloaded the floppy image that it contains, I ran it in Q (Mac OS X's version of Qemu) and it ran perfectly. I've always had trouble with the building process so I decided to make an image file with the same files as the one I downloaded. Here's what I did:

1. hdiutil create -srcfolder (folder containing the same files as the other image) -fs MS-DOS -o Test.dmg
2. hdiutil convert Test.dmg -format RdWr -o Test.img

What I got was an identical (except for the size, I think the other image is compressed) image to the one in Bran's Tutorial but, when I tried to run it in Q, the results weren't the same (it didn't boot).

So what I'm asking is, how can I create floppy images with the FAT file system (or some file system) implemented and use GRUB in them when the only tools I have are hdiutil and dd?

Any help will be very much appreciated (I've been trying to do this stuff for months).

Re: Need help with building process

Posted: Sat Jul 19, 2008 4:06 am
by Brynet-Inc
If you've created a disk image, hdiutil(1) can also "attach" the image as a /dev node, similar to OpenBSD/NetBSD's vnd(4) device.

http://developer.apple.com/documentatio ... til.1.html

There is an examples section, it looks strait forward... after it's attached, and you determine the device node, newfs_msdos(8) can be used.

http://developer.apple.com/documentatio ... dos.8.html

I haven't looked at the hdiutil man page thoroughly, but it might also be possible to skip this step...

Finally, you could also compile mtools and work directly with an image created via dd. :)

Hope that helps.

Re: Need help with building process

Posted: Sat Jul 19, 2008 5:41 am
by JamesM
Leopard is certified as Proper UNIX - so why can't you just use losetup?

Re: Need help with building process

Posted: Sat Jul 19, 2008 6:33 am
by Brynet-Inc
JamesM wrote:Leopard is certified as Proper UNIX - so why can't you just use losetup?
Because that's a Linux-ism, not a Unix standard... it's definitely not defined in SUS or any other standard body. ;)