Int 21/AX=4402h

Prev Next Ralf Interrups Categories Contents

------

Qualitas 386MAX v6.00+ - IOCTL INPUT - GET STATE

AX = 4402h
BX = file handle for device "386MAX$$"
CX = number of bytes to read
DS:DX -> BYTE 03h followed by 386MAX state buffer (see #01467)

Return:
CF clear if successful buffer at DS:DX+1 filled AX = number of bytes actually copied CF set on error AX = error code (01h,05h,06h,0Dh) (see #01680 at AH=59h/BX=0000h)

Notes: If the value given in CX is less than the size of the state record (5Ah for v6.01, 66h for v7.00), only a partial state record will be returned. The state is 40h bytes for 386MAX (actually ASTEMM) v2.20 ("386MAX$$" did not exist yet, use "QMMXXXX0" and then "EMMXXXX0" instead) and 56h bytes for v5.11.. To invoke 386MAX API functions, push DX onto the stack, load DX with the word at offset 25h in the returned state, load all other registers as needed for the desired function, and execute an OUT DX,AL or OUT DX,AX; DX will be set to the pushed value on return if it is not otherwise modified by the API function. For safety, in case a function is not supported or 386MAX is not present, SP should be saved and restored around the API call.. Windows 3.1 Standard mode, LAN Manager, and Windows for Workgroups all use the 386MAX API; LAN Manager and Windows for Workgroups reportedly make some calls incorrectly

See Also: AX=4403h/SF=03h"386MAX" - INT 67/AH=3Fh

Format of 386MAX v6.01+ state: Offset Size Description (Table 01467) -1 BYTE (call) 03h 00h 6 BYTEs signature "386MAX" 06h 4 BYTEs version string "N;NN" or "N.NN" (i.e. "6;01" for v6.01) (';' by default; apparently changed to a period when 386MAX has linked high RAM into DOS's memory chain) 0Ah WORD segment of low-memory portion of 386MAX.SYS 0Ch 2 BYTEs ??? 0Eh WORD segment of ??? memory block or 0000h 10h WORD bit flags 1 (see #01468) 12h WORD starting address of video memory in KB 14h 2 BYTEs ??? 16h WORD total high DOS memory in KB 18h 2 BYTEs ??? 1Ah WORD available shared memory in KB 1Ch WORD KBytes extended memory used by 386MAX 1Eh 2 BYTEs ??? 20h WORD total extended memory in KB 22h WORD IO port to write (OUT DX,AL) to invoke 386MAX INT 15 functions 24h WORD IO port to write (OUT DX,AL) to invoke 386MAX API functions (see #01481) 26h WORD ??? (depends on DOS version) 28h WORD size of ??? in paragraphs 2Ah DWORD machine type (see #01476) 2Eh DWORD -> first DOS memory control block 32h WORD system configuration flags (see #01469) 34h WORD debugging flags 1 (see #01470) 36h WORD debugging flags 2 (see #01471) 38h 2 BYTEs ??? 3Ah WORD segment of first MCB in high memory chain 3Ch WORD feature flags 1 (see #01473) 3Eh WORD feature flags 2 (see #01474) 40h WORD feature flags 3 (see #01475) 42h WORD segment of first 386MAX control block??? (see #01477) 44h WORD amount of memory to report available on INT 15/AH=88h 46h 4 BYTEs ??? 4Ah WORD number of K at start of address space swapped with fast extended memory (SWAP= parameter) 4Ch 2 BYTEs ??? 4Eh WORD segment address of ??? 50h WORD debugging flags 3 (see #01472) 52h DWORD old INT 21h 56h DWORD pointer to 386MAX's EMS (INT 67h) handler ---386MAX v7.00--- 5Ah DWORD KB of extended memory managed by 386MAX 5Eh DWORD bytes of extended memory (EXT= parameter) 62h 4 BYTEs ???

Bitfields for 386MAX bit flags 1: Bit(s) Description (Table 01468) 1 ??? 2 allow A20 to be enabled/disabled??? 3 ??? (cleared by calling INT 67 functions or starting MSWindows) 4 high RAM present??? 5 386MAX in AUTO mode 6 386MAX enabled 7 386MAX is providing EMS services 8 ??? (affects API function 08h) 9 A20 gate closed (A20 disabled) (see INT 15/AX=2402h) 10 Weitek support enabled 11 ??? 12 ROMs not shadowed??? 13 QPMS has been used 14 ??? 15 ???

Bitfields for 386MAX system configuration flags: Bit(s) Description (Table 01469) 1 ROM compressed??? 3 ??? 5 386MAX loaded into high memory 6 Microchannel bus 7 Weitek math coprocessor detected 9 ??? (also generates INT 01 on ??? and INT 03 on ???) 11 PC/XT (thus only single 8259 interrupt controller present, DMA only in 1st megabyte, etc) 13 LMLTOP= specified 14 enable A20 control??? 15 ???

Bitfields for 386MAX debugging flags 1: Bit(s) Description (Table 01470) 0 DEBUG=LED 1 DEBUG=X67 2 DEBUG=INV 3 DEBUG=EMSPTED 4 DEBUG=JMP 5 DEBUG=CALL 6 DEBUG=HLT 7 DEBUG=PMR 8 DEBUG=CR3 9 DEBUG=CAPS or DEBUG=INT 10 DEBUG=RC 11 DEBUG=ROM 12 DEBUG=XM 13 DEBUG=SOR 14 DEBUG=XR 15 DEBUG=EMSERR (generate INT 01 on returning error from EMS call)

Bitfields for 386MAX debugging flags 2: Bit(s) Description (Table 01471) 0 DEBUG=ROMSWAP 1 DEBUG=UNSHADOWROM 2 DEBUG=COMPROM 3 DEBUG=DPMIPHYS 4 DEBUG=ALLROM 5 DEBUG=VMS 6 DEBUG=XMS (generate INT 01 on XMS calls) 7 DEBUG=I06 8 DEBUG=VCPI 9 DEBUG=XDMA 10 DEBUG=X09 13 DEBUG=I67 (generate INT 01 on every INT 67 call) 14 DEBUG=EVM (generate INT 01 on entering V86 mode) 15 DEBUG=EMSSAVE or DEBUG=VDS

Bitfields for 386MAX debugging flags 3: Bit(s) Description (Table 01472) 10 DEBUG=EPM 12 DEBUG=ABIOS 13 DEBUG=XMSPTED 14 DEBUG=TIME 15 DEBUG=SCRUB

Bitfields for 386MAX feature flags 1: Bit(s) Description (Table 01473) 1 Weitek present 2 no DPMI services 3 NODMA 4 TERSE 5 NOROM 6 NOPARITY 8 NOFLEX (IGNOREFLEXFRAME) 11 don't create UMBs 12 don't backfill below video memory (NOLOW) 13 FRAME= specified 14 EXT= specified 15 NOEMS, allow prior expanded memory manager to provide EMS

Bitfields for 386MAX feature flags 2: Bit(s) Description (Table 01474) 0 UNSHIFT specified (FORCEA20 disabled) 1 NOXRAM 2 NOSCSI specified 3 SCREEN specified 4 enabled EISADMA 5 slow DMA 6 RESETKEYB specified 7 ??? 9 TOP384 10 ??? 11 NOWARMBOOT 12 USE= specified 13 ROM= specified

Bitfields for 386MAX feature flags 3: Bit(s) Description (Table 01475) 0 Windows3 support enabled 1 SHADOWROM 2 don't compress ROM (NOCOMPROM) 3 ??? (related to PRGREG=) 4 ??? (related to PRGREG=) 5 SHADOWRAM 6 DOS4 specified 7 NOLOADHIGH 8 NOPULSE 11 FORCEA20 12 DMA buffer enabled 13 NOSCRUB 15 NOFRAME

Bitfields for 386MAX machine type: Bit(s) Description (Table 01476) 12 Amstrad 13 Epson 14 Zenith Data Systems 15 "ASEM" 16 NEC 17 "HPRS" model codes 69h and 6Ah 18 Dell 19 "CA" 20 ITT (Xtra Business Systems/Alcatel) 21 Toshiba 5100 22 Olivetti 23 Quadram Quad386 (BIOS model FEh, submodel A6h) 24 Tandy??? 25 AST 386 26 INBOARD, ??? version 27 INBOARD, ??? version 28 INBOARD, ??? version 29 "HPRS" 30 Compaq 386 31 JET386

Format of 386MAX control block: Offset Size Description (Table 01477) 00h WORD segment of next block (FFFFh if last) 02h WORD segment of previous block (FFFFh if first) 04h 12 BYTEs filename 10h WORD resident size in paragraphs 12h WORD environment size??? 14h WORD real prsent environment size + 1 (0000h if ENVSAVE used) 16h 2 BYTEs ??? 18h DWORD initial size or SIZE=n in 386LOAD commandline 1Ch DWORD SIZE=-1 ??? 20h DWORD SIZE= ??? 24h BYTE PRGREG= if specified, else FFh 25h BYTE ENVREG= if specified, else FFh 26h BYTE FlexFrame (00h not present, 01h present) 27h 3 BYTEs ??? 2Ah BYTE GROUP= or 00h if not present 2Bh BYTE ??? 2Ch WORD PSP

Format of 386MAX high memory info record: Offset Size Description (Table 01478) 00h WORD segment address of memory region 02h WORD size of memory region in paragraphs 04h BYTE type or flags??? 00h if locked out 02h if EMS page frame 04h if high RAM 42h if ROM 05h BYTE ???

Format of 386MAX ROM shadowing record: Offset Size Description (Table 01479) 00h WORD logical start segment of ROM??? (may be used by BlueMAX when it squeezes together the ROMs to make room) 02h WORD physical start segment of ROM 04h 2 BYTEs ??? 06h WORD size of shadowed ROM in paragraphs 08h 2 BYTEs ??? 0Ah WORD flags

bit 15:
Shadowing enabled for this ROM???

bit 14:
???

bit 13:
???

bit 12:
???

bit 10:
???

(Table 01480) Values for 386MAX memory type: 00h unused by EMS 01h DOS 04h page frame overlapping ROM??? 80h high memory 84h page frame??? 87h video ROM???

Note: The type may be 00h (unused) if the 16K page is split among different uses (such as ROM and high RAM)

(Table 01481) Call 386MAX API (via OUT DX,AL) with:.

STACK:
WORD value for DX. AH = 00h unused

Return:
AH = 84h (unsupported function). AH = 01h get high memory information ES:DI -> buffer for array of high memory info records (see #01478)

Return:
CX = number of records placed in buffer. AH = 02h get shadowed ROM info ES:DI -> buffer for array of ROM shadowing records (see #01479)

Return:
CX = number of records placed in buffer. AH = 03h get 386MAX state ES:DI -> 90-byte buffer for state (see #01467)

Return:
AH = 00h (successful) buffer filled. AH = 04h get memory types??? ES:DI -> buffer for memory type info (array of bytes, one per 16K page) (see #01480)

Return:
CX = number of bytes placed in buffer. AH = 05h get page table entries AL = A20 control (00h enable A20 first, 01h leave unchanged) CX = buffer size in bytes (0000h = enough for all memory from given start to end of memory managed by 386MAX) SI = first K to report (rounded down to 4K page) ES:DI -> buffer for returned page table entries

Return:
CX = number of bytes returned (four per 4K page) ES:DI buffer filled. AH = 06h get memory speed info ES:DI -> buffer for memory speed records (see #01482)

Return:
AH = 00h (successful) CX = number of bytes placed in buffer

Note: This function can take over a second to execute. AH = 07h map/unmap multiple handle pages DX = EMS handle (on stack)

STACK:
DWORD -> EMS mapping record

Return:
AH = status (00h,80h,83h,8Ah,8Bh) Format of EMS mapping record: Offset Size Description 00h WORD function 0000h use physical page numbers 0001h use segment addresses 02h WORD EMS handle 04h WORD number of mapping entries following 06h 2N WORDs logical page number and physical page/segment logical page FFFFh means unmap physical page

See Also: INT 67/AH=50h. AH = 08h "EMM2_GOREAL" check whether possible to disable 386MAX AL = ??? (00h or nonzero)

Return:
AH = status (00h OK, A4h not possible at this time)

Note: If AL=00h, this function always returns success. AH = 09h toggle Bit Flags 1 flags BX = bitmask of bit flags 1's flags to toggle (see #01468)

Return:
AH = 00h (successful)

Note: Enables A20 first. AH = 0Ah toggle Debugging Flags 1 flags BX = bitmask of Debugging Flags 1's bits to toggle (see #01470)

Return:
AH = 00h (successful)

Notes: Enables A20 first does ??? if bit 3 on after specified bits are toggled. AH = 0Bh toggle Debugging Flags 2 flags BX = bitmask of Debugging Flags 2's bits to toggle (see #01471)

Return:
AH = 00h (successful)

Note: Enables A20 first. AH = 0Ch toggle feature flags 3 BX = bitmask of feature flags 3's bits to toggle (see #01475)

Return:
AH = 00h (successful)

Note: Enables A20 first. AH = 0Dh specify 386MAX high-memory location BX = segment address of high-memory real-mode portion of 386MAX CX = current segment of real-mode stub???

Return:
AH = status (00h successful) ???. AH = 0Eh CRT controller register virtualization AL = subfunction 00h allow access to CRTC I/O ports 03B4h/03B5h, 03D4h/03D5h 01h trap accesses to CRTC I/O ports. AH = 0Fh reboot system

Return:
Never. AH = 10h unused

Return:
AH = 84h (unsupported function). AH = 11h get high memory information ES:DI -> 96-byte buffer for high memory info

Return:
AH = 00h (successful) ES:DI buffer filled

Notes: Each byte in buffer contains bit flags for a 4K page in the A000h-FFFFh region

bit 0:
Page is writeable

bit 1:
Physical address same as linear address

bit 2:
EMS page frame

bit 6:
Page is part of the QPMS window this function can take over a second to execute, because it does a 128K read for each page in an attempt to flush any RAM cache the system may have. AH = 12h shadow RAM mapping AL = subfunction 00h unshadow ROMs (except page FFh if NOWARMBOOT set) 01h map shadow RAM into ROM regions???

Return:
AH = 00h (successful) if AL=00h or 01h AH = 8Fh otherwise. AH = 13h shadow RAM page protection AL = subfunction 00h set all shadowed ROM 4K pages to read-only 01h set all shadowed ROM 4K pages to read-write

Return:
AH = 00h (successful) if AL=00h or 01h AH = 8Fh otherwise. AH = 14h get Programmable Option Select info??? ES:DI -> 54-byte buffer for POS data???

Return:
AH = 00h if successful AH = A4h on error

Note: The buffer consists of nine 6-byte fields; the first eight for slots 1-8, the last for the system board. AH = 15h ??? ???

Return:
???. AH = 16h get 386MAX memory usage screen ES:DI -> buffer for memory info display CX = size of buffer in bytes

Return:
ES:DI buffer filled with '$'-terminated string (if large enough to hold entire usage screen)

Note: The screen is 0303h bytes in v7.00. AH = 17h Windows 3 startup/termination AL = subfunction 00h Windows3 initializing DX (on stack) = Windows startup flags DI = Windows version number (major in upper byte) ES:BX = 0000h:0000h DS:SI = 0000h:0000h

Return:
CX = 0000h if OK for Windows to load <> 0 if Windows should not load ES:BX -> startup info structure DS:SI -> Virtual86 mode enable/disable callback 01h Windows3 terminating ES:BX -> ??? DX (on stack) = Windows exit flags

Return:
???. AH = 18h QPMS (Qualitas Protected Memory Services) AL = subfunction 00h get QPMS configuration

Return:
BX = starting segment of QPMS memory window CX = number of 4K pages reserved for QPMS??? DX = number of 4K pages in QPMS window??? 01h map QPMS memory page??? BX = 4K page number within memory reserved for QPMS??? CL = 4K page number within QPMS memory window??? 02h mark all QPMS memory read-only 03h mark all QPMS memory read-write

Return:
AH = status (00h,8Ah,8Bh,8Fh). AH = 19h get linear address for physical address EDX = physical address (low word on stack)

Return:
AH = status 00h successful EDX = linear address at which physical address may be accessed 8Bh physical address currently not addressable

Note: Enables A20 first. AH = 1Ah set page table entry EDX = new page table entry (low word on stack) ESI = linear address of page to map (bits 0-11 clear)

Return:
AH = status (00h,8Bh)

Note: Enables A20 first. AH = 1Bh get ???

Return:
AH = status BX = ??? CX = number of ??? EDX = physical address of ???. AH = 1Ch get original interrupt vector AL = interrupt vector (00h-7Fh)

Return:
AH = 00h (successful) EDX = original vector before 386MAX loaded (segment in high word, offset in low word)

Note: No range checking is performed; requests for INTs 80h- FFh will return random values. AH = 1Dh display string??? SI = ???

Return:
AH = 00h (successful) ???

Note: This function appears to be broken in v7.00. AH = 1Eh get memory info ES:DI -> memory info (see #01483)

Return:
???. AH = 1Fh get DPMI host information

Return:
AX = 0000h if successful BX = DPMI flags (see #03152 at INT 31/AX=0400h) CL = CPU type (02h = 80286, 03h = 80386, etc.) DX = DPMI ver supported (DH=major, DL=2-digit minor) SI = ??? ES???:DI -> ???

Note: NOP if NODPMI switch specified. AH = 20h (v7.00) get ??? AL = index of ???

Return:
EDX = ??? for specified ???. AH = 21h (v7.00) STACKS support AL = 00h get STACKS parameters

Return:
BX = ??? (0060h for v7.00) CX = number of stacks for hardware interrupts DX = size of each stack in bytes SI = ??? (low and high bytes are separate values) DI = ??? (low and high bytes are separate values) low byte = logical page number set by subfn 02h ES = ??? AL = 01h set ??? "EMM2_DSTKS" EBX = ??? ECX = ??? AL = 02h set ??? BL = logical page number for ??? (00h-03h)

Return:
AH = status (00h,8Ah). AH = 22h (v7.00) call ??? for every load module AL = which function to call 00h call ??? else call ????

Return:
AH = 00h

Note: If AL=00h, calls the protected-mode function pointed at by the DWORD at offset 22h from the start of each module installed by a LOAD= directive; if AL<>00h, it calls the function pointed at by the DWORD at offset 28h of the load module. AH = 23h (v7.00) ??? AL = 00h set ??? BL = ???

Return:
AH = 00h or unchanged (depending on ???) AL = 01h set ??? BL = ??? BH = ??? CX = ??? DX = ??? (on top of stack)

Return:
AH = status (00h if successful, 8Fh once table full)

Note: This call adds one entry to an internal table on each call, until the table is full AL = 02h get ??? CX = size of buffer ES:DI -> buffer for ??? (60 bytes total data)

Return:
CX = number of bytes actually returned

Note: Returns the array storing the values set with AX=2301h Format of one entry in array: Offset Size Description 00h BYTE ??? (BL from subfn 01h) 01h WORD ??? (CX from subfn 01h) 03h BYTE ??? (BH from subfn 01h) 04h WORD ??? (DX from subfn 01h) AL = 03h set ??? name/path ES:DI -> buffer containing ASCIZ ??? AL = 04h get ??? ES:DI -> buffer for ASCIZ ???

Note: The ASCIZ string for subfunctions 03h and 04h does not appear to be used by 386MAX, and may serve merely for communication between two other Qualitas programs. AH = 24h (v7.00) high memory control AL = 00h get high memory state

Return:
BX = current state 00h high memory removed from DOS memory chain 01h high memory included in DOS memory chain AL = 01h set high memory state BX = new state 00h high memory removed from DOS memory chain 01h high memory included in DOS memory chain else

Return:
??? (error, but return varies according to ???). AH = 25h (v7.00) remove high RAM from DOS memory chain. AH = 26h (v7.00) ??? BX = ??? CX = ??? SI = ??? DI = ???

Return:
AH = status BX = ??? CX = ???. AH = 27h (v7.00) ??? AL = 00h get ???

Return:
BX = number of paragraphs for ??? AL = 01h ??? BX = ??? ES??? = ??? AL = 02h ??? ??? AL = 03h ??? CX = ??? DX = ??? ES??? = ???

Return:
???. AH = 28h (v7.00) get ???

Return:
AH = status (00h,8Fh) (see #03648 at INT 67/AH=40h) if AH=00h, CX = ??? DX = ???. AH = 29h (v7.00) get ???

Return:
AX = ???. AH = 40h-5Dh EMS services (see INT 67/AH=40h, etc.). AH = DEh VCPI services (see INT 67/AX=DE00h, etc.)

Return:
AH = status (as for EMS INT 67 calls) 00h successful 80h internal error 81h hardware malfunction 83h invalid handle 84h undefined function 8Ah invalid logical page nuber 8Bh illegal physical page number 8Fh undefined subfunction A4h access denied etc. STACK popped (value placed in DX if no specific return value for DX)

Format of 386MAX memory speed record: Offset Size Description (Table 01482) 00h DWORD page table entry for 4K page 04h WORD number of microticks (840ns units) required for REP LODSD of entire 4K page

Format of 386MAX memory info [array]: Offset Size Description (Table 01483) 00h DWORD linear start address 04h DWORD size in bytes 08h WORD XMS handle (if next byte = 04h) ??? (if next byte = 05h) ??? (if next byte = 06h) ??? (if next byte = 13h) ??? (if next byte = 14h) ??? (if next byte = 15h) ??? (if next byte = 23h) ??? (if next byte = 24h) ??? (if next byte = 26h) else unused 0Ah BYTE type 00h = ???, 01h = VDISK, 02h = INT 15h extended memory, 03h = ??? extended, 04h = XMS handle's memory, 05h = ???, 06h = ???, 07h = ???, 08h = ???, 09h = ???, 0Ah = ???, 0Bh = ???, 11h = ???, 12h = ???, 14h = ???, 15h = ???, 19h = ???, 1Ah = ???, 1Bh = ???, 1Ch = ???, 1Dh = ???, 1Eh = ???, 1Fh = ???, 20h = ???, 21h = ???, 23h = ???, 24h = ???, 26h = ??? 0Bh BYTE ??? (00h for types 00h-03h, 07h-0Bh, 19h-21h; 80h for types 04h/13h-15h/23h-26h; ??? for type 05h)

Category: Memory Management - Int 21h - Q

------

Prev Next Ralf Interrups Categories Contents