Earlier on today, I decided to see if I could build the Media-Oriented Systems Transport protocol stack from the MOST4Linux project under Ubuntu 11.04.
However, it was originally designed for earlier versions of the Linux kernel than 2.6.38; and is no longer actively maintained by its developers – which makes compiling, and using it a challenge.
When I initially attempted to build the code, after downloading and extracting the most recent source code archive, the build process failed with:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Config files successfully generated by ./configure | |
Install prefix /usr/local/most4linux | |
Install path for driver modules /usr/local/most4linux/modules | |
Linux kernel source tree /lib/modules/2.6.38-8-generic/build | |
Build driver with real-time support disabled | |
Compile MOST NetServices library disabled | |
Compile with ALSA example enabled | |
Print debug messages disabled | |
Print trace messages disabled | |
Print debug messages on all register accesses disabled | |
Print debug messages for ioctl syscall disabled | |
Print debug messages for OS-8104 register access disabled | |
Print debug messages in non real-time ISRs disabled | |
Print debug messages in real-time ISRs disabled | |
Print debug messages for receive buffer disabled | |
Print debug messages for transmit buffer disabled | |
Print debug messages in sync module disabled | |
Print debug messages in NetServices module disabled | |
Print debug messages in alsa driver disabled | |
Debugging over serial port in realtime disabled | |
Now type 'make' to compile and afterwards 'make install' to install the driver | |
root@ubuntu:~/most4linux-1.0.0# make | |
Making all in most-kernel | |
make[1]: Entering directory `/home/tysonkey/most4linux-1.0.0/most-kernel' | |
make -f ./Makefile.kbuild KERNELDIR=/lib/modules/2.6.38-8-generic/build \ | |
KMOD_CFLAGS=" \ | |
-DHAVE_CONFIG_H \ | |
-I/home/tysonkey/most4linux-1.0.0" \ | |
RT=disabled | |
make[2]: Entering directory `/home/tysonkey/most4linux-1.0.0/most-kernel' | |
make -C /lib/modules/2.6.38-8-generic/build M=/home/tysonkey/most4linux-1.0.0/most-kernel | |
make[3]: Entering directory `/usr/src/linux-headers-2.6.38-8-generic' | |
LD /home/tysonkey/most4linux-1.0.0/most-kernel/built-in.o | |
CC [M] /home/tysonkey/most4linux-1.0.0/most-kernel/most-alsa.o | |
/home/tysonkey/most4linux-1.0.0/most-kernel/most-alsa.c:27:26: fatal error: sound/driver.h: No such file or directory | |
compilation terminated. | |
make[4]: *** [/home/tysonkey/most4linux-1.0.0/most-kernel/most-alsa.o] Error 1 | |
make[3]: *** [_module_/home/tysonkey/most4linux-1.0.0/most-kernel] Error 2 | |
make[3]: Leaving directory `/usr/src/linux-headers-2.6.38-8-generic' | |
make[2]: *** [default] Error 2 | |
make[2]: Leaving directory `/home/tysonkey/most4linux-1.0.0/most-kernel' | |
make[1]: *** [all-local] Error 2 | |
make[1]: Leaving directory `/home/tysonkey/most4linux-1.0.0/most-kernel' | |
make: *** [all-recursive] Error 1 | |
root@ubuntu:~/most4linux-1.0.0# |
By making a number of modifications to the source code and build scripts, I was eventually able to reach this stage:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@ubuntu:~/most4linux-1.0.0/most-kernel# make | |
make -f ./Makefile.kbuild KERNELDIR=/lib/modules/2.6.38-8-generic/build \ | |
KMOD_CFLAGS=" \ | |
-DHAVE_CONFIG_H \ | |
-I/home/tysonkey/most4linux-1.0.0" \ | |
RT=disabled | |
make[1]: Entering directory `/home/tysonkey/most4linux-1.0.0/most-kernel' | |
make -C /lib/modules/2.6.38-8-generic/build M=/home/tysonkey/most4linux-1.0.0/most-kernel | |
make[2]: Entering directory `/usr/src/linux-headers-2.6.38-8-generic' | |
Building modules, stage 2. | |
MODPOST 4 modules | |
/home/tysonkey/most4linux-1.0.0/most-kernel/most-pci: struct pci_device_id is 32 bytes. The last of 2 is: | |
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 | |
FATAL: /home/tysonkey/most4linux-1.0.0/most-kernel/most-pci: struct pci_device_id is not terminated with a NULL entry! | |
make[3]: *** [__modpost] Error 1 | |
make[2]: *** [modules] Error 2 | |
make[2]: Leaving directory `/usr/src/linux-headers-2.6.38-8-generic' | |
make[1]: *** [default] Error 2 | |
make[1]: Leaving directory `/home/tysonkey/most4linux-1.0.0/most-kernel' | |
make: *** [all-local] Error 2 |
Unfortunately, I’m unsure of the best way to continue – so I’ve decided to dump my modified code on BitBucket.
Those curious about my modifications to achieve the aforementioned result can deduce them from the “reversed” difference list – which was created by adding my modified version of the code into a special branch in a new Mercurial repository (“Initial_Ubuntu_Port_Attempt
“), and then retroactively importing the original version of the code into yet another branch (“Original_Code
“).
When I get the chance, I’ll probably document how I arrived at that conclusion, and share some resources that I discovered along the way.