Serial port woes [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Wed 2007-10-17 11:58
Serial port woes

judicator, my home firewall/router/VPN machine, is a Soekris net4501: a compact but basically PC-compatible computer with a serial port but no graphics card, on which I run Debian. So, obviously, I use the serial port as its main console; hence, also obviously, in order to do any serious maintenance on it I need a machine sitting next to it which can act as a terminal.

Originally this duty was fulfilled by my main Linux box. Unfortunately, a lightning strike in July 2006 fried the serial port on that machine, so I plugged judicator's console into my Windows box instead (which was what really motivated me to finally get round to building serial comms support into PuTTY). But when I moved house last week, things changed again: my Windows box is now on a different floor from judicator, and the only available machine to use as a terminal is my Mac. Which has no serial port.

Well, that can't be too hard, surely? Macs are bristling with USB ports, and a USB-to-serial adapter doesn't sound like a difficult piece of technology. And sure enough, I turned one up in a very small amount of Google searching, and two days later a postman got me out of the shower to hand it over. No more problem. Right?

Wrong.

To begin with, the Mac doesn't natively recognise this USB device. No points to Apple. Belkin helpfully provide drivers for it under MacOS 8 and 9, but – incomprehensibly – not under OS X; no points to Belkin either. So I spent a chunk of yesterday evening slaving over Google rather more extensively, trying to find out how other people solved this problem. I turned up two free drivers on Sourceforge; one did nothing at all no matter what I did, but I eventually managed to get the other one to work after some time spent fixing compile failures, manually compensating for deficiencies in its build script, and coping with its total lack of documentation. Not very many points to its authors, although it was free, and it did at least mostly work and saved me the considerable effort of learning about OS X kernel extensions and USB serial controllers myself.

Anyway. After a couple of hours I had it working, and can now successfully talk to the console on judicator; even sending serial breaks works, so I can be completely paranoid and use the SAK feature I compiled into judicator's kernel.

Except that that doesn't work: instead of printing a ‘SAK activated’ message and then killing all the processes attached to the console, it prints the message and then does nothing. This is particularly annoying since I fixed a Linux kernel bug last summer which had this effect, and my fix has been in the mainstream kernels since 2.6.20. Have they stupidly backed it out? No, they haven't: it's still there, but apparently some other bug in the code has reintroduced the same misbehaviour. No points to the kernel developers.

I really would have thought that this ought to have been a far simpler process than it has so far been. And I'm not even at the end of it yet: until I properly diagnose the strange kernel bug, I won't know whether there are more lurking horrors beyond that…

LinkReply
[personal profile] emperorWed 2007-10-17 11:20
How greatly irksome. Have you sent your fixes in the driver to the authors?
Link Reply to this | Thread
[personal profile] simontWed 2007-10-17 12:12
Not yet.
Link Reply to this | Parent
[identity profile] keirf.livejournal.comWed 2007-10-17 14:07
I work a lot with serial ports. For such an old technology the code out there is seriously buggy.
Link Reply to this | Thread
[identity profile] keirf.livejournal.comWed 2007-10-17 14:07
BTW, I appreciated your work on serial support for Putty.
Link Reply to this | Parent
[identity profile] antifuchs.livejournal.comWed 2007-10-17 15:32
Belkin do provide OS X drivers for their converters
It's just not easy to find them, especially universal builds that work on intel macs. What's frustrating is that I would have liked to provide a link to the download site, but I can't find it anymore. I do have the driver installed on this machine, though (-:

As a side note to suggest they're intensely cynical bastards: Together with my adapter, they shipped mac drivers on a mini-CD. Which is great, except that there were no Macs with tray CD drives sold in the last 3 or 4 years.
Link Reply to this | Thread
[identity profile] antifuchs.livejournal.comTue 2007-11-27 20:10
Prolific provide OS X drivers for their converters
I was mistaken, the manufacturer I'd remembered was Prolific, not Belkin. The drivers available at http://www.prolific.com.tw/eng/downloads.asp?ID=31 were the ones I was thinking about.

Sorry for the confusion; the point about Prolific being cynical bastards still stands, though (-:
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]