OK so tonight I went back and un-did the hack to the kernel's fb radeon driver in the aforementioned radeon_base.c file. In other words, I reverted to the original code. This is so it will get future kernel compiles back on track as if I had started from a clean gentoo-sources kernel, version 2.6.22 (Linux i686 2.6.22-gentoo-r2 to be specific as possible).
on to svgalib-1.9.19 compilation. This keeps erroring out with a "invalid lvalue in assignment" in src/drivers/apm.c, line 151.
thanks to
http://groups.google.co.ve/group/svgalib/msg/d7737019b740d690 , I tried the following approach:
it compiles if you change the last 6 assignments to
*(unsigned long *)(&(regs[APMREG_SAVE(18)])) =
inlXR(0xf0) ;
*(unsigned long *)(&(regs[APMREG_SAVE(22)])) =
inlXR(0xf4) ;
*(unsigned long *)(&(regs[APMREG_SAVE(26)])) =
inlXR(0x140) ;
*(unsigned short *)(&(regs[APMREG_SAVE(30)])) =
inXR(0x144) ;
*(unsigned long *)(&(regs[APMREG_SAVE(32)])) =
inlXR(0x148) ;
*(unsigned short *)(&(regs[APMREG_SAVE(36)])) =
inXR(0x14c) ;
Well, after a 'make clean' followed by a 'make install', It errored out, in an assembler message, saying:
suffix or operands invalid for 'movzbl'
... this was also addressed by the above website:
changes to demos/speedtest.c and demos/linearspeed.c and
gl/inlstring.h
-- 1st "movzbl" in __memset(): the destination register
should be "eax" (both versions of this function)
...basically search for 'movzbl' in these 3 files and change the lines so they read:
"movzbl %%al,%%eax\n\t"
(in other words you are sticking an 'e' in front of 'ax')
... now I'm getting an error in kernel/svgalib_helper/main.c:
error: linux/config.h: No such file or directory
... and thanks to another good Google (
http://www.linuxquestions.org/questions/showthread.php?t=506363 - apparently include/config.h is no longer used as of kernel 2.6.19), I commented out the include on the first line of main.c
... similarly I'm getting another error in the same c file:
error: linux/devfs_fs_kernel.h: No such file or directory
... and thanks to YET another good Google (
http://www.nabble.com/Linux-kernel-2.6.18-t2575425.html - apparently include/devfs_fs_kernel.h is no longer used as of kernel 2.6.17), I also commented out this include in main.c.
... OK, still same main.c file, now the errors are:
kernel/svgalib_helper/main.c: error: expected ')' before string constant
... well the lines in question are these:
MODULE_PARM(debug, "i")
...
MODULE_PARM(all_devices, "i")
AFAICT, this is another kernel deprecation thing and I have changed the above lines to:
module_param(debug, int, 0644)
...
module_param(all_devices, int, 0644)
(where '...' means there is other stuff between the two lines that I didn't touch)
... just when I think I'm getting somewhere...
(although I think I'm getting close to a successful make)
... now it's giving me:
kernel/svgalib_helper/interrupt.c: error: 'PCI_VENDOR_ID_RENDITION' undeclared
... I found this (
http://groups.google.com/group/svgalib/browse_thread/thread/dbca938113f5c1cc) where a patch was posted to fix this (among another) problem. My fix is based on this patch. I added the following lines to the beginning (after the #include statements, but before other code) of interrupt.c:
#ifndef PCI_VENDOR_ID_RENDITION
#define PCI_VENDOR_ID_RENDITION 0x1163
#endif
It worked!!!
but wait... there is a scary looking warning:
WARNING: "io_remap_page_range" [svgalib_helper.ko] undefined!
... well this certainly brings back memories (
http://forum.arcadecontrols.com/index.php?topic=46747.msg455507#msg455507), posted by (ahem) me, the first time I went through this masochism. So I made the same change (macro substitution) and once again:
make clean
make install
make demoprogs
cp -f kernel/svgalib_helper/svgalib_helper.ko /lib/modules/2.6.22-gentoo-r2/kernel/misc
insmod /lib/modules/2.6.22-gentoo-r2/kernel/misc/svgalib_helper.ko
lsmod | grep svga
WOOHOO! IT WORKED!