Windows 1.04 keyboard driver source                John Elliott, 10 July 2014
=============================================================================

  This is an attempt at creating source code which compiles to some 
approximation of the Windows 1.04 US keyboard driver (usa.drv). It was 
created by starting with my similar recreation of the Windows 1.01 keyboard 
driver, and changing / rearranging code blocks until it compiled to the same
binary object.

  The Windows 1.01 keyboard driver source was based on taking the 
corresponding source from the Windows 3.1 DDK, and commenting out bits until 
the assembled result was the same.

  The source and build scripts are intended to build using Microsoft C 4.
This is a 16-bit compiler, so you will need a 16- or 32-bit build system 
(I'm using Windows NT 4). Edit MK2.BAT to set the paths to your installation,
and then run MK.BAT to compile. If all goes well, KBD.DRV should be created.

Notes on the source
~~~~~~~~~~~~~~~~~~~
  The source is based on the Windows 3.1 DDK. In general, sections removed 
to match the Windows 1.01 driver have been marked WIN1 and commented out with 
three semicolons, and additional changes for Windows 1.04 have been marked
WIN1.04. There may be other changes; a diff tool would be the best
way to find these.

Installing the result
~~~~~~~~~~~~~~~~~~~~~

  The easiest way is to use Windows 1.04 in its unattended setup mode. Copy
the installation diskettes and kbd.drv to a single directory; then use 
SETUP /Q to do the installation. For example:

	SETUP /Q c:\win104 kbd.drv mouse.drv egahires.drv

  will install to C:\WIN104.

Differences from the original
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The output file differs from the Windows 1.04 original in various respects:

* Various fields in the NE header are different:
	- Linker version is 5.0, not 4.0
	- CRC is different
	- Bit 2 of executable flags (offset 0Ch) is not set
	- Initial CS:IP is different
	- Segment lengths recorded in the segment table are longer
	- Segment flags differ:
		First code segment had reserved bits 13,14,15 set.
		Second code segment now has reserved bits 9,10 set.
		Data segment now has reserved bits 9,10 set. It's also 
		flagged as PURE, even though I marked it as IMPURE in the 
		DEF file. Odd.

