Category: Darwin

Interestingly enough a lot of the same weirdness of missing bits I saw on the x86, is also on the PowerPC.

There is no nice installer, the CD image actually boots MacOS 8.6 which currently won’t run on Qemu. However Darwin 1.0 uses MacOS 9, which will. There is not install program for Darwin, rather you need a secondary disk, that is partitioned so the volume manager will pick it up, and then you restore a backup onto the target disk. Naturally the restore program from 0.3 won’t work, but the 1.0 will under the G4 Cube MacOS 9 CD-ROM install.

Currently there is no networking, I’m guessing I need drivers from OS X 1.x but Ive had really bad luck with the mouse to try to open a terminal window to see if the new sungem NIC is functional at all.

It will then format the disk, and copy over the base operating system. After that it’s time to shutdown, and reboot the VM. I couldn’t figure out a pure hard disk boot, but again using the CD-ROM, you can just tell it to pull the root from the hard disk.

And after this, it’ll want to reboot again. Launch it up and now we get the initial setup

Setup Assistant

And with that out of the way, we can logon!

And after a while, it’ll load up the desktop

OS X Server 1.2 Desktop

As mentioned above, the mouse is incredibly jittery. Doing anything graphical is very difficult. But here we are, running OS X/Rhapsody for the PowerPC!

That’s all!

Because the mouse is VERY jumpy at the moment, Im going to make some pre-configured disk images available because running the disk tool under OS 9 is a major pain. The first image has only been partitioned, while the second has completed the ‘text mode setup’, aka a minimal install.

NetInfo is completely broken, but I just disabled it, I don’t think anyone cares. It is missing some kernel system call, and copying the one from Rhapsody results in missing calls in the /System library. So instead of spending more time on it, I just had the startup comment it out.

The headers and spiraling dependencies of things is out of control, so it really needs to be re-built. But there is enough there for it to boot up, you can telnet into it, and compile simple programs.

As far as I’m aware none of the early Darwin’s ever were released as binary for x86, so I guess that is a nice thing.

The EIDE driver is still busted, I spent a day trying to debug it to come to the conclusion that, yes it does lose interrupts. While stacking OO drivers to add features sure looks nice, it makes fundamental issues, either in the Driver itself, or the object framework (let’s face it, nothing is defect free) hard for an outsider to find. From the outside I used to think it was either the DMA or the multisector transfers screwing it up, but with source in hand, disabling both did nothing.

For people who like this kind of stuff. In my limited testing, I found some configure scripts don’t like the idea of a Darwin with a major number of zero. And seeing that this would fall into place during OS X Server 1.0.2, which makes it Rhapsody 5.5. I don’t think either of the 1.2 or 1.2v3 Rhapsody 5.6 versions were ever released to the public in source, but maybe someone has a copy somewhere.

It still boots single user mode, one of the source projects has a nice rm -rf $DSTROOT so it nuked what little progress I made during the week.

But I have the compiler running and lots more. It has issues with netinfo which is really the only thing blocking it from multiuser boot. Some syscall not found, and I need to dig into the kernel to see if it even exists…

I’ll re-build all the libs and headers. Oddly enough the disk image I can build libraries and programs can’t build driverkit or the kernel…

There is no games, nothing fun to do, I didn’t even build a compiler. It’s just enough to show that it’ll boot up. If you manually conifgure the loop back you can ping yourself, launch inetd you can even try to telnet in, but control break is .. broken, and there is no NetInfo running so no passwords.

Of course for anyone finding this site today there are more newer, and capable images on my sourceforge page:

So I finally got it running, after some inspiration from NCommanderover at nextcomputers.org forums, that the Darwin 0.1 kernel is infact build able, I went ahead and took a stab at it. While he was trying to start from OPENSTEP, I tried it from something as close as I could to the target, which was Rhapsody DR2.

