MODEL30.EXE is a small DOS command-line utility for controlling selected planar devices on the IBM PS/2 Model 30 by reading and writing the system control register at I/O port 65h.
It was written in Turbo Pascal and preserves unrelated bits in the register when changing a device setting.
| Command name | Aliases | Register bits | Description |
|---|---|---|---|
LPT |
LPT1 |
80h and 02h |
Enables or disables the onboard parallel port |
COM |
COM1 |
10h |
Enables or disables the onboard serial port |
HDD |
— | 01h |
Enables or disables the onboard hard-disk interface |
FLOPPY |
FDD |
08h |
Enables or disables the onboard floppy-disk interface |
MCGA |
VIDEO |
04h |
Enables or disables the onboard MCGA video hardware |
MODEL30
MODEL30 STATUS
MODEL30 device:ON|OFF [device:ON|OFF ...]
Running MODEL30 with no arguments displays the current register value and device status.
MODEL30 STATUS does the same thing explicitly.
One or more device settings can be supplied on the same command line.
Display the current status:
MODEL30
or:
MODEL30 STATUS
Disable the parallel port:
MODEL30 LPT:OFF
Re-enable the parallel port:
MODEL30 LPT:ON
Disable the onboard hard-disk interface:
MODEL30 HDD:OFF
Disable the parallel port and enable COM1:
MODEL30 LPT:OFF COM1:ON
Disable several onboard devices at once:
MODEL30 LPT:OFF HDD:OFF FLOPPY:OFF
The command names and ON/OFF values are not case-sensitive.
When a device is configured to use IRQ 7, disabling the onboard LPT port can free that interrupt:
C:\UTIL\MODEL30.EXE LPT:OFF HDD:OFF COM:ON
These commands may be placed in AUTOEXEC.BAT.
After changing a setting, the utility displays the value of port 65h before and after the write:
Port 65h before: 9E
Port 65h after : 1C
The exact values depend on the current state of the machine.
If the register value read back from the hardware does not match the requested value, the program displays:
Warning: register readback does not match requested value.
| Code | Meaning |
|---|---|
0 |
Command completed successfully |
1 |
Invalid argument or unknown device name |
2 |
Register readback did not match the requested value |
Exit codes can be checked in a batch file with ERRORLEVEL.
Example:
MODEL30 LPT:OFF
IF ERRORLEVEL 2 GOTO READERROR
IF ERRORLEVEL 1 GOTO BADCOMMAND
An invalid setting:
MODEL30 LPT:YES
An unknown device:
MODEL30 SOUND:OFF
Both display the usage screen and return exit code 1.
- Changes are made directly to the Model 30 planar control register.
- Settings normally return to their firmware defaults after a cold boot or power cycle.
- The utility preserves unrelated bits in port
65h. - Disabling the floppy, hard-disk, serial, or video hardware can make those devices unavailable immediately.
- Do not disable a storage controller while DOS is actively using a drive attached to it.
- The
LPToption changes both the parallel-port select and output-enable bits. - This utility is intended for the IBM PS/2 Model 30 hardware whose planar control register is located at port
65h.
Entering an invalid command displays the built-in usage summary:
MODEL30 - IBM PS/2 Model 30 planar control utility
Usage:
MODEL30 STATUS
MODEL30 device:ON|OFF [device:ON|OFF ...]
Devices:
LPT or LPT1
COM or COM1
HDD
FLOPPY or FDD
MCGA or VIDEO
Example:
MODEL30 LPT:OFF HDD:OFF COM1:ON