Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / May 2008



Tip: Looking for answers? Try searching our database.

Why is BootX a Mach-O file?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lorenz Hipp - 21 May 2008 23:08 GMT
Hello people!

Does someone know, why the bootloader BootX is an Mach-O file
or otherwise asked, does Open Firmware really has knowledge about
the Mach-O file format and how to access a file on a specific volume
and filesystem, like HFS, EXT2? I expected it to be something like a
"pure" machine code dump, that is loaded and executed.

I can (and do) inspect the code for BootX in the XNU Kernel source code
provided by Apples developer pages, but cannot see the (Forth/Fcode) code
of the used Open Firmware - or at least did not found the one, Apple uses and
don't expect to find it anywhere. I can get "only" my hands on the sources you
can find on http://www.openbios.org/Open_Firmware , and guess things.

So, if it does know about these things, is there a way to copy the complete
contents of the rom that contains the OF to a file, so I can inspect and maybe
modify it? Just for curiosity...  ^^

Thanks in advance,

Lorenz
Robert Spykerman - 22 May 2008 02:24 GMT
> Hello people!
>
[quoted text clipped - 3 lines]
> and filesystem, like HFS, EXT2? I expected it to be something like a
> "pure" machine code dump, that is loaded and executed.

Hmm... I haven't actually looked at open firmware (my mac's a penryn)
but it looks as if you're right, it looks to me like a binary dump.

I don't believe BootX is a mach-o file, at least the one I have
residing in /System/Library/CoreServices.

If this is the same file we're both talking about, there's no FEEDFACE
magic number, you appear to get an array of chars at the start.

I don't really know the boot process of OS X so I don't know if this
is the first binary loaded or not, or if we're talking about the same
file.

> I can (and do) inspect the code for BootX in the XNU Kernel source code
> provided by Apples developer pages, but cannot see the (Forth/Fcode) code
[quoted text clipped - 5 lines]
> contents of the rom that contains the OF to a file, so I can inspect and maybe
> modify it? Just for curiosity...  ^^

I have to say I don't know  much about Open Firmware and how it's
implemented. I would guess it's a threaded forth as opposed to a
subroutine threaded or native code forth. I'm guessing you will have
access to the interpreter - In which case you may have a SEE word that
may show you what each individual word does. Or WORDS often will bring
up the dictionary.

> Thanks in advance,
>
> Lorenz

Robert Spykerman
Ben Artin - 22 May 2008 16:16 GMT
> Does someone know, why the bootloader BootX is an Mach-O file
> or otherwise asked, does Open Firmware really has knowledge about
[quoted text clipped - 11 lines]
> contents of the rom that contains the OF to a file, so I can inspect and maybe
> modify it? Just for curiosity...  ^^

I believe you will find
<http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Artic
les/BootProcess.html> useful.

hth

Ben

Signature

If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>

Robert Spykerman - 22 May 2008 17:08 GMT
> I believe you will find
> <http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemSt...
> les/BootProcess.html> useful.

Very interesting read. Thanks. There's even a section on Open Firmware
there. I'm quite sad that my intel mac doesn't have it :(

Slightly off topic but does anyone know why apple abandoned Open
Firmware on the intel macs?

> Ben

Robert Spykerman
Lorenz Hipp - 22 May 2008 18:35 GMT
>> I believe you will find
>> <http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemSt...
[quoted text clipped - 6 lines]
>
> Robert Spykerman

I am terribly sorry, this message was still "constructed" by me and not meant
to be sent - it was an accident..  ^^

This document of Apple you cited does not go deep enough for me, but I will
"absorb" it for sure.

That the BootX file is of a special format (XCOFF perhaps?), I've already seen,
because of the xml header and, as you mentioned and the missing 0xFEEEDFACE
magic number of a Mach-O file. But it is some kind of executable with a similar
layout, with some text, data, __PAGEZERO, __cstring and so on sections at it's
head of data, just after the xml text, that looks like a Mach-O file.

Well, I will dig into it a little bit more and will tell, if anyone is
interested, what I
found.  ^^

> Slightly off topic but does anyone know why apple abandoned Open
> Firmware on the intel macs?

Why Apple chose to switch off from Open Firmware on intel macs? I guesss, that
for some kind of reasons, EFI was a better solution for Apple (- not
the user, after all).
Perhaps for some kind of software-protection or to prevent a much too
fast crack
of the machines, to get Mac OS X on non-Apple hardware to run? But that is pure
speculation by me.

Lorenz Hipp
Reinder Verlinde - 22 May 2008 18:52 GMT
In article
<2916cb33-74d3-46de-9335-abad2c7ed197@i36g2000prf.googlegroups.com>,

> Slightly off topic but does anyone know why apple abandoned Open
> Firmware on the intel macs?

My guess would be that it was the same as what I guess was the reason
they chose it for the PPC mac: they just used the motherboard designs
their supplier provided. Deviating from what your provider more or less
gives you, commercially, has no clear benefits.

Additional arguments could include:
- better compatibility with current or future PCI cards
- easier migration path to hardware that can boot into MS Windows
 (I guess that Intel wrote or helped write the BIOS emulation-or-
 what-do-you-call-it for EFI)

Reinder
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.