Darwin 0.1 + Rhapsody DR 2 booted!

Following up from yesterday, here we go!

Rhapsody 1.0 booting

So I finally got it running, after some inspiration from NCommander over at nextcomputers.org forums, that the Darwin 0.1 kernel is in fact 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 boredom, 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.

For fans, here is a qemu 0.90 image+exe that can run Darwin 0.3 into single user mode.

EDIT and for people still hitting this, here is a multiuser bootable image.  I’ll keep updating on the source forge page.

19 thoughts on “Darwin 0.1 + Rhapsody DR 2 booted!

  1. it’s a good idea to port all of the new drivers , including any vesa driver for openstep 4.2 for the x86 platform.Nice psot

    • Interestingly enough it seems to be the same driver model. The PCI NE2000 driver that I’m currently using is what I loaded on my NeXTSTEP 3.3 image. So the same driver works in Darwin 0.1 and Darwin 0.3!

      It’s recently been shown that the OPENSTEP y2k kernel is capable of booting up a NeXTSTEP disk, with it’s device driver tree, so it *may* be possible to use this Darwin as a starting place to update both NeXTSTEP, OPENSTEP, and Rhapsody.

  2. I admit I have little interest in apple and any of the operating systems they bought or wrote, but this is way cool; good job.

    • I understand, their older stuff really didn’t interest me at all, save A/UX. But it was SYSV.

      Although this is the NeXTSTEP/OPENSTEP kernel being updated, and it’s very much UNIX, which interests me. I recall this stuff being extremly difficult to work with, but incredibly fast machines of today made it a breeze to get it to compile, so really a usable system for early Darwin seems to have been basically there the whole time. Now that I have the 0.3 disk image, I’ll have to see how much is there in the way of device drivers.

  3. This is really, very, awesome stuff neozeed. I remember feeling so excited when Apple released the Darwin source code, assuming a community of clever folks would grow up around Darwin and create an ecosystem. Back in those days, my school lab was all Mac, and I finally saved up enough to buy a used Pentium Pro workstation and installed Linux (Red Hat 5.0) and along comes Apple with a technology preview that was both Unix and beautiful. Definitely remember being bummed to see Darwin fizzle, it seemed to have so much promise as a basis for greater things. If Apple had allowed more cooperation and fostered a community around Darwin, who knows? Will definitely keep an eye on this – thanks for bringing back some memories neozeed

    • Well it’s never too late! . lol

      My current goal is to now get that EIDE driver from 0.3 building, and running on something more modern. The stretch goal is to make a UFS2 that supports far larger disks. Getting away from those ancient 2GB partitions is a must, just as any attempt at running this stuff on modern hardware, or Qemu’s just results in endless lockups with the EIDE driver…

  4. Wow! This is amazing! Rhapsody / OS X Server 1.0 has always been one of my favourite OS. It’s great to see some progress there. Being able to use newer drivers would be awesome. As a VirtualBox user, I really crave for a VESA driver, as Rhapsody in bw is simply not that much fun.

  5. Very interesting and good experimenting. Quick Q – what boot did nextstep use to boot 68k Macs. Pondering as OSX never supported nubus architecture PPCs (needing OF to boot) … Yet the original NextStep presumably did. Any thoughts/insight?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.