Magic Smoke
   


Once the magic smoke comes out, things don't work any more.

John Kasunich
jmkasunich@fastmail.fm
GPG Key

Postings:

Index (titles only):

If you are into RSS, you can Subscribe to a syndicated feed.


Links


Friends


I Support

Individual Rights

Electronic Frontier Foundation


Powered by



       

Fri, 22 Dec 2006

A PC for the Shoptask

Yesterday evening I started to build the PC for the Shoptask machine controller. I dug around in my boxes of junk, (I mean my boxes of usefull computer stuff), and found an 800MHz Pentium III in an Intel motherboard. The board has two slots for Rambus memory, which is hard to get these days. But I have two 128M sticks, so that doesn't matter. More digging came up with a 20G hard drive, power supply, 8MB Matrox Millennium graphics card, and a 3-Com NIC. I just love Matrox cards - by today's standards they're old and boring, but they just plain work.

Since the first order of business is to make sure everything works, and then to make sure it had good realtime performance, I just laid it all out on the benchtop. It powered up fine. I got to the BIOS screen and started setting things up, then I checked the CPU heatsink and decided that some more digging was in order. Found a fan, now the CPU is happier.

Scrounged a CD-ROM drive from another box of stuff, and burnt a Dapper CD. Dapper doesn't set any speed records during the install, but after about an hour or so I had a working Ubuntu 6.06 base install. Unfortunately it was working at 640x480 graphics resolution. Some googling found the answer to that, a few minor tweaks to xorg.conf, and I had a decent screen size. Next Dapper wanted to do updates. Its been some months since the iso was released and about 200 packages have been improved since then. The updates took about a half-hour, maybe more, but went smoothly and without any help from me. Then I downloaded the EMC2 Dapper install script, and did that install, which also went smoothly. Next (it was after midnight by now) I tried the realtime latency test (item 2 on this page), and was disappointed. Started out OK, but after not very long, I got 300uS of latency.

I didn't want to give up after all that, so I started googling, as well as trying things like BIOS settings to see if anything would make a difference. After a while I noticed that the large latencies came only once in a while, but seemed periodic. So I looked closer and found that once every 64 seconds I would get a nasty one, and the rest of the time it was fine. I mentioned that on IRC, and resumed googling for answers. Alex Joni found out that NTP polls every 64 seconds by default, so I checked that NTP wasn't loaded (it wasn't) and even unplugged the network cable, no difference. Then Alex found out that the SMI (System Management Interrupt), an Intel chipset "feature" also happens every 64 seconds. That was the clue I needed to find this page, which describes the problem and a workaround.

I wasn't the one who built the RT kernel in the first place, and I had no clue about how to actually implement the workaround (especially since it was now about 3am and I was fading). But Alex is the one who built it, and he walked me through the steps to install the rtai source, modify one source file, make, and install the new module. Lo and behold, it ran with latency of about 18uS worst case, with the vast majority of measurements less than 12uS. Thanks Alex!

(posted: 22 Dec 2006 17:26) (permalink)