Back in the days of the NeXT / Apple merger, there was hope that OPENTSTEP could become the next great OS for the Apple Macintosh. It had been a while since NeXT had the OS running so things had rotten somewhat, as time had passed on. However the first and most viable platform would of course be the x86. Back in 1993 while feeling increased pressure in the hardware space, NeXT was forced to start porting away from their black m68k based hardware, and this was an opportunity to get their software running on different platforms. And sadly in 1993, the NRW aka NeXT RISC Workstation that was in development with dual m88000 processors was killed along with all hardware projects. In the end it didn’t matter as much as the only processor from the early 90’s that has a vibrant future is the i386.

So back again to this transitional time before OS X 10, there were developer versions of this OS seeded out that required you to have an intel machine as OPENSTEP was being ported to the PowerPC machines that Apple was selling.

So on May 14, 1998, the last public version for the Intel processor was released, DR2.

However two interesting things happened along the way to what would become OS X Server 1.0 . The first is that Apple gave up on the ‘yellow box‘ portable API, and to satisfy the GPL requirement to release changes to source code, Apple would go one further and release the source code to many of the internal system utilities, along with the kernel in what was known as Darwin.

This was a big deal for many of us, as the cost of getting the source code to any UNIX was incredibly prohibitive, and OS’s like Linux, NetBSD/OpenBSD/FreeBSD were picking up steam, OPENSTEP being awaken from it’s cryonic hibernation but with the promise of being free and open software was pretty great! Back in the day it sure looked promising!

Obviously things didn’t work out as everyone had hoped as Apple either straight up ignored anyone on the outside, or they hired people who showed promise, made them sign NDA’s and were basically never heard from again.

So the recently recovered source code to Darwin 0.1 corresponds with the release of the PowerPC only OS X Server 1.0. However as we all found out, Darwin will still built and maintained on Intel, as it was a very secretive plan B, in case something went wrong with the PowerPC platform. Being portable had saved NeXT before, and now it would save Apple.

So with this little background, and a lot of stumbling around in the dark, I came up with some steps, that have permitted me to build the Darwin 0.1 kernel under DR2.

However it was not perfect, and the biggest glaring issue was due to the software that was recovered, the layer known as driverkit, (driverkit-139.1-1.tar.gz) turns out to be from another, later release of Darwin, the 0.2 release, which the only thing surviving is the driver kit. It doesn’t build cleanly, and In order to get it to build I had to break the mach PCI bus. This means that yes, PCI devices will not load at runtime, only at boottime by sald.

After a lot of fighting I was able to produce a system that could boot into both single user and multiuser mode, although it was unable to load drivers so there was no networking, and no UI.

In a fit of boredrom, I built a bunch of the command line tools for Darwin, and a few libraries, and then went to see why the driverkit had a problem finding the reason why KernBus was undefined, or even with some attempts at helping all the methods were unknown, I stumbled onto the fact that during compilation it will generate new headers, and in those headers are the correct interface for driverkit to call into the KernBus. So I was able to quickly rebuild driverkit, then re-link into the kernel and now I could load drivers! Thrilled with this much, I did something more aggressive, I made a dump of my install ‘target’ and then restored it onto an image of my dev VM. And much to my amazement it booted up to the graphical login. I now had PCI working correctly.

Darwin 0.1

This kind of thing is not for casual users, but if you install DR2 into a VM, you ought to be able to then use this ISO image, and follow these instructions, and you will then have a DR2 OS from 1998 with the OS X 1.0 kernel from 1999 running. The biggest difference I’ve noticed is that the newer kernel can use 512MB of RAM, a nice bump up from 192 which was the prior limit.

Obviously there is a lot more work to be done, it’d be nice to find some source to an IDE or other block controller and modify it to work with the massive disks of today, along with the filesystem code to handle partitions larger than 2GB.

Maybe it will be possible to port in the driverkit to XNU, so we can get things like existing drivers, and SMP, massive filesystems etc.. It’s great to see we are going the right way.