can you boot on an intel-based macbook?

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
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

can you boot on an intel-based macbook?

Post by xDDunce »

hiya,

i have recently tried booting my OS on my MacBook (bad idea i know, in case something goes MAJORLY wrong) but it didnt even get through to grub, it just shows a black screen and that's it. i know it is possible to boot it, because i have ran a linux live cd distro before, and i have got windows xp pro boot camped on the hard drive too so it isnt something wrong with booting from a cd.

i dont understand what is going wrong. im booting from CD, using GRUB, and the most i ever get is the blank screen. is there anything different about the MacBook Bios that makes it incompatible with GRUB? does anyone know if it is el torito compatible or not?

thanks in advance.

James.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: can you boot on an intel-based macbook?

Post by piranha »

When I booted on a friends macbook, it got to GRUB and showed the menu, but the keyboard wouldn't work, so I couldn't test it, cause i forget to put a timeout command in :(

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: can you boot on an intel-based macbook?

Post by xDDunce »

hmmm... but in the linux distro i ran, it had a grub boot screen, and it worked fine. keyboard and everything.


something doesnt seem right here...
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: can you boot on an intel-based macbook?

Post by Troy Martin »

Odd, does the EFI in the Macbook support regular BIOS functions? That could be a problem on older EFI versions.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
samoz
Member
Member
Posts: 59
Joined: Sun Jun 01, 2008 1:16 pm

Re: can you boot on an intel-based macbook?

Post by samoz »

Are you actually installing it or are you running it off a CD?

If you're installing it to the hard drive, you will need to play around with stuff because Macs use a different format than windows and linux do to boot. My own Macbook gives me no end of problems when I try to play around with different operating systems.

If you're running from a CD and its getting to Grub then freezing, I'd say its more a problem in your code.

Good luck!

Let me know how it goes!
Hexciting: An open source hex editor for the command line.
https://sourceforge.net/projects/hexciting/
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: can you boot on an intel-based macbook?

Post by quok »

Remember that Apple machines use EFI, not BIOS. However, when Apple released BootCamp, they also released a 16-bit CSM (Compatibility Support Module) for EFI. What's this CSM that I speak of? A legacy BIOS.

Make sure you've got the latest firmware updates for your machine installed. I'm not sure exactly what version it is, but it's really easy to check for updates. :) You most likely do have them installed already.

The legacy BIOS, as well as the EFI firmware, are both El Torito compatible. EFI demands El Torito compatibility, however the EFI version of El Torito is slightly different from the El Torito standard you may otherwise know and love.

I don't really have any other advice to offer, but I've been able to use a bootable CD with GRUB to boot my own OS on my MacBook Pro without any problems, and I've done so many times. Are you sure your CD is correct? Does it boot on any other systems?

@samoz:

What kind of problems do you have when booting other OSes? I've not had any problems booting the various linux distros I've tried, but remember that Macs, since they are EFI based, use a GPT partitioning scheme by default. Many OSes cannot boot from GPT partitions, for various reasons.
User avatar
samoz
Member
Member
Posts: 59
Joined: Sun Jun 01, 2008 1:16 pm

Re: can you boot on an intel-based macbook?

Post by samoz »

Well i can boot Live CDs but trying to install them has given me no end of trouble. I recently have been trying to install Linux on my external FireWire hard drive, but to no avail. I've given up pretty much so I'll just be content with Mac OS X :)
Hexciting: An open source hex editor for the command line.
https://sourceforge.net/projects/hexciting/
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: can you boot on an intel-based macbook?

Post by xDDunce »

hiya,

yes, i know macs use EFI not bios, but i just forgot. :lol:

i boot from CD, and run from it. no hard drive is used at all. but i never get to grub when it is my OS whereas if it was a linux distro it will run fine till executing the kernel. only 1 distro actually works from my experience, but it didnt install. windows xp went on fine though.

my Mac OS X is fully updated and i guess that involves firmware and everything with it. but i'm just lost. but atleast im not the only one having the problems :)

cheers,

James.
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: can you boot on an intel-based macbook?

Post by quok »

johnsy2008 wrote:hiya,

yes, i know macs use EFI not bios, but i just forgot. :lol:

i boot from CD, and run from it. no hard drive is used at all. but i never get to grub when it is my OS whereas if it was a linux distro it will run fine till executing the kernel. only 1 distro actually works from my experience, but it didnt install. windows xp went on fine though.
This could be a problem related to how you are generating the ISO image, or even the version of GRUB that you are using. What version is it, anyway? And how are you generating the ISO image? hdiutil? mkisofs off macports? A complete command line there would help lots. You are using the eltorito boot file from GRUB for your ISO image, right? That may sound silly of me to ask, but others have made that mistake before. :)
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: can you boot on an intel-based macbook?

Post by xDDunce »

quok wrote:
johnsy2008 wrote:hiya,

yes, i know macs use EFI not bios, but i just forgot. :lol:

i boot from CD, and run from it. no hard drive is used at all. but i never get to grub when it is my OS whereas if it was a linux distro it will run fine till executing the kernel. only 1 distro actually works from my experience, but it didnt install. windows xp went on fine though.
This could be a problem related to how you are generating the ISO image, or even the version of GRUB that you are using. What version is it, anyway? And how are you generating the ISO image? hdiutil? mkisofs off macports? A complete command line there would help lots. You are using the eltorito boot file from GRUB for your ISO image, right? That may sound silly of me to ask, but others have made that mistake before. :)
yeah, i thought it may just be me :D lol. but as for the details, my OSDev setup is on my windows partition, and i use mkisofs to generate an iso image using:

Code: Select all

mkisofs -R -b grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o OS.iso cd
using GRUB version 0.97 eltorito boot file.
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: can you boot on an intel-based macbook?

Post by quok »

johnsy2008 wrote: yeah, i thought it may just be me :D lol. but as for the details, my OSDev setup is on my windows partition, and i use mkisofs to generate an iso image using:

Code: Select all

mkisofs -R -b grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o OS.iso cd
using GRUB version 0.97 eltorito boot file.
Well, that looks fine to me. I use -r instead of -R though; it sets the file user/group ownership and attributes to something more useful for read-only media. I really doubt it's your problem, though!

If you care to provide an ISO image, I'll happily test on my mac and see if I can figure out what's wrong.
User avatar
elderK
Member
Member
Posts: 190
Joined: Mon Dec 11, 2006 10:54 am
Location: Dunedin, New Zealand
Contact:

Re: can you boot on an intel-based macbook?

Post by elderK »

Just to be clear here, Macbooks sold in late 2k7 can easily boot legacy OSes.

As soon as the EFI firmware detects media, that is 'legacy', it loads the Compatibility Module - and proceeds like any semi-normal BIOS machine.
Older Macbooks may need firmware updates - and then, then they can do the same thing ...

If you use something like, say, rEFIt (google it, dontcherknow!), you'll be able to boot easily from USB drives too.

Oh - and if you say, strap out of the standard IBM partition tables - you should have no issues.

Ie:
- MBR is untouched. Just uses Apple legacy bootcode - searches, finds active partition, loads the VBR.
- VBR is loaded, executed like normal.
- If you are MBR only - or don't care about GPT compatibility and use Extended/Logical partitions, then it is a little different.
1) MBR is loaded, looks for active partitions, scans through EBR chain, finds VBR, boots.

Nothing that scary.

Although, why use legacy BIOS when you can play with EFI?

~K
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: can you boot on an intel-based macbook?

Post by xDDunce »

elderK wrote:Just to be clear here, Macbooks sold in late 2k7 can easily boot legacy OSes.

As soon as the EFI firmware detects media, that is 'legacy', it loads the Compatibility Module - and proceeds like any semi-normal BIOS machine.
Older Macbooks may need firmware updates - and then, then they can do the same thing ...

If you use something like, say, rEFIt (google it, dontcherknow!), you'll be able to boot easily from USB drives too.

Oh - and if you say, strap out of the standard IBM partition tables - you should have no issues.

Ie:
- MBR is untouched. Just uses Apple legacy bootcode - searches, finds active partition, loads the VBR.
- VBR is loaded, executed like normal.
- If you are MBR only - or don't care about GPT compatibility and use Extended/Logical partitions, then it is a little different.
1) MBR is loaded, looks for active partitions, scans through EBR chain, finds VBR, boots.

