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.
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.
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.
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.
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.
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.
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.
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
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.
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
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 (
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
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
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
instance, you could use
nvram boot-args="-v" to
force verbose booting. Other options are available too. For instance, you
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
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.
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.
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.
Check out the other articles in this series.
Previous developerWorks coverage of Open
Firmware gives an overview and more resources (developerWorks, October 2004).
- A lot of people took the Mini apart to take
what's inside the box.
- Steve Jobs cuddles
the new Mac Mini. We all want to.
I shall call it... Mini Mac.
- Some people don't think the Mac Mini is fast
It's sort of interesting browsing bloggers talking about the Mini.
- Check out Mini accessories.
Apple has a number of Technical Notes discussing Open Firmware,
Note TN2004, which covers setting it up for network access.
- Check out another discussion on Open Firmware booting.
The nice folks at RealVNC will
happily give you a network console, for free.
- There are a lot of embedded toolkits for PowerPC; for instance, Wind
River's VxWorks runs on a
large number of BSPs.
You probably thought I was kidding about opening
the Mini with a putty knife.
If you don't want a keyboard three times the size of your computer,
the Happy Hacking
Keyboard is one of the smallest keyboards you can get with
- Users are discussing the PC3200
RAM found in the Mac Mini.
- You'd rather have your kiosk be based on a Celeron? Can't wait
until the next installment to find out how to build it? The Anyplace
Kiosk might be for you.
Mac mini Maxi
describes attaching extra storage to a Mini to make it a server (AppleTalk, February 2005).
Apple's page about AppleScript
has many resources for would-be AppleScript programmers.
- Have experience you'd be willing to share with Power Architecture zone
readers? Article submissions on all aspects of Power Architecture technology from authors inside and outside
IBM are welcomed. Check out the Power Architecture author
FAQ to learn more.
- Have a question or comment on this story, or
on Power Architecture technology in general?
Post it in the Power Architecture technical forum
or send in a letter to the editors.
- The Power Architecture Community Newsletter includes full-length articles as well as recent news about members of the Power Architecture community and upcoming events of interest.
about the Power Architecture Community Newsletter and how to contribute to it. Subscription is free.
- All things Power are chronicled in the developerWorks Power
Architecture editors' blog, which is just one of many developerWorks
- Find more articles and resources on Power Architecture
technology and all things
related in the developerWorks Power
Architecture technology content area.
- Download a IBM PowerPC 405 Evaluation Kit to demo a SoC in a simulated
environment, or just to explore the fully licensed version of
Power Architecture technology. This and other fine Power Architecture-related downloads are listed in
the developerWorks Power Architecture technology content area's downloads section.