I’ve found these Lanner 1U network appliances incredibly useful. Nice small factor, lots of network ports to do fun things with. They make fantastic Linux routing appliances. They’re kind of old-school, though, they have these LCD panel modules with four buttons.
I’ve been using them off-label for so long I can’t even remember what the panels were originally for.
See, the first thing I do is connect serial, boot to USB and install something modern on it. Rocky, Ubuntu, whatever.
Last week I went to explore the LCD panels, and see if I could make use of them. Maybe as a periodic status display or something. For the first time in years, I consulted the actual manual for these devices. It turns out, they’re connected to the motherboard internally via an internal parallel port.
The manual suggests using the drivers found at https://github.com/majodu/plcm_drv_v013 but they are so old they’re meant for Linux kernel 3 and below. So the first thing I did was clone the repository. After looking at it for a few minutes I realized I didn’t need everything it was delivering, I just needed the kernel module itself, which is compiled via the “boot” argument. Looking at the Makefile it was pretty clear what the logic was in “boot:”
boot:
ifeq ($(KVER3),3)
$(MAKE) -C $(KDIR) M=$(PWD) modules
endif
ifeq ($(KVER),2.6)
$(MAKE) -C $(KDIR) M=$(PWD) modules
endif
ifeq ($(KVER),2.4)
$(CC) $(MODCFLAGS) -c plcm_drv.c
endif
So the first thing I did, since my installed platform used kernel 5, was change the KVERS3 line to ifeq ($(KVER3),5) so that it would run the make on my kernel.
I was able to compile the kernel module. It barked at something else it was trying to install, but since all I really needed was the test executable and the kernel module for now, I ignored that.
Then I ran into an issue loading the newly-created kernel module. It didn’t like the major number associated with the driver, 248. Looking at /proc/devices I could see that 248 was in use by ptp, so I edited the Makefile and plcm_drv.c to use 239 instead, since that was available. I recompiled, and was able to load that kernel module just fine. After that, the plcm_test executable successfully ran and displayed stuff on the LCD panel and accepted button presses.
Good enough for now, at least I know I can write something in C to display something and receive button presses. Now to think through a good use case for this silly hoop I just jumped through…