I’m not gonna lie. I began fantasizing about the iPhone back in January when it was announced at MacWorld. But I really had no practical need for the thing, given that I already had a Treo 650 that could do all the usual SmartPhone bits, and that my existing iPod nano had hung out in my car pretty much since I got it and served exclusively as a CD-changer replacement (with an increasingly stale copy of my iTunes library).
So I held out when the big launch came. I probably read more of the iPhone hype on Wired.com than the people who actually bought them. Being a UNIX geek, the greed welled up within me when I learned that people had been successful at installing an SSH server and standard set of command line utilities on the phone. And this wasn’t like reflashing your iPod to run Linux, thereby throwing out all of the excellent software that it came with, making the device less useful. Nope, the iPhone ran a full multitasking protected-memory Darwin kernel. Jobs hadn’t been overstating the fact that the phone ran OS X (which I half snorted at when I heard it last year).
Then came the price drop. I still held firm for another two weeks, but ultimately my resolve crumbled. I had to have it.
So I’m not going to give you a review, or a how-to. There are many sites that have done a much better job on those subjects. But I will say, having tried out some of the command line tools, they’re not quite as rock solid as you might dream. I suppose that shouldn’t come as a surprise since they’re entirely unauthorized ports written for a hardware/software platform that, while made up of some standard bits (an ARM processor and Darwin kernel) is wholly undocumented.
The one nagging problem with the iPhone (besides its inability to synchronize directly with my Oracle calendar at work) is that it doesn’t have a phone-as-modem mode. For all its networking prowess with built-in Wifi and (pokey but reasonably reliable) 2.5G EDGE network connection, it wouldn’t share its good fortune with my lowly laptop. Luckily, clever iPhoners had discovered long before I picked mine up how to compile srelay, an open source SOCKS proxy, for the device. Naturally it was the first thing I installed after getting the usual command line tools. I mean, what is a UNIX system without grep and vim?
I really didn’t know anything about SOCKS. Proxies in general have always seemed like a really awkward idea to me. If you’ve got the ability to do NAT and stateful packet inspection in a firewall, why break the abstraction on the client side? In fact, I’m not really sure what about the routing details inside of the iPhone’s network stack prevent somebody from installing a proper DHCP server and NATing router on it. But nonetheless, in this case I’ll take whatever I can get, ’cause I haven’t got a clue how to set up gcc to cross compile for Darwin on ARM, let alone write network subsystem code for it. So it turns out SOCKS can proxy just about any service if you give it enough loving. It seems it would be a lot more convenient if the SOCKS client were implemented at the OS level then. In OS X, it sort of is. There is an OS global SOCKS configuration, but it seems that it’s only an FYI for applications that can choose to implement SOCKS client features on their own. Basically, that means that Safari is about the only thing that pays attention to the setting. Of course I use Firefox, so I’m pretty much hosed. If I want to switch back and forth it’s not as simple as changing Networking locations, but rather changing my Firefox config and whatever else.
Also, ssh (or any other command line tool for that matter) isn’t down with SOCKS. But this is where tsocks comes in, or so I thought. But, it turns out that wrapping ssh in tsocks is a sure fire way to lock up my iPhone. I’m not sure if it’s a memory issue, or what. But it sure ain’t happy.
Of course it’s not strictly necessary since I can just ssh to the iPhone and then out from there to wherever I’ve got to go. Dropbear, the iPhone’s SSH server claims to even support X11 forwarding, though I’ve yet to get that to work. So, overall, the phone-as-modem support works in a pinch. And as an added benefit, if you just have to use the web, the phone’s built-in browser is really an amazing thing. It almost doesn’t suck to use.
arm darwin firefox hack iphone laptop phone as modem safari socks unix
Post a Comment