intermezzOS / kernel

A hobby operating system, in Rust
http://intermezzos.github.io/
Apache License 2.0
1.39k stars 91 forks source link

OS X #13

Closed emkay closed 8 years ago

emkay commented 8 years ago

Hi all, I decided to take a crack at getting this sucker working on os x. I went through and documented my steps in a script. @steveklabnik said an issue would be good to document this stuff so yay :tada:.

Things the script does:

  1. brew install tools that it can like gmp, mpfr, libmpc, autoconf, and automake
  2. Download and compile tools in order to make a cross compiler: binutils, gcc, objconv
  3. Download and compile grub using the cross compiler

This works or at least doesn't error out obviously. I'm going to run through this process again when I have more time to see if there are any silent errors.

By changing the Makefile a little to point at the ld and grub-mkrescue that you just made you should be able to run make now. Nothing errors, but at this point nothing shows up after you have the kernel running.

Also I'm a super newbie at all of this stuff so I apologize if something is wrong. Also just a disclaimer the script above downloads and compiles stuff into your home dir. I suggest you read it or edit it if you want to change the dirs that it puts stuff in. They should be made configurable at some point.

I'll post here with any follow up I find.

emberian commented 8 years ago

A note, brought up by rschulman in IRC that I can confirm, is that qemu can load multiboot kernels directly with the -kernel command line arg, without having to go through a bootloader like grub. You might still want to build grub for deploying to hardware or other VMs (I'm not sure which others, if any, support multiboot directly).

phil-opp commented 8 years ago

qemu can load multiboot kernels directly with the -kernel command line arg

I tried it many times but it seems like -kernel doesn't work for multiboot2 and/or 64-bit ELF files.

But I would be happy to stand corrected.

rschulman commented 8 years ago

I'm also wrestling in my own mind about whether we need a cross-compiled grub at all, or just need regular grub for mac. Grub isn't targeting any system and we don't want to run grub on another triple. We just want to use grub on the mac to create a bootloader in the ISO. Am I right about that or very confused? Could be either!

emberian commented 8 years ago

@phil-opp ah that may be the case, I've only used elf32

emkay commented 8 years ago

I could be completely wrong about needing a cross-compiled grub. I'm pretty sure I had tried using the -kernel flag but it was not working. I don't exactly remember at what stage I had tried it though. It would be awesome to get rid of the cross compiled grub though as it's sort of a pain to get up and going.

rschulman commented 8 years ago

Yes, now that I see the page you referred to in the IRC channel, it looks like I'm just confused/wrong, and we do need to cross compile grub as well. Too bad!

emkay commented 8 years ago

ok my bad. This is quite embarrassing. In the past when using qemu it ran in the terminal. this version opened a new window that I didn't notice because I full screen everything. @cmr pointed out you can use the -nographic option to have it not do that.

Anyways, for the good news. This totally works! image

There is intermezzOS running on OSX :tada:

steveklabnik commented 8 years ago

Awesome!!!!

steveklabnik commented 8 years ago

Since this does work, I think this can be closed :)