OS/2 eZine - http://www.os2ezine.com
Spacer
October 16, 2002
 
Julio Cezar Salguerio da Silva lives in Rio de Janeiro and is a security engineer from a multinational company. Today he is running OS/2 Warp 4 full time at home, and the first time he saw OS/2 was on it's launch in Brazil in 1992. It was love at first sight.

If you have a comment about the content of this article, please feel free to vent in the OS/2 eZine discussion forums.

There is also a Printer Friendly version of this page.

Spacer
Previous Article
Home
Next Article


CommuniGate Pro - Advanced Messaging NOW for OS/2


Building USB drivers from the DDK Sources

I spent the last six months trying to make my USB mouse work under OS/2. I tried everything, even bought a new USB PCI board, and still the USB mouse was dead.

There are two different types of host contollers. UHCI (Universal Host Controller Interface) and OHCI (Open Host Controller Interface.) As far as I could find, they are sort of like normal modems and winmodems.

UHCI is developed by Intel and is like normal modems. OHCI was developed by Compaq and it's like a winmodem, it depends on special software to work. Initial UHCI drivers were made available by IBM for free, the OHCI drivers were later released under Software Choice. Now the updated versions of all of them are only available from Software Choice.

A few weeks ago I saw Chris Wohlgemuth's Mass Storage Device drivers for USB and thought why not try the DDK sources myself. I have to say that my experince with device drive programming is equal to zero and I had some tough times on Linux when I needed a special driver for my modem card.

To my surprise, building the drivers from the DDK is very simple and easy, the sources compiled fine once you set up the enviroment for the Microsoft 16 bit C compiler. After finishing compiling it I copied them to \OS2\BOOT, removed the comments from my CONFIG.SYS and restarted and the mouse was alive and clicking.

Getting the files

To begin you need to get the DDK sources and tools to build the USB drivers, go to http://www3.software.ibm.com/regsvs/ddk/, create an account and download the following files:

Under Input/Output Device Drivers and Test Tools click on the first button named Download Source Code ZIP File and the one named Download Build Tools Zip File.

Under Microsoft(R) Compiler/Assembler Build Tools download both of the files for Microsoft C Compiler and the Microsoft Macro Assember.

There are documentation files for Input/Output Device Driver reference and the Using your DDK that you may download, the first one tells you how to build new device drivers for OS/2 the second tells you how to use the DDK to compile the sources.

Unpacking the Files

Unzip all the files into a folder, I called mine f:\build. Once all the files have been unzipped you will have two folders inside your f:\build folder. The folder DDK has the source code for all the USB drivers among other things, the DDKTools folder has the compilers and assembers.

Setting up the Files

In the f:\build\ddk\tools directory there is a file called COPYC60.CMD, this file takes two parameters. The first is the is the path to the Microsoft C 6.0 compiler, the second is the path to the DDK source. Execute this file like the example below:

COPYC60 f:\build\ddktools\toolkits\msc60 f:\build\ddk

The batch file copies the required files for the compiling process.

Building the Drivers

Now it's time to build the drivers. Go to f:\build\ddk\base\src\dev\usb and call NMAKE, if you want to log all the nmake messages use NMAKE > filename.

If you don't have any errors, in each subfolder a .SYS file will be created, you can copy them to x:\OS2\BOOT.

Enabling the USB Driver

You will have to change your CONFIG.SYS, before we go on, back up your CONFIG.SYS. Add the lines below to your CONFIG.SYS:

For OHCI adapters

BASEDEV=USBOHCD.SYS
BASEDEV=USBD.SYS /REQ:USBOHCD$
BASEDEV=USBHID.SYS
DEVICE=C:\OS2\BOOT\USBMOUSE.SYS

For UHCI adapters

BASEDEV=USBUHCD.SYS
BASEDEV=USBD.SYS /REQ:USBUHCD$
BASEDEV=USBHID.SYS
DEVICE=C:\OS2\BOOT\USBMOUSE.SYS

Shutdown your system and plug your mouse and power up the computer, your mouse should work properly on OS/2, WinOS/2 and DOS.

If you are tempted to remove the DEVICE=C:\OS2\BOOT\MOUSE.SYS SERIAL=COMx from your CONFIG.SYS - don't, the mouse will not work without it.

Well, that's all, I hope you all can make it.

Previous Article
Home
Next Article

Copyright (C) 2002. All Rights Reserved.