There's always time to play

Wednesday, October 12, 2011

Enabling higher resolutions on Matrox G200eW

Recently we bought 5 DELL PowerEdge T110 servers to deploy to customers. After installing Windows XP on the PERC S100 RAID (more on that in a future post) I had to look for a driver for the graphics card. Of course you can't easily find it at Matrox's site, so I went over to DELL support and downloaded the Windows Server 2003 Matrox driver. Server 2003 and XP both being NT5 this worked like a charm, as was to be expected. There is another issue however, by default the Matrox driver supports 4:3 resolutions up to 1280x1024, but we use widescreen monitors which can do 1920x1080, and we're relying on that.

Just a week ago I was fiddling with Matrox drivers for a G450, where I had the same issue with resolutions, where the latest driver did support the correct 16:9 resolutions. When I was comparing the drivers, I noticed there's a resolution reference directly in the driver inf file. For the G200eW, this listed just a few resolutions, but for the G450 there was a long list. Changing this value to what the G450 had listed was enough to get it working, so now our G200eW can do 1920x1080 without issues. Here's the changed value for future reference:
40,01,C8,00,40,01,F0,00,00,02,80,01,80,02,90,01,\ ; 320x 200, 320x 240, 512x 384, 640x 400
80,02,E0,01,20,03,58,02,50,03,E0,01,58,03,E0,01,\ ; 640x 480, 800x 600, 848x 480, 856x 480
60,03,E0,01,C0,03,60,09,00,04,00,02,00,04,00,03,\ ; 864x 480, 960x2400, 1024x 512, 1024x 768
00,04,00,05,00,04,00,06,30,04,58,02,80,04,60,03,\ ;1024x1280, 1024x1536, 1072x 600, 1152x 864
B0,04,40,06,00,05,D0,02,00,05,00,03,00,05,20,03,\ ;1200x1600, 1280x 720, 1280x 768, 1280x 800
00,05,C0,03,00,05,00,04,00,05,40,06,50,05,00,03,\ ;1280x 960, 1280x1024, 1280x1600, 1360x 768
58,05,00,03,60,05,00,03,78,05,1A,04,A0,05,84,03,\ ;1368x 768, 1376x 768, 1400x1050, 1440x 900
40,06,00,04,40,06,B0,04,40,06,00,05,90,06,1A,04,\ ;1600x1024, 1600x1200, 1600x1280, 1680x1050
00,07,40,05,08,07,A0,05,40,07,70,05,80,07,0A,04,\ ;1792x1344, 1800x1440, 1856x1392, 1920x1034
80,07,38,04,80,07,B0,04,80,07,A0,05,00,08,00,06 ;1920x1080, 1920x1200, 1920x1440, 2048x1536

Wednesday, July 27, 2011

DELL Vostro 3550 stacking issue

At work I often order a few laptops at the same time. Because of this it often occurs I install one of the laptops, then put another one on top to install that one. Now I had a Vostro 3550 on my desk and I put another one on top of it. When I turned it on the screen stayed black, or at least so it seemed. After a while I noticed there was a faint graphic showing, so my guess was the backlight was broken. I pushed the power button, pressed F2 to enter BIOS hoping that would help, then when I turned the laptop to the light to see if there was something on the screen it turned on. I put the laptop down again, it turned off. Lift the front up half a centimeter, screen turns on.

So I was thinking, must be a bad connection, right? Well I had another 3550 still in the box, so I removed the top 3550, put it aside, put the other one on there, turned it on, same issue! This was too much coincidence for me and I quickly noticed that the 3550 doesn't have any buttons to detect whether the lid is closed, so it uses magnets to do this. Well of course if you stack two laptops on top there's always a lid nearby, I didn't expect it to be this sensitive though...

Monday, May 30, 2011

Moving "Documents and Settings" to another partition in Windows XP

Because you can't depend on Windows, it's nice to have some kind of backup scheme for when things go wrong. One of those solutions is to store important data on a seperate drive. I've seen a lot of people doing this the wrong way. User folder in C:\Documents and Settings\[user] and a partition D: or E: which then contains folders like Documents, Downloads, Photos and Music.

A home directory is not just a home directory for nothing, so store your files in there. The solution is simple, with NTFS drivers you can have a volume mount point, which allows you to use a seperate NTFS filesystem as if it was just a folder in another NTFS filesystem. Of course this doesn't make it easy yet, so these are the steps that need to be taken to have it fully functional:
  1. Format the new partition as NTFS
  2. In Disk Management in Windows setup the new filesystem as volume mount point on C:\newdoc
  3. Boot to something that is capable of moving stuff around on your drive (Parted Magic will do)
  4. Copy the contents of Documents and Settings to the new filesystem
  5. Move Documents and Settings to olddoc
  6. Move newdoc to Documents and Settings
  7. Reboot into Windows

Depending on what you used to copy the contents of Documents and Settings you might have to reset some of the file attributes (or permissions even), because otherwise a lot of Desktop.ini files will pop up.

One last improvement that can be made is to fix the icon for the mount point. By default this will show as a disk icon, but because we abstracted this fact we might also want to show it as a folder. Just create C:\Documents and Settings\autorun.inf with the following contents:

This requires a reboot before visible, but after that will work great.

Because we make effective use of NTFS volume mount points all legacy applications that probe for C:\Documents and Settings instead of using the proper functions to find profile directories will work as ever before. Just keep in mind to follow these steps after a Windows reinstall, except for the file copy part!

Wednesday, May 11, 2011

Linksys E4200 as an access point

At work we bought two Linksys E4200's to extend our wireless network. We wanted to use them as access points / wireless gateways instead of their normal router configuration. Googling turns up a few half-documented solutions, which might even work in case you've got a small home network set up, but I still couldn't get it to work. So I took one of the routers home, and this is what I've come up with (tested at home only right now):
  1. Start the router
  2. Connect a cable between your computer and one of the E4200 LAN ports
  3. Turn on remote management on the E4200
  4. Verify that the E4200 doesn't have a local address that belongs in your network's subnet (change it otherwise)
  5. Connect a cable between the E4200 WAN port and your network
  6. Connect a cable between your computer and network
  7. Turn off the DHCP server on the E4200
  8. Connect a cable between your network and one of the E4200 LAN ports
  9. Connect a cable between the E4200 WAN port and one of the E4200 LAN ports

Now you can wirelessly connect to your network using the E4200 and you can still access the E4200 admin interface as well!

Of course this all won't be necessary when DD-WRT or other alternative firmware releases are available for the E4200, but right now this probably is the best solution.

Thursday, April 28, 2011

touchmoused: Logitech Touch Mouse server for Linux

Recently I was looking at a way to control the Mac Mini I have connected to my TV. I don't have a keyboard or mouse connected (only a gamepad), but I do have an iPod Touch. Soon I found Logitech Touch Mouse, a simple app providing a keyboard and mouse over the network. Of course Logitech isn't capable of delivering a Linux server for it's app, so I decided to write it myself.

After a quick Wireshark dump I started hacking away. Using the recently released Shairport as a reference I started hacking away on my first Perl program. This also being my first program where I had no documentation on protocol whatsoever, it took me a while to figure out I had to listen both on TCP and UDP. Then it also took me a while before I figured Perl doesn't write directly on a print statement unless autoflush is set on the file descriptor. I managed to find that one on a page detailing serial port communication with Perl.

When these hurdles were overcome I could really start interpreting events, sending them through to the Linux UInput facility. Today another big issue was fixed, mouse movement was broken until I added left mouse button support. So anyone trying to send mouse movements using uinput, be sure to enable left mouse button events!

Anyway, I've now come to a point where the Touch Mouse app can be effectively used as a trackpad replacement. Moving, clicking, (two-finger) scrolling, it all works. Also alphanumeric keys are working, Ctrl and Alt are working and some character keys are working. This also means I think I've come far enough to promote the app here on my blog, so anyone willing to try it out should move on to my github project page.

Wednesday, January 12, 2011

DHCP for PXE booting only

At work we use a Novell Netware 5 server (don't worry, it will be replaced) for, amongst others, DHCP. Not much of an issue, but I wanted to netboot clients so I could do easy operating system installations. When I wanted to add the appropriate options to the DHCP server, I noticed it wasn't possible. Some searching on the internet revealed some hacks, but nothing you'd easily try on a server in use.

So then what? I noticed before when I was trying to boot PXE clients and they were attached to the main network (instead of my private network) that they wouldn't get (accept?) DHCP leases, so there was my solution: add a DHCP server that gives leases to PXE clients only.

Although this may sound hard, it's actually pretty easy. PXE clients send along a so-called vendor class identifier containing the string PXEClient. Using the ISC DHCP server we can easily check for this string, and then hand out a lease to those clients only. One last thing to keep in mind: don't hand out leases in the same range as the authorative DHCP server.

Finally, here's a sample config (/etc/dhcp3/dhcpd.conf):
ddns-update-style none;
option domain-name "";
option domain-name-servers;

default-lease-time 600;
max-lease-time 7200;
log-facility local7;

class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
filename "pxelinux.0";

shared-network 5 {
subnet netmask {
pool {
allow members of "pxeclients";
range dynamic-bootp;