Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

An embedded view of the Mac Mini, Part 1: Apple's new PowerPC BSP

It's small, it wants to take over the computing world, and it fits easily into most overhead storage bins

Peter Seebach has been using Macs since the Macintosh SE, and thinks this is the cutest one ever. He denies that his Mac Mini was ever lost in the couch.

Summary:  The Mac Mini isn't just competition for Shuttle computers and mini-tower PCs. It's also competition for the much smaller embedded development boards that many users are building custom applications around. Peter Seebach takes a look at the Mac Mini as an embedded development platform.

View more content in this series

Date:  15 Mar 2005
Level:  Introductory

Activity:  13165 views
Comments:  

A lot of early coverage of the Mac Mini compares it to desktop PCs, or even micro-ATX cases and other small PCs. What it looks like, though, is a high-end embedded development board. Comparing it to other embedded systems, you'll find that it's not much bigger, and it's smaller than some. It has a broader array of connectors, a faster processor, support for a very large amount of memory, and comes with self-hosted development tools. In short, if you look at it as an embedded development platform, it's a competitive one.

No matter how many times they call it the Mac Mini, I will always think of it as the minimac. I have this mental image of Steve Jobs, in homage to a famous movie villain, standing up on the stage at MacWorld when the new machine was announced, and saying "Breathtaking. I shall call it... Mini-mac. I will sell one hundred billion of them." I think this is why so many people call it the minimac. I'll just call it the Mini, but you may rest assured I'm thinking "minimac."

Specifications

The Mini has a G4 processor, one of the later models sometimes referred to as a G4+; the most visible differences are the performance of AltiVec and the size of the L2 cache. It has a single 2.5 inch IDE hard drive and a DVD/CD-RW drive (or, if you paid US$100 extra, a DVD burning "SuperDrive"). It uses PC2700 memory, although many people report that the memory in their Mini was actually PC3200 when they got it (see Resources). It has only a single DIMM slot, supporting up to 1GB of memory.

The machine is 2 inches tall, which makes it just a notch larger than a 1U rack space; it's hard not to suspect that this is intentional. On the other hand, you could stack them three high and three across in 4U of rack space, and have a little space left over. While they probably aren't serious competition for Xserve, it's a tempting thought (it would be more tempting with support for error-correcting memory). The size really is impressive. I haven't been able to find a keyboard that doesn't look bulky and awkward next to the Mini, although the Happy Hacker (see Resources) is at least close.

The external power brick is fairly large. It's rated at 85W, and quite a bit bigger than the tiny little bricks used for PowerBook and iBook power supplies. The power connector itself is a brand new design, and one that isn't entirely obvious; it claims to use straight up 18.5V DC power, but the connector has a number of pins. I'm not sure what they're for. Curiously, it's symmetrical; you can plug it in either of two ways, both of which work.

Thanks to the external power supply, the Mini itself is cool and quiet except under heavy load. The noise of the DVD drive itself swamps the very quiet fan. Some people report the fan getting loud under heavy load, but mere active usage won't do it. Leaving it in Open Firmware for a while, and setting it on top of a fairly warm external drive, did the trick. It's about the same volume as a typical laptop, and is quieter, in fact, than most x86 laptops. Splitting the heat generation of the power supply into an external (fanless) brick probably made a big difference here. This might be enough to make some musicians prefer a Mini, even with external audio hardware, to a louder machine.

Ports, connections, and looking under the hood

One way in which the Mini is not like most embedded development boards is that it's not exactly designed to be taken apart.

When you first read online instructions speaking of using a putty knife to open the machine, you might think it's a joke. It's not. Not only can you open the case with a putty knife, it's hard to imagine another tool doing the job as well. Rather than using screws, the Mini is snapped together: a bank of 15 plastic hooks around the sides and front of the case snap onto a groove in the aluminum shell. A putty knife (ideally with a beveled edge) can pry it open tolerably well. (Out of a combination of stubbornness and curiosity, I managed to pry one side open using six old PCI slot covers, lined up with the hooks... But if I ever have to open the machine again, I shall buy a pair of good putty knives.)

