Serial port woes (Reply) [entries|reading|network|archive]
simont

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

[personal profile] simont 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…

Link Read Comments
Reply:
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting