Compiling a Driver Sample with IBM DDK on ArcaOS 5.0.1
By Martin Iturbide
On the last days of 2017 and first days of 2018 I got the desire to know more about the procedure to compile a driver for the OS/2 and ArcaOS platform. For the moment my interest was only to understand a little bit more about the process of compiling a driver and not learning about how to code or programming a driver.
Finding the right sample
I got a suggestion at the OS2World forum to look at a driver sample created for a Warpstock 1999 workshop. The sample was created by "Frank Meilinger" and it is called "OS/2 Physical Device Driver Development. A workshop about OS/2 PDD development" [1]. I recommend reading it.
Compiling Driver1
For the moment my goal was compile "driver1.zip" from the Frank Meilinger samples. The goal is simple, from the source code that you have there you need to generate a "driver1.sys" that will work (show some text) when ArcaOS boots.
Requirements
- Install the OS/2 Toolkit - "yum install os2tk45*"
- Get the IBM DDK package and install it.
- Unzip the driver1.zip from the tutorial. [2]
Preparing the Environment
There is are some work to do to prepare the environment for the first time. Since this is a 1999 driver, it uses the "classic" IBM and Microsoft tools to compile a driver. You will require:
- Microsoft nmake.exe from the IBM DDK. I was able to find the 2.001.000 Jan 28 1994 version.
- Microsoft Link.exe: ArcaOS 5.0.1 cames bundles with version 5.10.005. It is already on C:\OS2
- Microsoft mapsym.exe: I got it from the OS/2 Toolkit rpm package (os2tk45-utils)
- Microsoft masm.exe from the IBM DDK. It is the assembly compiler (some driver source code is on assembly)
- Microsoft cl.exe from the IBM DDK. It is the C language compiler.
Source Code
The source code of the driver1 is composed by the following files:
- driver1.c
- driver1.cod
- driver1.def
- makefile
- startup.asm
- startup.lst
The rest files like driver1.sys, obj, sym and map are generated on the compile procedure, you may move them some other place or erase those for the moment.
Environment Paths
You need to update the env.cmd file to make sure you are pointing everything to the right. In my case I created and env2.cmd file like this:
set ipfc=H:\ddk\base\tools; set path=H:\ddk\toolkits\msc60\binp;H:\ddk\toolkits\MASM\binp;H:\ddk\toolkits\MASM\binb;H:\ddk\tools;h:\ddk\base\tools;%path% set include=h:\ddk\base\h;h:\ddk\base\inc;%include%' set lib=h:\ddk\toolkits\msc60\lib;h:\ddk\base\lib;%lib%
I think it is almost self explanatory where I put the stuff from the DDK, which is the complex thing to organize since it is not as easy as to install it from a RPM/YUM repository.