The text of a manual · part 20 of 28
PEN*KEY 6400 Computer Programmer's Reference Guide: Section 5: BIOS Interrupt Support, pages 161 to 170
Pages 161 to 170 of 234, from PEN*KEY 6400 Computer Programmer's Reference Guide
The original document is the PDF (1.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 6400
Page 161
BIOS Interrupt Support
SECTION 5
INT 15h, Function AX = 5380h: Get System Information (OEM) Subfunction BH = C3h
64APMOEM Returns system information fields. Information fields are arbitrary 32-bit values and are accessed by ID. Not all fields are expected to be supported on every machine, so a method is provided for finding out which field IDs are valid on a particular machine. On Entry:
AH = 53h AL = 80h BH = C3h BL = System information field ID to be returned Range: 0–254 255 is reserved
On Return:
if successful: Carry = 0 AX = Error codes C301h = Invalid field ID; valid IDs greater than this one. C302h = Invalid field ID; no valid IDs greater than this one. if NOT successful: Carry = 1 DX:AX = 32 bits of system information field data. (format is field-specific) BX:CX = 0 (32 bits of unused field flags. (these could be implemented inthe future)
INT 15h, Function AH = 80h; Device Open
BIOS Opens a device. Hook this function as a multitasker needing to keep track of device ownership. On Entry:
AH = 80h BX = Device ID CX = Process ID
On Return:
if successful: Carry = 0 AH = 00h if NOT successful: Carry = 1 AH = Status 80h Invalid command 86h Function not supported
See Also: Functions AH=81h, AH=82h PEN*KEYR 6400 Programmer’s Reference Guide
5-51
Page 162
SECTION 5
BIOS Interrupt Support
INT 15h, Function AH = 81h; Device Close
BIOS Closes a device. Hook this function as a multitasker needing to keep track of device ownership. On Entry: AH = 81h BX = Device ID CX = Process ID
On Return:
if successful: Carry = 0 AH = 00h if NOT successful: Carry = 1 AH = Status 80h Invalid command 86h Function not supported
See Also: Functions AH=80h, AH=82h INT 15h, Function AH = 82h; Program Termination
BIOS Closes all devices, opened by the given process ID with function 80h. Hook this function as a multitasker needing to keep track of device ownership. On Entry: AH = 82h BX = Process ID
On Return:
if successful: Carry = 0 AH = 00h if NOT successful: Carry = 1 AH = Status 80h Invalid command 86h Function not supported
See Also: Functions AH=80h, AH=81h
5-52
PEN*KEYR 6400 Programmer’s Reference Guide
Page 163
BIOS Interrupt Support
SECTION 5
INT 15h, Function AX = 8300h; Set Event Wait Interval
BIOS Programs the real-time clock to generate an interrupt after the specified amount of time and bit 7 of the byte pointed to by ES:BX is set. The duration of the wait interval is a multiple of 976 microseconds, because most BIOSs use 1/1024 second test interrupt from AT real-time clock chip (available on INT 70). On Entry: AH = 83h AL = 00h CX = High byte of interval (in microseconds) DX = Low byte of interval (in microseconds) ES:BX = Pointer to byte calling program’s memory with bit 7 set when the interval expires.
On Return:
AH = 00h if successful: Carry = 0 AL = Value written to CMOS RAM register B if NOT successful: Carry = 1 AL = 00h (Function busy)
See Also: Functions AH=41h, AH=86h, and INT 70h INT 15h, Function AX = 8301h; Cancel Event Wait Interval
BIOS Cancels the event wait interval. On Entry: AH = 83h AL = 01h
On Return: None
INT 15h, Function AH = 84h; Read Joystick Input Settings
BIOS Reads the joystick input settings. Setting register pair DX to 00h reads the current switch settings. Setting register pair DX to 01h reads the current resistive input settings. On Entry: AH = 84h DX = 00h (Read current switch settings) 01h (Read resistive inputs)
On Return:
AL = Switch settings (bits 7–4) (if DX = Read current switch settings) AX = A(x) Value (if DX = Read resistive inputs (positions) BX = A(y) Value (if DX = Read resistive inputs (positions) CX = B(x) Value (if DX = Read resistive inputs (positions) DX = B(y) Value (if DX = Read resistive inputs (positions) PEN*KEYR 6400 Programmer’s Reference Guide
5-53
Page 164
SECTION 5
BIOS Interrupt Support
INT 15h, Function AH = 85h; System Request (SysReq) Key Pressed/Released
BIOS Called by INT 09h ISR when the SysReq key is pressed. Application programs that must monitor the SysReq key must hook this call, since the default handler returns successful. On Entry: AH = 85h AL = 00h (Key pressed) 01h (Key released)
On Return:
if successful Carry = 0 AH = 00h if NOT successful: Carry = 1 AH = 80h (Invalid command) 86h (Function not supported)
See Also: Function INT 09h INT 15h, Function AH = 86h; Wait (Elapsed Time)
BIOS Suspends calling program for specified time period. The register CX and DX values are in microseconds, but are rounded down to the nearest multiple of 976. On Entry: AH = 86h CX = High byte of time interval to wait (in microseconds) DX = Low byte of time interval to wait (in microseconds)
On Return:
Carry = Status flag 0 (successful) after the time interval has concluded 1 (NOT successful) returns upon error or wait 83h in progress
5-54
PEN*KEYR 6400 Programmer’s Reference Guide
Page 165
BIOS Interrupt Support
SECTION 5
INT 15h, Function AH = 87h; Copy Extended Memory Block
BIOS Copies a block of memory from anywhere in the system address space to anywhere else in the system address space. Memory space that is not generally available to real-mode programs is accessible through this function. The copy is performed in protected mode with interrupts disabled by the default BIOS handler. Many 386 memory managers perform the copy with interrupts enabled. This function is incompatible with the OS/2 compatibility box. On Entry: AH = 87h CX = Number of 16-bit words to copy (max 8000h) ES:SI = Pointer to 48-byte GDT table, allocated by calling program
On Return:
if successful Carry = 0 AH = 00h (source successfully copied to destination) if NOT successful Carry = 1 (returned immediately upon error) AH = Error Status 01 = RAM parity error occurred 02 = Interrupt error 03 = Address line 20 gating failed Global Descriptor Table
Offset
Description
00h 08h 10h 18h 20h 28h
Uninitialized, Null descriptor (used by BIOS) Uninitialized, Made into GDT descriptor Uninitialized, Descriptor for source of move Uninitialized, Descriptor for destination of move Uninitialized, Used by BIOS Uninitialized, Made into SS descriptor
When called, two of the descriptors in the GDT table specify the source and destination addresses of the block to be moved. The BIOS builds the other four descriptors. The calling program supplies the segment limits, base address of the data blocks, and the access rights for each location. See Also: Functions AH=88h, AH=89h INT 15h, Function AH = 88h; Read Extended Memory Size
BIOS Determines the extended memory size by reading the amount of memory above 1 megabyte from the CMOS RAM locations 30h and 31h. On Entry: AH = 88h
On Return:
AX = Number of contiguous 1 kilobyte blocks of extended memory PEN*KEYR 6400 Programmer’s Reference Guide
5-55
Page 166
SECTION 5
BIOS Interrupt Support
INT 15h, Function AH = 89h; Switch Processor to Protected Mode
BIOS The GDT describes the memory management environment that is in effect on return to the calling program. All table descriptors are initialized by the calling program, except the BIOS code segment descriptor. The “access rights” byte of the BIOS descriptor is set to 9Bh. The address is set to F0000h and the segment limit is set to 0FFFFh. The DS, ES, and SS descriptors are loaded with 0018h, 0020h, and 0028h, respectively. The descriptors built at these GDT offsets describe the segments that these registers reference after the BIOS returns to the calling program. On Entry:
AH = 89h BH = Interrupt number for IRQ 8 (IRQ 9Fh use next 7 interrupts) BL = Interrupt number for IRQ 0 (IRQ 17h use next 7 interrupts) CX = Offset into protected mode CS to jump to ES:SI = Pointer to GDT for protected mode
On Return:
if successful Carry = 0 AH = 00h (in protected mode at specified address) if NOT successful Carry = 1 AH = 0FFh (error enabling address line 20)
Global Descriptor Table
Offset
Description
00h 08h 10h 18h 20h 28h 30h 38h
Uninitialized, Null descriptor (used by BIOS) Uninitialized, Made into GDT descriptor Uninitialized, IDT descriptor Uninitialized, DS descriptor Uninitialized, DS descriptor Uninitialized, SS descriptor Uninitialized, CS descriptor Uninitialized, Builds descriptor for BIOS CS
The program that enters protected mode must construct its own IDT. This IDT must not overlap the BIOS real-mode table and must handle all interrupts while the program is in protected mode. " NOTE:
The protected mode CS must reference the same memory as the CS from which this function is called, because execution continues with the address following the interrupt call. BH and BL must be multiples of 8. See Also: Functions AH=87h, AH=88h
5-56
PEN*KEYR 6400 Programmer’s Reference Guide
Page 167
BIOS Interrupt Support
SECTION 5
INT 15h, Function AH = 90h; Device Busy Loop
BIOS Implements a time-out while waiting for the specified device to respond. Hook this up as a multitasker to keep track of device ownership. On Entry: AH = 90h AL = Device type 00h = Fixed disk 01h = Diskette 02h = Keyboard 03h = PS/2 pointing device 80h = Network 0FCh = Hard disk reset (PS/2) 0FDh = Diskette driver motor start 0FEh = Printer ES:BX = Pointer to request block (If device type 80h – BFh)
On Return:
if successful: Carry = 1 ; wait was performed (I/O complete or time-out) if NOT successful: Carry = 0 if unsuccessful; no wait performed (driver must perform wait)
Type codes allocated as follows: 00h–7Fh Non-reentrant devices. OS must arbitrate access. 80h–BFh Reentrant devices. ES:BX points to a unique control block. C0h–FFh Wait-only calls, no complementary INT 15, fn91h call. See Also: Functions AH=91h, INT 13/AX=00h, INT 17/AH=00h, and INT 1A/AH=83h
PEN*KEYR 6400 Programmer’s Reference Guide
5-57
Page 168
SECTION 5
BIOS Interrupt Support
INT 15h, Function AH = 91h; Complete the Interrupt
BIOS Sets a device flag and completes the interrupt. Hook this as a multitasker with a requirement to keep track of device ownership. On Entry: AH = 91h AL = Device type 00h = Fixed disk 01h = Diskette 02h = Keyboard 03h = PS/2 pointing device 80h = Network 0FCh = Hard disk reset (PS/2) 0FDh = Diskette driver motor start 0FEh = Printer ES:BX = Pointer to request block (if device type 80h – BFh)
On Return:
AH = 00h Carry = Status flag if successful: Carry = 1 ; wait was performed (I/O complete or time-out) if NOT successful: Carry = 0 if unsuccessful; no wait performed (driver must perform wait)
See Also: Function AH=99h
5-58
PEN*KEYR 6400 Programmer’s Reference Guide
Page 169
BIOS Interrupt Support
SECTION 5
INT 15h, Function AH = C0h: Get System Configuration Parameters
BIOS Returns the address of the system configuration parameters. On Entry: AH = C0h
On Return:
if successful Carry = 0 AH = 00h (system model determined) ES:BX = Pointer to ROM system descriptor table if NOT successful Carry = 1 AH = 86h (could not determine system model; may not support call) Format of ROM Configuration Table
Offset
Size
Description
00h dword
02h 03h 04h 05h byte byte byte byte
Number of bytes following this word in table (normally, this is 16 bytes). Model (System ID byte) Submodel (Distinguishes between models) BIOS revision: (0=first release, 1=next 2,3,4, etc.) Feature byte 1 (See table #402) DMA channel 3 used by hard disk BIOS Second 8259 installed Real-time clock installed INT 15h, fn 04h called upon INT 09h Wait for external even supported (INT 15 fn 41h) used on Convertible; reserved on PS/2 systems extended BIOS area allocated at 640K Extended BIOS area allocated at 640K Bus is Micro Channel instead of PC System has dual bus (Micro Channel + ISA) Set to zero (reserved by IBM) Set to zero (reserved by IBM) Set to zero Set to zero (Award copyright here)
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 06h 07h 08h 09h byte byte byte byte
PEN*KEYR 6400 Programmer’s Reference Guide
5-59
Page 170
SECTION 5
BIOS Interrupt Support
INT 15h, Function AH = C1h: Return Extended BIOS Data Area Segment (EBDA)
BIOS Returns the EBDA. On Entry: AH = C1h
On Return:
if successful Carry = 0 AH = 00h ES = Pointer to segment address of EBDA if NOT successful Carry = 1 AH = 86h (no EBDA) CL = Resolution (see Function AX=C203h for details) DL = Sample rate (see Function AX=C202h for details) AH = Status of operation (see Function AX=C200h for details)
5-60
PEN*KEYR 6400 Programmer’s Reference Guide