There are lots of articles on the Web about opening the Mini (see Resources). The main thing you need to know is that, if you open it and break it, you have voided your warranty. (If you don't break it, Apple says, you keep your warranty.) Most users would be better off taking the machine to an authorized Apple service center, who should be happy to, for instance, install new memory. Because the snaps are fairly hard to get at, and potentially breakable, opening the machine is not something to be undertaken lightly.

The good news is, there's not much reason to take the machine apart, even if you're doing embedded development on it. The primary reason for this is that the expansion option (singular) is to upgrade the memory. Exchanging the hard drive, or installing Bluetooth or Airport Extreme hardware, would be foolhardy -- leave it to someone trained in the process. Once you've got the machine set up, there's simply no reason to open it. There are no parts you'd want to replace or mess with, no DIP switches to set.

The external ports are simple: power, ethernet, modem, DVI, USB (x2), FireWire, and audio out. The Mini doesn't have all that many connection options, but conveniently, both USB and FireWire allow the use of hubs. The Mini comes with a VGA adapter for the DVI port. Perhaps more interestingly, there's also a video (composite and S-Video) adapter available for it. You can also have Airport Extreme (802.11g, at up to 54Mbps) and Bluetooth hardware installed, either when you get the machine, or later by an Apple service center.

The Mini offers an odd cross between the feature set of a laptop and of a desktop. Because I'm crazy, I took my Mini to a coffee shop. It fits quite nicely in a laptop bag along with my (much larger) regular laptop. In fact, I'm typing this article using my laptop as a display for the Mini, through the laptop's S-video input jack.

Users familiar with more traditional development platforms will be frustrated by the lack of serial ports or debugging interfaces. On the other hand, the software bundle is pretty good.

Software bundle and cost comparison

The development tools are not installed by default. They're found on the first install DVD, in the folder titled "Xcode Tools." Apple's Xcode is a pretty reasonable development environment. Developers used to other systems will find Apple's development kit costs very reasonable: free, whether with the machine, or with any version of the operating system. Technical support costs extra, but access to mailing lists is free, and will address the needs of most users. And, of course, Apple does sell developer-level technical support.

The development kit is fairly complete, with support for AppleScript, C, C++, Objective-C, Java™, Perl, Python, and Ruby programming out of the box. OS X provides a rich development environment for building applications quickly. A later installment of this series will look at how the variety of high-level application support can make development easy.

Most people think of the Mac as a development platform for applications to be sold on the Mac, but if you're looking to do a kiosk system or something similar, especially a one-off project, it's a good platform. The low price of the Mini makes it a lot more practical to consider using the Mac as a target platform for some applications. If you're going to be building a large number of systems, custom hardware might start getting cheaper, but the effort involved in adding many of the extra features (onboard video and hard drive, for instance) to a lot of embedded boards might not be worth it, and would drive their price up anyway. If you're building a smaller number of systems, the startup costs are really low. Furthermore, development costs are substantially reduced by the fairly mature and full-featured platform.

But can it pass the Zork test?

The Zork test was easy, although compiling a z-machine interpreter produced a very interesting warning message, warning of multiple definitions of symbol _init_process.

Nonetheless, a simple make built a working interpreter, with no need to edit any files or install anything beyond the default development tools.

For more on Xork and the Zork test, see the previous developerWorks article, PowerPC development from the bargain basement: The Zork test.

If you don't want to use Apple's tools, some third party tools are available. Java developers can use Eclipse or Netbeans, both of which are supported on the Mac. Metrowerks CodeWarrior remains a popular choice for working in C-like languages or in Java. Old-school UNIX® developers will be glad to note that, although you must install Xcode to install the Apple compilers, you can use them from the command line. The Apple and Metrowerks development tools support remote debugging at the application level -- but not at the hardware level: there is no JTAG port, and you can't just hook something up and trace every instruction as it happens. Since you're probably not doing hardware development on the machine, this isn't as much of a problem as it might be on a more traditional embedded platform.

Another way in which the Mini is different from traditional embedded boards is that it comes with Mac OS X. Apple's OS runs only on Apple hardware. Mac OS X will not even try to install on non-Apple PowerPC® systems. This may come as a shock to developers more familiar with embedded operating systems designed to run on a given processor, no matter who built the board.

Source for large chunks of the operating system is available through Apple's Darwin project. Releases of Darwin corresponding to a given version of Mac OS X are distributed in a reasonably timely fashion. For instance, Mac OS X 10.3.7 corresponds to Darwin 7.7.0, which was released shortly after the 10.3.7 update became available through Apple Software Update. Apple provides a great deal of support for driver development, for people who need to add support for a given USB or FireWire device. (The Mini doesn't have any PCI expansion capabilities.) Darwin, however, doesn't get some of the drivers that are available in the closed-source Mac OS X. Of particular interest is the possibility of building a Darwin kernel and installing it on an otherwise normal Mac OS X box.

For even greater source code access -- complete source, no omissions -- you can also look into Linux™ and BSD variants for PowerPC (see Resources). A future installment will discuss these options in more detail.


Not just a desktop

The Mac is famous for being a machine which just boots to a GUI on a machine with display and input devices connected. This could be problematic for some embedded applications; for others, it's probably tolerable. There are a number of things you can do to adapt the Mac to your needs. You can keep it from booting directly to the GUI, you can run it headless, and you can get console access over the network. These things apply to all Macs, not just the Mini; they're just particularly interesting to people thinking about embedded development.

Controlling the boot process

