Need help with building process

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
osdf_1
Posts: 20
Joined: Sun Nov 25, 2007 7:55 pm

Need help with building process

Post 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).
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Need help with building process

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Need help with building process

Post by JamesM »

Leopard is certified as Proper UNIX - so why can't you just use losetup?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Need help with building process

Post 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. ;)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply