Mac OS X
Being primarily a Linux based project, the host platform of choice is Linux. However, it is entirely possible to work with Openmoko and Neo handsets using MacOS X, as you'll soon see.
There are actually two ways of working with Openmoko and MacOS X. One is simply to run ubuntustudio on parallels (or your favourite debian in your favourite virtual machine), in which case you would then follow the instructions for Linux, and Ubuntu in particular.
On the other hand, if you wish to use MacOS X directly, please continue:
Flashing to your device
To operate the Phase 1 devices (Neo 1973), you need to flash a root file system first.
Graphical Flashing with Openmoko Flasher
Here are detailed instructions:
- download Version 1.4 or later of Openmoko Flasher from http://www.dsitri.de/wiki.php?page=Openmoko%20Flasher
- select the repository
- press the Refresh button (which loads the list of packages on the server)
- select and load the rootfs (takes some minutes for approx. 40 MByte)
- Now, on your Openmoko, hold the AUX button while pressing the Power button for 5 seconds
- the BOOT menu should appear
- connect the USB cable
- Press the Flash button
- the BOOT menu screen on the OM should show an indication that it has been switched to DFU mode
- (if it fails, unplug the Openmoko shortly and replug and try again (experience shows that it is needed up to three times)
- if it successfully flashed, you should be able to boot the Openmoko and continue configuring AJZaurusUSB
A Universal Binary version of dfu-utils tool (and libusb) is included in the Openmoko Flasher application bundle. You can access it as Openmoko Flasher.app/Contents/MacOS/dfu-util.
To flash from Terminal (which is sometimes required), see the directions below or in Flashing the Neo
To flash the kernel:
Openmoko Flasher.app/Contents/MacOS/dfu-util -a kernel -R -D uImage
To flash the root filesystem:
Openmoko Flasher.app/Contents/MacOS/dfu-util -a rootfs -R -D rootfs_filename.jffs2
To flash the boot loader to NAND
Openmoko Flasher.app/Contents/MacOS/dfu-util -a u-boot -R -D uboot.bin
When flashing succeeds (in any of the above cases) the following should be shown:
status(0) = No error condition is present Done!
Alternatively, you can compile dfu-util manually as described at http://wiki.openmoko.org/wiki/User:SNMoore but you need libusb (e.g. through MacPorts).
Connecting a Mac and an Openmoko device
The USB driver creates cu and tty character devices, for example
$ ls -la /dev/tty.usb* crw-rw-rw- 1 root wheel 10, 18 Aug 23 14:10 /dev/tty.usbmodem00000001 $ ls -la /dev/cu.usb* crw-rw-rw- 1 root wheel 10, 19 Aug 23 14:10 /dev/cu.usbmodem00000001
USB Serial with screen
screen program is included with Mac OS X, and can be used from the terminal command line to connect to the serial console. To do this, simply get to a shell prompt in the terminal and invoke
screen as follows:
% screen /dev/tty.usbmodem00000001
You should find yourself at the U-boot serial console prompt. To get out, type
control+a followed by
USB Serial with minicom
The minicom program from the MacPorts collection can be used to access the USB serial port /dev/cu.usbmodem00000001 (numbering may vary.)
First install the program (assuming you already have MacPorts installed):
sudo port install minicom
Then launch it in configuration mode (the -s flag):
sudo minicom -s
Under "Serial Port Setup", set the Device to "/dev/cu.usbmodem00000001" and set Bps to "115200 8N1". Under "Modem and Dialing", enter empty strings for "Init string", "Reset string", and "Hang-up string". Save the setup as default ("dfl") then Exit.
You should now be able to access the bootloader console. You should exit from Minicom before disconnecting the smartphone, or else you will get an error about unplugging a USB device while it is in use.
USB Serial with Terminal
The built in Mac Terminal application Terminal.app can be used to access the USB serial port /dev/tty.usbmodem00000001 (numbering may vary.)
An easy way to do this is to configure the terminal with Script Editor, as described in the short article, Use 'screen' as a serial terminal emulator(macosxhints.com). Then,
- Press and hold AUX Button and then press and hold POWER for 5 seconds
- Press AUX Button to select Set console to USB in the U-Boot menu, and POWER to execute it
- Start the serial terminal application. You should see a U-Boot command line prompt, such as
In: usbtty Out: usbtty Err: usbtty DEVICE_CONFIGURED: 1 Enabling automatic fast charge GTA01Bv4 #
When you boot Linux on the smartphone, or if the smartphone powers down, Mac OS X will show a USB Device Unplug Notice, "The USB device has been unplugged while an application was still active. This can result in loss of data." This error is probably harmless.
There are two drivers you can use to talk to the RNDIS/Ethernet Gadget that the Neo1973 presents to its host system. The main difference between them is stability, but both have their own problems. Leopard needs further testing (Apple revised the driver and the Network System Settings).
Apple CDC Ethernet driver 10.4.10
MacOS X 10.4.10 and later includes a driver for RNDIS/Ethernet Gadget devices. Launch System Preferences -> Network and you should see "new interface detected enXX".
Issue: Each time you reboot the Neo, the interface will get a different Ethernet address. This in turn makes Mac OS X create a new configuration record. After a while you'll end up with a load of unusable enXX devices - if you don't periodically clean them out. Open System Preferences and go to Network -> Show(Network Port Configurations) -> Select an enXX -> Delete.
Note: this is not a problem to blame MacOSX for because it tries to make network configuration simpler based on the assumption of stable Ethernet addresses.
Apple CDC Ethernet driver 10.5.x
Issue:10.5 (Leopard) doesn't show a new ethernet interface for a Neo1973 running 2007.11. You'll only get the serial port, which is detected as a modem. The Ethernet device will show up in ifconfig though.
It turns out that the AppleUSBCDC driver prefers to use the CDC-ACM interface of USB networking devices instead of CDC-ECM with the exception of a broadcom network card. You can download a patched AppleUSBCDC driver that will recognize the usb id/vendor pair of g_ether and force it to use CDC-ECM. You can obtain the OS X 10.5.X patched driver from: http://bugcommunity.com/downloads/usbcdc-g_ether.zip. Source code: http://bugcommunity.com/downloads/files/AppleUSBCDCDriver-g_ether.326.4.1.zip
The issue of multiple network interfaces showing up whenever the device is rebooted/power-cycled is due to the g_ether driver randomly setting the host and device mac addresses. This problem is remedied by passing the same host and device mac addresses during the modprobe of g_ether.
modprobe g_ether host_addr=46:0d:9e:67:69:eb dev_addr=46:0d:9e:67:69:ec
You can also use the open source driver from . It was developed for handheld devices like iPAQ, Sharp Zaurus and Motorola A760, but works for Openmoko as well. Download and install according to the manual found inside the package. The code is GPL'd (source available) and runs on both Intel and PPC Macs with 10.3, 10.4 and 10.5.
After rebooting or loading the kernel extension by hand, you should have a new Ethernet interface in your System Preferences/Network.
Note: This driver does not have the same problem as the Apple driver does, where it constantly adds to the list of interfaces each time you reboot the neo, because the driver provides a constant ethernet address independently what the Neo says. Only flashing a new kernel might force you to update.
Issue: This driver is sometimes a bit flaky, and a reboot of the Mac seems to bring it back. It is especially critical about hot unplugging the OM and sleep modes of MacBooks. This may even result in a Kernel Panic.
Use this configuration on the new interface:
IP-V4: manual IP-Addr: 192.168.0.200 (you can use anything in 192.168.0.* but OM is configured by default to use 192.168.0.200 as the external gateway) Subnet: 255.255.255.0 (should be the default - see tip below if have issue with these settings) Router: 192.168.0.202 (not actually needed, OS X can figure this out for itself, unless you have other conflicting configurations)
Tip: If your Internet connection is also in the range 192.168.0.x then instead you might want/need to use:
Testing Your Connection
You should be able to connect to your Neo! Try using Terminal (Applications->Utilities->Terminal) to ping the Neo at 192.168.0.202 and the roundtrip time should be between 1 and 2 ms.
Then log into your Neo using ssh:
The default password is blank.
You can also scp files back and forth or share displays with X11. Additional software and configuration could allow telnet, SMB, or many other possibilities using the TCP/IP network over your USB connection.
Try pinging your Mac PC from the Neo
Try pinging the outside world (a Google IP address)
If that works then your Mac is routing the neo globally--if not see Sharing Internet Connection with Mac.
Lastly, verify that DNS is correctly configured between the Neo & Network:
If that doesn't work then see Configuring Default Neo DNS to try and resolve the issue.
Congordulations Elizagreth!!! The Neo is networked together with the Mac and sharing the Mac's interweb connection.
This approach is based on:
The reversed direction (OM as the Access Point and the Mac as the client) is described shortly in http://wiki.openmoko.org/wiki/Manually_using_Bluetooth#PPP_Networking
Making the Mac a PPP over Bluetooth Access Point
In the Bluetooth System Preferences (10.4.11)
- go to the Sharing pane
- add a new service "BluetoothAccessPoint" of type RS-232
- Enable that it is shown in the network preferences pane
In the Network System Preferences
- activate the new network configuration (BluetoothAccessPoint)
- go tot the Modem tab and change the modem to "Null Modem 115200"
In a Terminal, enter the following:
$ sudo /usr/sbin/pppd /dev/tty.BluetoothAccessPoint 115200 noauth local passive proxyarp asyncmap 0 silent persist :172.16.140.14
Here you see the 172.16.140.14 address, which makes it possible not to use natd, since it's in the same network as the Mac is. So the firewall knows where to sent it to -- no routing problems etc. Pick any free address in your private range. For instance, if you are using the following ... firewall: 192.168.1.1, Mac: 192.168.1.2, you can enter 192.168.1.3, assuming it's not used elsewhere on your network.
If you want to be sure you did it right, open the system.log file on the Mac (tail -f /var/log/system.log), and you should see something like this:
Jun 25 10:33:57 hostname pppd: pppd 2.4.2 (Apple version 229) started by username, uid 0 Jun 25 10:33:57 hostname pppd: Connect: ppp0 <--> /dev/tty.BluetoothAccessPoint
In Terminal, write
sudo sysctl -w net.inet.ip.forwarding=1
which should give the following feedback:
net.inet.ip.forwarding: 0 -> 1
In Terminal, write
sudo ifconfig ppp0 up.
Connecting the Openmoko as a Client to the Mac
On the Openmoko do the following
- Power on bluetooth
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on
- Scan for the Mac
root@fic-gta01:~$ hcitool scan Scanning ... 00:0E:6D:C0:0l:6A Sho 00:20:E0:5A:FE:C8 MacBook
- start the PPP client
pppd 115000 192.168.1.202:192.168.1.200 local defaultroute pty 'rfcomm connect 0 00:16:CB:2F:A0:46 1'
To Be Done.
Neo1973 as a Bluetooth GPRS modem
To Be Done.
Enabling the Mac as an Internet Router
Here is described how to enable your Mac to serve as a Internet Router for your Openmoko device.
Note: you have to open all services you want to use from the Openmoko in the Mac Firewall.
In the Sharing System Preferences
- click the Internet tab
- Check all the ethernet (en) interfaces you want to enable Internet access for (i.e. the USB connection)
SSH into your Neo and create /etc/resolv.conf, specify your Internet router IP address as the name server. You can simply copy the /etc/resolv.conf from your Mac.
scp /etc/resolv.conf email@example.com:/etc/resolv.conf
Example: nameserver 192.168.1.200 # replace by your real nameserver address
Make sure your Neo routing table has entries so that all internet traffic is sent to your Mac (which will forward it to the outside world)
root@fic-gta01:~$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 usb0 default 192.168.0.200 0.0.0.0 UG 0 0 0 usb0
Don't forget to enable your USB interface for Internet Sharing!
Accessing data and services on your device
After making the USB connection work, start ssh:
ssh -l root 192.168.0.202
If you don't have installed the key, it will ask for a "yes" on the first connection. The root password is blank unless you change it.
MacBook-hns:~ hns$ ssh -l root 192.168.0.202 firstname.lastname@example.org's password: root@fic-gta01:~$ hostname fic-gta01 root@fic-gta01:~$
NOTE: the ssh daemon (dropbear 0.49) on the Openmoko appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.
To Be Done.
Launch Apple X11.
On the Neo:
This is not done yet. Possible solutions are SyncML or ZMacSync http://www.dsitri.de/wiki.php?page=ZMacSync
ZMacSync does not yet synchronize but allows more easy access to the Openmoko through Terminal/ssh.
Developing Openmoko software on a Mac
Using virtualization software and MokoMakefile/OpenEmbedded
You can use Parallels or VMWare to install your favourite Linux distribution and then develop just as on Linux.
There are some drawback since AFAIK dfu-util may not work correctly in such environments.
Don't bother with Parallels Desktop for Mac (<=3), the current USB support is terrible and USB storage keys don't even work so there was no way I would try dfu-util. USB keys work under VMWare Fusion for Mac though I have yet to try dfu-util in an VM under VMWare Fusion as there is Openmoko Flasher for Mac. -- Eric
Did somebody get dfu-util working inside VMWare Fusion? -- Anakron
There are some efforts to get through process of compiling OE and Openmoko under mac: Openmoko_under_QEMU_on_MacOSX
Tools for Developers
Some tools that run on MacOS X
[mkfs.jffs2] - make JFFS2 (root) file system (Universal Binary). Package includes sources and Xcode 2.4 project file to rebuild on MacOS X 10.4.11. NOT TESTED DEEPLY.
mkfs.jffs2 --pad=0x700000 -o rootfs.jffs2 -e 0x4000 -n -d/tmp/jffsroot/
[gcc 2.95.3] - OABI cross compiler toolchain (C, C++, Obj-C) with Linux headers (PPC and Intel Macs)
If someone has a newer one that works, please provide as an installable OSX Package.
Will the ones from MacPorts work? [] I'm still trying to get QEMU to work and haven't had a chance to test it yet.
Search Software Repositories
[Keyword Openmoko] at VersionTracker
[Mac Issues Forum] at Open Embedded Software Foundation (was Zaurus User Group)