*BSD News Article 38936


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!werple.apana.org.au!otis.apana.org.au!serval.net.wsu.edu!netnews.nwnet.net!oracle.pnl.gov!osi-east2.es.net!cronkite.nersc.gov!dancer.ca.sandia.gov!overload.lbl.gov!lll-winken.llnl.gov!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!gumby!andrews-cc!gillham
From: gillham@andrews.edu (Andrew Gillham)
Newsgroups: comp.os.386bsd.misc
Subject: [FreeBSD] patch for IBM Thinkpad 750CE
Date: 2 Dec 1994 13:10:14 GMT
Organization: Andrews University
Lines: 82
Message-ID: <3bn6bm$rbv@orion.cc.andrews.edu>
NNTP-Posting-Host: edmund.cs.andrews.edu


Here is a minor patch that will allow you to run FreeBSD 2.0R
on an IBM Thinkpad 750CE.  It may work on other models, but as
the 750CE is all I have, I can't confirm it.
Note that these patches don't fix the boot code, so you still
need to raw write the 1.44MB image to a 2.88MB disk.  You will
have to use something like Norton, or a patched rawrite.exe to
write to the 2.88.  As soon as the kernel starts testing RAM,
swap the 2.88MB disk with a 1.44MB boot.flp image.  I am
actually using a hacked boot program, but the above should work.

The 2.88MB floppy patches simply cause the kernel to probe the
drive as a 1.44MB instead of as [unknown]. 
Once you get FreeBSD 2.0R booted though, the keyboard is broke!
So included is a *MAJOR HACK* that allows you to use the keyboard
correctly.  Well ok, it's not a major hack, but is certainly crappy
code as there's no sanity checking involved.  I'll leave the real
fix to the author of syscons.  I wrapped the hack in a "#ifdef"
so you should add "options XT_KEYBOARD" to your kernel config.
For some reason the Thinkpad's keyboard only seems to work as an
XT keyboard, and the pccons driver has support for the XT keyboard
while syscons doesn't.  So I simply hard-coded the commands to set
the keyboard to XT mode.

Anyway, that's about it.  Don't scream at me if you install the
patch and everything blows up!  It's incredibly simple, but hey
no guarantees from me.. :-)

-Andrew

---------------------------

*** /usr/src/sys/i386/isa/fd.c.orig	Thu Dec  1 21:21:24 1994
--- /usr/src/sys/i386/isa/fd.c	Thu Dec  1 21:24:17 1994
***************
*** 495,500 ****
--- 495,504 ----
  			printf("1.44MB 3.5in]");
  			fd->type = FD_1440;
  			break;
+ 		case RTCFDT_288M:
+ 			printf("2.88MB 3.5in - 1.44MB mode]");
+ 			fd->type = FD_1440;
+ 			break;
  		case RTCFDT_360K:
  			printf("360KB 5.25in]");
  			fd->type = FD_360;
*** /usr/src/sys/i386/isa/rtc.h.orig	Thu Dec  1 21:21:46 1994
--- /usr/src/sys/i386/isa/rtc.h	Thu Dec  1 21:22:13 1994
***************
*** 104,109 ****
--- 104,110 ----
  #define	 RTCFDT_12M	 0x20		/* 1.2M */
  #define  RTCFDT_720K     0x30           /* 720K */
  #define	 RTCFDT_144M	 0x40		/* 1.44M */
+ #define	 RTCFDT_288M	 0x60		/* 2.88M */
  
  #define RTC_BASELO	0x15	/* low byte of basemem size */
  #define RTC_BASEHI	0x16	/* high byte of basemem size */
*** /usr/src/sys/i386/isa/syscons.c.orig	Thu Dec  1 23:17:42 1994
--- /usr/src/sys/i386/isa/syscons.c	Fri Dec  2 00:24:21 1994
***************
*** 344,349 ****
--- 344,356 ----
  		if (val != KB_RESET_DONE) 
  			printf("scprobe: keyboard RESET failed %02x\n", val);
  	}
+ #ifdef XT_KEYBOARD
+ 	kbd_wait();
+ 	outb(KB_DATA, 0xF0);
+ 	kbd_wait();
+ 	outb(KB_DATA, 1);
+ 	kbd_wait();
+ #endif /* XT_KEYBOARD */
  	return (IO_KBDSIZE);
  }
  
-- 
==========================================================
Andrew Gillham                       gillham@andrews.edu
LAN/WAN/Netware/Unix Analyst         gillham@whirlpool.com
==========================================================