views:

98

answers:

2

I was following these tutorials to make a simple kernel that I would then load using GRUB. The instructions for compiling didn't work (ld couldn't find the -T option) and when I finally got a compiled file it was in Macho format. What are the correct steps to take when compiling these files on Mac.
Edit:
I compiled the code on an Ubuntu virtual machine and I so I have the kernel.bin file. Now how can I make a bootable image that runs the kernel?

+3  A: 

You can't do this on a Mac directly, because Macs use EFI as their bootloader (kind of). Your best bet for this kind of stuff is to go download Sun VirtualBox and make a Linux VM - this has the additional advantage that you can take snapshots so if things go pear-shaped you can always roll back (easy to corrupt the HD when you get to writing the I/O routines).

Paul Betts
A: 

I've used rEFIt to make bootloaders for Windows and Linux compatible (or not so nasty) with the Mac bootloader.

If you want a Mac VM environment, I've heard Q is good and I've used VMWare's Fusion personally.

adam_0
How does the bootloader not allow me to use linker scripts? I think it has something to do with Mac's using the BSD linker instead of the GNU linker. I don't want to burn and run the OS on my Mac, I just want to compile it into a bootable image.
None