So far, I've got the the Win98 initialization of the Sound (8-bit SB 2.0 mode) and DOS initialization of 800x600x256 video mode to work, and I use LOADLIN to carry that over to Linux. But what I really want is to port all of those DOS/Win utilities to Linux. Also, I'd really like to have my MWave modem work again (I used to use it under OS/2).
http://www.freenetpages.co.uk/hp/mjbou/mwave.htmlmaintained by Michael Bouckley.
Update Mar 14, 2000 Just a general update, I've had my life turned upside down by moving and a busy time at work. Nathan Hand sent me some promising initialization code that doesn't depend on 32-bit BIOS calls (only 16-bit calls work which isn't sufficient when using power management). I haven't heard from IBM concerning their soft modem support of Thinkpads on Linux, but I'm still hopeful that they'll beat me to the punch. I will post Nathan's code for you to look over and try.
Update Oct 4: I've now migrated all of my code out of apm.c, and I'm moving it into a seperate module (which will make testing faster). I've also been contacted by Thomas Hood concerning hist tpctl utility. If you haven't seen it, check it out. I have a feeling that it will be a good place for me to go next, code wise. I've downloaded it, but not installed it yet.
Update Oct 1: Here is a list of the documentation I've been given so far (see MWave Haven in the links section at the bottom):
Update Sept 30: Sorry for the long gap between updates. I've been working hard on the documentation that I downloaded. I've also been in contact with Helge Behmann and Nathan Hand. Nathan supplied a patch that enables the MWave without using PS2.EXE. I've also starting working on adding MWave code to Linux's Advanced Power Management support.
Update Sept 14: I now have all of the toolkits from MWave Haven Website (no longer online) to try, and I'll post my progress. Check out the How MWave Works section below for my design so far.
I've visited the Mwave Project for Linux page, and various other Thinkpad pages to get XFree86 to work reasonably well,
at 800x600, but in only 8 bit color using the 2.2.6 kernel and XF86 version
3.3.3's SVGA driver. I needed to add a hack which put the video in a properly
positioned 800x600x256c mode called:
PS2.EXE MODE3X ON
which is in my DOS autoexec.bat. Then it calls LOADLIN.EXE with my kernel.
I've written device drivers for OS/2 and embedded designs (and the Coleco Adam too), and I've wanted a meaningful project to do a little Linux kernel hacking. My first attempt is to read the settings of the Mwave DSP. So far it detects it and that is all. View the mwave.c (version 0.1) source or download mwave-0.1.tar.gz.
If you want to download it and look it over, please send me your comments.
Extract the source with:
tar -xzvf mwave-0.1.tar.gz
To compile, simply type:
make
To test it, you need to become root:
su
and invoke it with the -v (verbose) option:
./mwave -v
It will show you what it is doing. It detected the baseio on my Thinkpad, and
detects no Mwave on my generic clone (which doesn't have Mwave), so I consider it safe.
WARNING: The code to read mwave registers 3, 5, 16
outputs random values, and may be unsafe. Ideally swap hard disk drives
before testing (although I just make sure I have a backup).
You can also try:
./mwave --help
for my somewhat ambitious dreams of what version 1.0 can do.
Please send your test results to me, and a patch with what the correct code should be to initialize the Mwave register reading code properly.
/usr/src/linux
) in the file
arch/i386/boot/setup.S
which is executed before switching
to protected mode, but after the Linux kernel is decompressed.
It calls the BIOS call for advanced power management [ APM v1.1 -- the standard is available on Intel's ftp server as apmv11.doc (Word 2.0 format (?!)), or v1.2 is available on Microsoft's site as apmv12.pdf). [ BTW, Adobe's Acrobat Reader for Linux (including a Netscape plug-in) is vastly superior to ghostview, xpdf or any other PDF viewers I've tried on Linux. ] ]
The standard permits an OEM (IBM) to make a special extension for custom needs. In their case, they chose to make an extension. Thanks to Helge Bahmann I've learned that that extension can be called via INT 15h with AX=5380h, BX=6000h and CX=1101h. Initially Nathan and I tried adding that code to the 32 bit protected APM code in Linux, but it didn't work. So, I read that 16/32 bit protected mode. Nathan figureed out where to put the real mode call and here it is.
Now, there is a disadvantage to this patch. On both Linux and NT after the OS boots, you aren't allowed to make real mode BIOS calls, and the MWave DSP doesn't resume from suspend automatically. Under NT, IBM recommends that you disable suspend if you want to use sound or the MWave modem. Nathan is working on some magic code that will work based on the actual BIOS code.
Here is the actual patch:
--- setup.S.orig Sat Sep 25 00:01:32 1999
+++ setup.S Fri Sep 24 23:53:15 1999
@@ -382,6 +382,15 @@
mov [0x1ff],#0xaa ! device present
no_psmouse:
+!
+! Let's try and enable thinkpad dsp
+!
+
+ mov ax,#0x05380
+ mov bx,#0x06000
+ mov cx,#0x01101
+ int 0x15
+
! check for APM BIOS
! NOTE: DS is pointing to the boot sector
--IS0zKkzwUGydFO0o--
To apply this patch, you need to install the Linux kernel sources. Nathan is working from 2.2.12 source. I am currently working from 2.2.6 but I'll probably move to a more recent kernel soon. This should work with either.
I'll add more detailed patch application documentation, once we have some more
substantial patches. In the mean time, if you can figure it out yourself,
simply compile your kernel (make bzImage
), copy the
freshly compiled kernel from arch/i386/boot/bzImage
to some place
mentioned in lilo.conf (like /bzImage.mwave
), re-run lilo.
NOTE: don't make an experimental kernel your only kernel. Either have a
backup known-good kernel on a boot floppy, or another entry in lilo.conf
with a known-good kernel (like /bzImage.stock
for example).
That way, at boot time you can choose your kernel.
You know that the patched kernel works by running my mwave manager tool as root (on Nathan's Thinkpad 765):
jabba:~# ~nathanh/coding/mwave-0.1/mwave -v Mwave settings manager for IBM Thinkpad (*) probing for mwave base base 1 (0xce30): 0xffff base 2 (0x8e30): 0xffff base 3 (0x4e30): 0xa839 MWave base detected at: 0x4e30 Reg 3=0x7b8b Reg 4=0x2896 Reg 16=0x4c06 jabba:~#I get similar output on my Thinkpad 755cx.
Send questions to: dalew@opengraphics.com.
Dale Wick's Home Page | AdamCon.org Home