Nothing that scary.

Although, why use legacy BIOS when you can play with EFI?

~K
:o someone else who knows of rEFIt?? :lol:

but yeah... i do use rEFIt already, and my OS appears fine on the boot screen. its just when i select it, it shows a black screen and thats it.

as far as i know, i have the correct firmware. it was brand new back in september so it should have came with the recent version installed right?

and if i was to use EFI instead of BIOS, what would i have to do to make my live cd cross-compatible with both BIOS *AND* EFI? would it involve having a differently compiled version of grub? if so, could someone hook me up with a copy? last time i tried compiling grub, i failed miserably (even when following the tutorial on the wiki and elsewhere!)
User avatar
elderK
Member
Member
Posts: 190
Joined: Mon Dec 11, 2006 10:54 am
Location: Dunedin, New Zealand
Contact:

Re: can you boot on an intel-based macbook?

Post by elderK »

Okay, well.

Not to be overly offensive here, dude, but... have you considered that you are doing something WRONG? :P
That perhaps your boot code is all messed up?

You are booting from CD-ROM, via El Torito GRUB? Right? Wrong?
As for EFI, not necessarily. You'd only need to create a binary that could recognize EFI when it is availabe and take advantage.
Otherwise, rely on standard BIOS methods. You would need a specific EFI toolchain though.

Look up GNUEFI :P And EFI specifications - might come in handy ;)

One thing that I encountered with my Macbook was, that if I had USB Pendrives attached when booting something like a Linux CD or the
Windows Installation disc, the system would hang. So, try removing your pendrives, USB peripherals, etc.

After that - I was all fine and dandy - with my kernel and others.
ALSO, keep in mind - that even though we have a little Apple sticker saying "OH GOLLY! BOOTCAMPINESS?!?!", doesn't exactly make the
Legacy mode of Macbooks 'supported'. It's simply possible...

~K
Does whatever you are booting, boot in VPC, Bochs, Qemu AND live hardware (ie: not your macbook?). If not, :P find out why under emulation.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: can you boot on an intel-based macbook?

Post by xDDunce »

elderK wrote:Okay, well.

Not to be overly offensive here, dude, but... have you considered that you are doing something WRONG? :P
That perhaps your boot code is all messed up?
yes i have considered this, read a few posts above and you will see.
elderK wrote: You are booting from CD-ROM, via El Torito GRUB? Right? Wrong?
As for EFI, not necessarily. You'd only need to create a binary that could recognize EFI when it is availabe and take advantage.
Otherwise, rely on standard BIOS methods. You would need a specific EFI toolchain though.

Look up GNUEFI :P And EFI specifications - might come in handy ;)
as i said before, could someone hook me up with a precompiled version of grub because i couldnt compile it. so i doubt changing toolchains and trying again will make much difference.
elderK wrote: One thing that I encountered with my Macbook was, that if I had USB Pendrives attached when booting something like a Linux CD or the
Windows Installation disc, the system would hang. So, try removing your pendrives, USB peripherals, etc.
yes, i have noticed that but it does seem to boot Mac OS X fine, and usually windows will boot fine with the occassional hang but this is like... once every 50 times really...
elderK wrote: After that - I was all fine and dandy - with my kernel and others.
ALSO, keep in mind - that even though we have a little Apple sticker saying "OH GOLLY! BOOTCAMPINESS?!?!", doesn't exactly make the
Legacy mode of Macbooks 'supported'. It's simply possible...

~K
Does whatever you are booting, boot in VPC, Bochs, Qemu AND live hardware (ie: not your macbook?). If not, :P find out why under emulation.
IMO, that spple sticker doesnt mean anything except "WE CAN PUT WINDOWS ON HERE WITHOUT FAILURE NOW!!" and that is true (in my case anyway).

as for emulation; i test my OS in bochs, and when testing compatibility, i test on VPC and occassionally my PC (although not very often). and it runs fine (or atleast my old code did. my new code has a few errors in it. C++ IDT's are alot more confusing than C :lol: )
Post Reply