The default behavior on the Mac is to boot to whatever bootable device has been selected in the system preferences, or to the first bootable device it finds. This can be problematic on some occasions. For instance, you could potentially end up with it booting to a system which panics during boot. There are a number of ways to control what the Mac does during boot.

There are a number of keys or key combinations you can hold down during boot to control the boot process. If the C key is held down, the Mac will try to boot from CD. If T is held down, it will put itself into a special mode where it pretends to be just a FireWire disk bay (this can be useful for disaster recovery). Some preferences-related problems can be corrected by holding down command-option-P-R during boot. The Mac will reboot and chime. Some people claim that extra stuff happens if you do this three times in a row, but there's a lot of superstition involved in "resetting the PRAM;" I have never had to do it on a modern machine. Most interestingly, if you hold down command-option-O-F, you get into the system's Open Firmware console.

Open Firmware

Many people assume that, since the Mac doesn't display a prompt to enter a PC-style BIOS, it's not configurable. In fact, it's quite the opposite: the Mac's boot firmware is years more advanced than PC boot firmware. It has a command prompt which is a full-featured Forth interpreter. Open Firmware needs some kind of console. On older Macs, you could use a serial port, but the Mini doesn't have serial ports, so Open Firmware connects to the keyboard and display by default. The display has to be some kind of VGA display. The video output won't work properly until the system's fully booted, because the boot firmware doesn't know about video refresh rates. If you went ahead and got into Open Firmware without knowing this, just type mac-boot to cause it to boot up. Open Firmware is also useful for ejecting stuck CDs; the Mini has no eject button. The trick is to get into Open Firmware and type eject cd.

In the long run, you might want a way not to use a display. Displays chew up power, and if you're using the machine in an embedded project, you may not have any actual use for one. You're in luck: Open Firmware can be configured to run over the network! All recent Macs, including the Mini, support this. Apple's Tech Note 2004 (see Resources) discusses the procedure for setting this up. This does require an ethernet connection: you can't use the wireless network to do it.

A few other likely things to do at the Open Firmware console are disabling auto-booting (setenv auto-boot? false), or setting the machine to verbose boot mode (setenv boot-args -v). Verbose boot mode will be familiar to experienced UNIX users, who have probably been wondering where the familiar and comforting string of console messages have been going all this time.

More on boot options

Verbose booting is most useful if you're trying to debug driver problems that occur early in the boot. You can also tell the machine to go into verbose boot mode by holding down command-V. As with Open Firmware, it won't work if you're using a composite or S-video adapter; the refresh rate will probably be incompatible until the machine is almost finished booting.

Another way to control boot options is by setting the boot-args nvram variable from the command line within Mac OS X. The command to do this is nvram. For instance, you could use nvram boot-args="-v" to force verbose booting. Other options are available too. For instance, you could set boot-args to maxmem=256 to test whether your application will run on a machine with less memory than your development system.

If you're going to be doing much playing around with boot settings, do yourself a favor, and set the auto-boot? variable to false. This will cause the machine to drop into Open Firmware on power-up instead of trying to boot automatically. Otherwise, a perfectly reasonable mistake, such as setting the system to 255 megabytes of memory, could leave your machine unwilling to boot. Note also that getting into Open Firmware can sometimes be a nuisance, even at the best of times. This is often made worse on a cold boot, because the system may not recognize the keyboard quickly enough. Thus, it's sometimes hard to get into Open Firmware except by rebooting again after having booted fully into Mac OS X. See Resources for lots more documentation on Open Firmware and booting.

Remote console

Finally, there's always the option of a real remote console. The best option for this is VNC (Virtual Network Console), a freely available virtual console protocol, program, and everything else. There's a Mac OS X server available for VNC. So... set your machine to start the server automatically on boot, then go ahead and run headless, and connect over the network. Just don't expect to play any video games -- VNC is perfectly reasonable for typing commands, and usable for Web-browsing, but it's too slow for video.

VNC clients are available for Mac, Windows®, and UNIX systems, including Linux and the various BSDs. This won't let you get at the system before it boots, which is why it's nice to be able to configure Open Firmware for network access.


Coming up next

The next installment of this series looks closer at how Apple's development tools stack up to the actual work of developing a prototype embedded application. Users used to plotting out memory maps in detail and writing their own filesystem code will be a little shocked.


Resources

About the author

Peter Seebach

Peter Seebach has been using Macs since the Macintosh SE, and thinks this is the cutest one ever. He denies that his Mac Mini was ever lost in the couch.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Multicore acceleration
ArticleID=56327
ArticleTitle=An embedded view of the Mac Mini, Part 1: Apple's new PowerPC BSP
publish-date=03152005
author1-email=crankyuser@seebs.plethora.net
author1-email-cc=htc@us.ibm.com

IBM SmartCloud trial. No charge.

IBM PureSystems on a kaleideoscope background

Unleash the power of hybrid cloud computing today!


Special offers