Patched 5.4 kernel for Compaq R3000 series

george+freebsd at m5p.com george+freebsd at m5p.com
Sat May 14 22:05:15 PDT 2005


Symptom: You have a Compaq Presario R3000-series machine.  When you put
the 5.4 CD-ROM in and boot up, the machine powers down shortly after you
leave the beastie boot menu.

Workaround: You need a version of the patch originated by Jung-uk Kim
(http://docs.freebsd.org/cgi/mid.cgi?200407021130.58247.jkim).  But
you can't apply the patch until after you install the system, but you
can't install the system until ... (etc., etc.).  I have posted a
patched version of the kernel TEMPORARILY at:

http://www.m5p.com/freebsd/kernel-5.4-r3000.tar.bz2

(My version of the patch, attached, is slightly different from the
original version and disables the keyboard controller test under the
control of a device hint.)  Here is how you can use this patched
kernel, after logging in as root:

A. Unpack the contents of a FreeBSD CD-ROM in some temporary space.
For example, mount the CD-ROM on /cdrom and make a directory
/usr/tmp/5.4.  Then cd to /usr/tmp/5.4 and do:

(cd /cdrom, gtar cvf - .) | gtar xvfp -

B. Replace the distributed kernel with the patched kernel.

cd /usr/tmp/5.4/boot/kernel
mv kernel kernel.orig
tar xvfy kernel-5.4-r3000.tar.bz2

C. cd to /usr/tmp/5.4/boot.  Add the lines:

hint.atkbdtest.0.disabled="1"
hint.acpi.0.disabled="1"

to the end of the file loader.conf (unless you know that ACPI works
on your R3000).

D. cd to /usr/tmp/5.4 and burn a new CD-ROM with this command:

mkisofs -R -b boot/cdboot -no-emul-boot . | burncd data - fixate

E. Install with the patched CD-ROM.

Install in the usual way.  But after the base distribution has been
extracted, go to the emergency holographic shell (ALT-F4) and replace the
kernel which was just installed with the patched kernel:

cp /dist/boot/kernel/kernel /boot/kernel

You should now have a working system.  Here is my modified version
of Jung-ok Kim's patch.                        -- George Mitchell



--- dev/kbd/atkbdc.c.orig	Sun Aug 24 10:49:15 2003
+++ dev/kbd/atkbdc.c	Tue Dec 14 15:28:11 2004
@@ -944,53 +944,59 @@
 int
 test_kbd_port(KBDC p)
 {
-    int retry = KBD_MAXRETRY;
-    int again = KBD_MAXWAIT;
-    int c = -1;
+    if (resource_disabled("atkbdtest", 0)) return 0;
+    else {
+	int retry = KBD_MAXRETRY;
+	int again = KBD_MAXWAIT;
+	int c = -1;
 
-    while (retry-- > 0) {
-        empty_both_buffers(p, 10);
-        if (write_controller_command(p, KBDC_TEST_KBD_PORT))
-    	    break;
-    }
-    if (retry < 0)
-        return FALSE;
+	while (retry-- > 0) {
+	    empty_both_buffers(p, 10);
+	    if (write_controller_command(p, KBDC_TEST_KBD_PORT))
+		break;
+	}
+	if (retry < 0)
+	    return FALSE;
 
-    emptyq(&kbdcp(p)->kbd);
-    while (again-- > 0) {
-        c = read_controller_data(p);
-        if (c != -1) 	/* try again if the controller is not ready */
-    	    break;
+	emptyq(&kbdcp(p)->kbd);
+	while (again-- > 0) {
+	    c = read_controller_data(p);
+	    if (c != -1) 	/* try again if the controller is not ready */
+		break;
+	}
+	if (verbose || bootverbose)
+	    log(LOG_DEBUG, "kbdc: TEST_KBD_PORT status:%04x\n", c);
+	return c;
     }
-    if (verbose || bootverbose)
-        log(LOG_DEBUG, "kbdc: TEST_KBD_PORT status:%04x\n", c);
-    return c;
 }
 
 int
 test_aux_port(KBDC p)
 {
-    int retry = KBD_MAXRETRY;
-    int again = KBD_MAXWAIT;
-    int c = -1;
+    if (resource_disabled("atkbdtest", 0)) return 0;
+    else {
+	int retry = KBD_MAXRETRY;
+	int again = KBD_MAXWAIT;
+	int c = -1;
 
-    while (retry-- > 0) {
-        empty_both_buffers(p, 10);
-        if (write_controller_command(p, KBDC_TEST_AUX_PORT))
-    	    break;
-    }
-    if (retry < 0)
-        return FALSE;
+	while (retry-- > 0) {
+	    empty_both_buffers(p, 10);
+	    if (write_controller_command(p, KBDC_TEST_AUX_PORT))
+		break;
+	}
+	if (retry < 0)
+	    return FALSE;
 
-    emptyq(&kbdcp(p)->kbd);
-    while (again-- > 0) {
-        c = read_controller_data(p);
-        if (c != -1) 	/* try again if the controller is not ready */
-    	    break;
+	emptyq(&kbdcp(p)->kbd);
+	while (again-- > 0) {
+	    c = read_controller_data(p);
+	    if (c != -1) 	/* try again if the controller is not ready */
+		break;
+	}
+	if (verbose || bootverbose)
+	    log(LOG_DEBUG, "kbdc: TEST_AUX_PORT status:%04x\n", c);
+	return c;
     }
-    if (verbose || bootverbose)
-        log(LOG_DEBUG, "kbdc: TEST_AUX_PORT status:%04x\n", c);
-    return c;
 }
 
 int



More information about the freebsd-mobile mailing list