:: The Project ::
The NetBSD operating system runs on a large variety of computer platforms. One of the platforms on which it will not run, however, is Apple's line of PowerPC G5-based computers: The PowerMac G5, iMac G5, and Xserve. These computers differ from previous Macintoshes in two significant ways: The processor is 64 bits, and the system architecture has been redesigned around the HyperTransport bus. Also, more recent models abandon parallel ATA in favor of serial ATA, for which a new onboard controller has been added. At the time this project was proposed, NetBSD had no support for any of these things, so my goal was to add it.
Soon after the project was accepted, however, there was an announcement made by Sanjay Lal that he had already added minimal support for the Power Mac G5, with which it is possible to netboot a PowerMac G5 in single-user mode and output to a serial console. After discussing this with my mentors, we decided that the underlying purpose of this project was to make NetBSD more usable for people with Macs, and this would benefit most by collaborating with Sanjay to extend his work and add full, production-level support for the G5. This is comprised of an assortment of smaller sub-projects, which are detailed below in the list of formal deliverables.
:: Status ::
- 2006-05-23 Project accepted! Starting planning phase. Learning about Open Firmware and the NetBSD boot process. Setting up cross-compilation and netbooting environment.
- 2006-06-02 Starting a "dummy" kernel for testing Open Firmware calls.
- 2006-06-07 Sanjay Lal reports that he has made NetBSD boot on a G5. Evaluating options with my mentors.
- 2006-06-09 The first order of business now is to add support for the PowerMac's onboard SATA controller, the ServerWorks/Broadcom Frodo, which is part of the K2 South Bridge. Learning about adding device drivers to NetBSD. Update: There is actually a driver, swsata(4), already in -current. Shifting attention to Open Firmware support, since Sanjay's patches currently require a serial console.
- 2006-06-14 Got Sanjay's patches and trying them on my own machine. Ordered a GeeThree Stealth Serial card for my G5 as there is no framebuffer support yet.
- 2006-07-08 Making some progress on getting built-in framebuffer working, but not there yet. More info.
- 2006-07-25 Fixed Open Firmware interface and made console operational. Booting NetBSD on a G5 no longer requires a serial cable and second computer. :)
- 2006-08-17 Updated to -current and made diffs of my code for others to test. Working to fix zs(4) driver so that we can switch to it from Sanjay's failsafe-console after pmap(9) is brought up. This two-stage initialization mirrors what I've done with the ofcons(4) -> ofb(4) switch when using the framebuffer. It also makes it easy to enable or disable the early console simply by changing the initial cons_init_stage variable in arch/macppc/macppc/machdep.c.
- 2006-08-18 Sanjay adds a bugfix to enable multiuser mode; confirmed working on my machine. Once I fix a few other bugs, the system should be usable for productive command-line work. (Though it would be nice to add some code that interfaces with the fan controller soon so that the machine doesn't become a vacuum cleaner after 2 minutes of uptime. ;)
- 2006-08-19 Changed G5 interrupt controller probe to be more general. This adds support for the dual-core G5 Power Macs.
- 2006-08-21 zs(4) now works, by the same hack that enabled ofb(4). Thinking about generalizing this fix across all devices.
- 2006-08-21 All student projects due by 08.00 Pacific Standard Time.
- 2006-09-05 All mentor and student evaluations due by 08.00 Pacific Standard Time.
:: Deliverables ::
Mandatory (must-have) components:
- Boot a PowerMac G5 (June 2004 model) using the GENERIC kernel in full multiuser mode under the G5's 32-bit compatibility environment.
- Boot and run from the onboard K2 SATA controller.
- Improve Open Firmware support, starting with allowing use of the framebuffer during boot.
- Expand compatibility to as many G5 systems as we are able to test.
- Modernize the macppc timecounter code.
- Ensure X11 works.
- Add G5-specific performance optimizations where applicable.
- Polish up last year's HFS+ project to allow booting the machine from a Mac-formatted volume and facilitate easy data sharing between NetBSD and OS X.
Optional (would-be-nice) components:
- Full 64-bit architecture.
- SMP support.
- Interface with the environmental sensors found on some machines.
:: Documentation ::
- Interim instructions for adding Power Mac G5 support to NetBSD.
- More forthcoming...
:: Technical Details ::
:: References ::
- McKusick, et. al. The Design and Implementation of the 4.4 BSD Operating System. 1996, Addison-Wesley Professional, ISBN 0201549794.
- Koerner, et. al. PowerPC: An Inside View. 1996, Prentice Hall, ISBN 0132557533.
- Rodriguez, et. al. Linux Kernel Primer. 2005, Prentice Hall, ISBN 0131181637.
- IBM's PowerPC 970 documentation
- NetBSD device driver writing guide
- Open Firmware technotes
- fxr.watson.org, a cross-referenced kernel source viewer