LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   svgalib doesn't work after kernel upgrade (2.4.33.3 to 2.6.17.13, slackware 11)) (https://www.linuxquestions.org/questions/slackware-14/svgalib-doesnt-work-after-kernel-upgrade-2-4-33-3-to-2-6-17-13-slackware-11-a-539019/)

ErV 03-20-2007 10:08 AM

svgalib doesn't work after kernel upgrade (2.4.33.3 to 2.6.17.13, slackware 11))
 
Hello.
After kernel upgrade (2.4.33.3 to 2.6.17.13, built from sources) on Slackware 11.
programs that use svgalib doesn't work anymore (I'm trying to start them in runlevel 3), they just print
Quote:

c0f48
svgalib: mmap error rrr
The svgalib version is 1.4.3-i386-2
I've tried to rebuild it from the sources, but it doesn't compile (sources are quite old, and gcc doesn't like some macros (mm.##x) in vga.c and labels in s3.c) and even after some "hacking" (modified code a bit - replaced macros with actual code and put ';' after empty label to make it work) compilation ends complaining about some headers in /usr/include/linux which I didn't dare to modify.

maybe it's connected with processor optimization? svgalib worked with previos kernel (kompiled for i486) and new kernel is optimized for i686. (AMD Sempron 2800+)

How can I fix the problem?

kodon 03-20-2007 12:07 PM

svgalib is a kernel module

thus if a new kernel is compiled,
svgalib must be recompiled for said kernel

there is a patch for 2.6 kernels

ErV 03-21-2007 03:41 AM

Quote:

Originally Posted by kodon
there is a patch for 2.6 kernels

Excuse me, but... where is it?
So far I've found only:
http://wiki.linuxfromscratch.org/pat.../trunk/svgalib
It looks like there are a lot of patches (http://www.google.com/search?hl=en&n...h&btnG=Search), but I didn't find one for 2.6 kernel.
Or are you talking about svgalib-1.9.25?

kodon 03-21-2007 04:26 AM

yes, it was for 1.9.25
don't remember the location
there should be a mention in the mailing list

sorry, afaik 1.9.x is the only
branch currently being developed

ErV 03-21-2007 03:31 PM

Well, after some fixing I was able to compile and install svgalib-1.4.3 (shipped in slackware 11).
Also I was lucky enough to find (and fix) bug in it. (Couldn't believe it at first)
Al problems were caused by line 1956 in vga.c where
Quote:

if ((long)GM < 0){
had to be replaced with
Quote:

if ((long)GM == -1){
That small "misprint" was causing false "mmap error rrr" alerts all the time. It's said in documentation that in case of failure mmap() returns -1, not "something less than zero" (which could be valid address)

The other compilation issues were fixed by disabling et6000 driver which tried to include
<pci.h> that (in turn) was leading to an "parse error" due to __u16 and __u32 types...

I'll make and post a patch later (there were some other small fixes to make this thing work)...

I must say that some programs using svgalib were not working with version 1.9.25. (wich compile easily).

--added--
here is the patch (for the original svgalib-1.4.3 shipped with slackware 11 in /source/l/svgalib/svgalib-1.4.3.tar.gz) to make it compile (and work). Hope it will help someone...:
Code:

diff -Nuar svgalib-1.4.3/Makefile.cfg svgalib-1.4.3a/Makefile.cfg
--- svgalib-1.4.3/Makefile.cfg        2001-05-29 18:39:13.000000000 +0400
+++ svgalib-1.4.3a/Makefile.cfg        2007-03-21 22:50:56.000000000 +0300
@@ -25,7 +25,7 @@
 # Common prefix for installation directories.
 # NOTE: This directory must exist when you start the install.
 TOPDIR=
-prefix = $(TOPDIR)/usr/local
+prefix = $(TOPDIR)/usr
 exec_prefix = $(prefix)
 
 # Directory where the shared stubs and static library will be installed.
@@ -38,7 +38,7 @@
 bindir = $(exec_prefix)/bin
 
 # Directory where the run-time configuration files will be installed.
-datadir = $(TOPDIR)/etc/vga
+datadir = /etc/vga
 
 # Directory where the header files will be installed.
 includedir = $(prefix)/include
@@ -82,7 +82,7 @@
 # BACKGROUND = y
 
 # Uncomment this if you want to compile and install the static libs.
-# INSTALLSTATICLIB = installstaticlib
+INSTALLSTATICLIB = installstaticlib
 
 # Comment this out if you don't want to install the shared libs.
 # If you do not install the shared nor the static libs, 'make static'
@@ -94,7 +94,7 @@
 # a.out image is available install it in the first directory named something
 # like *aout/ in /etc/ld.so.conf.
 # If you want this, do not comment out the next line:
-INSTALLAOUTLIB = installaoutcompat
+# INSTALLAOUTLIB = installaoutcompat
 
 # Comment this out if you want to keep old shared images. Old header files,
 # library stubs and static libraries CANNOT be kept in public locations
@@ -112,7 +112,7 @@
 # the Makefiles will try to figure out if your system supports gzipped man
 # pages and install them when possible.
 
-# MANFORMAT = compressed
+MANFORMAT = compressed
 # MANFORMAT = uncompressed
 
 # This is the command to update the man pages whatis database.
@@ -138,7 +138,7 @@
 INCLUDE_CHIPS_DRIVER = y
 INCLUDE_APM_DRIVER = y
 INCLUDE_NV3_DRIVER = y
-INCLUDE_ET6000_DRIVER = y
+#INCLUDE_ET6000_DRIVER = y
 INCLUDE_VESA_DRIVER = y
 INCLUDE_MX_DRIVER = y
 INCLUDE_PARADISE_DRIVER = y
@@ -257,7 +257,7 @@
 
 
 ifndef CFLAGS
-        OPTIMIZE = -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -g
+        OPTIMIZE = -fomit-frame-pointer -O2 -fno-strength-reduce -pipe
 else
        OPTIMIZE := $(CFLAGS)
 endif
diff -Nuar svgalib-1.4.3/demos/lineart.c svgalib-1.4.3a/demos/lineart.c
--- svgalib-1.4.3/demos/lineart.c        2000-02-19 12:12:52.000000000 +0300
+++ svgalib-1.4.3a/demos/lineart.c        2007-03-21 22:47:49.000000000 +0300
@@ -19,8 +19,8 @@
 
  if(mode == 0)
    {
-      printf("Usage:linp [mode mode ...]\n
-              where mode is an integer.\n");
+      printf("Usage:linp [mode mode ...]\n"
+              "where mode is an integer.\n");
      return;
    }
  if(! vga_hasmode(mode)) {
diff -Nuar svgalib-1.4.3/src/mach32.c svgalib-1.4.3a/src/mach32.c
--- svgalib-1.4.3/src/mach32.c        1999-09-29 20:52:14.000000000 +0400
+++ svgalib-1.4.3a/src/mach32.c        2007-03-21 21:40:14.000000000 +0300
@@ -1544,7 +1544,7 @@
                goto writerr;
            printf("mach32: Notice: new EEPROM file >%s< succesful created.\n",
                    eeprom_fname);
-          finish_w_eeprom:
+          finish_w_eeprom:;
        }
        /* Change eeprom contents if requested: */
        if (!(eeprom_option & EEPROM_USE_MEMCFG))
diff -Nuar svgalib-1.4.3/src/s3.c svgalib-1.4.3a/src/s3.c
--- svgalib-1.4.3/src/s3.c        2000-05-03 16:23:57.000000000 +0400
+++ svgalib-1.4.3a/src/s3.c        2007-03-21 21:41:12.000000000 +0300
@@ -475,8 +475,8 @@
            return old_values;
        }
    default:
+        return 0;
    }
-    return 0;
 }
 
 /* Return non-zero if mode is available */
diff -Nuar svgalib-1.4.3/src/vga.c svgalib-1.4.3a/src/vga.c
--- svgalib-1.4.3/src/vga.c        2001-05-29 18:37:55.000000000 +0400
+++ svgalib-1.4.3a/src/vga.c        2007-03-21 22:59:40.000000000 +0300
@@ -1953,7 +1953,7 @@
    };
    __vga_mmap();
 
-    if ((long) GM < 0) {
+    if ((long) GM == -1) {
        printf("svgalib: mmap error rrr\n");
        exit(1);
    }
@@ -3914,7 +3914,7 @@
 
 #define ML_GETINT(x) \
        ptr = strtok(NULL, " "); if(!ptr) break; \
-        mmt.##x = atoi(ptr);
+        mmt.x = atoi(ptr);
 
            ML_GETINT(HDisplay);
            ML_GETINT(HSyncStart);



All times are GMT -5. The time now is 12:20 PM.