
-------------------------------------------------------------------------------
*********************** WDOSX V.0.92 API overview *****************************
-------------------------------------------------------------------------------


-------------------------------------------------------------------------------
---------------------- INT 31H API (DPMI 0.9 spec.) ---------------------------
-------------------------------------------------------------------------------

Not supported so far:

- GET/SET EXCEPTION HANDLER:

             This is because I didn't need that.

             WDOSX, if running without DPMI, will report most exceptions by
             throwing out registers and stuff and terminate the program then
             (as we all know and enjoy :)

             As usual, exceptions occuring in either real- or V86- mode are
             not reported.

             Since the build-in exception handler is called via an interrupt
             gate, the stack has to be intact for proper exception handling.
             (C'mon, this is a DOS- extender, not an operating system!)

             Yet another one: CPU exceptions in DOS are evil, they should not
             occur in the first place. (Debugging is another issue...) 

- RAW MODE SWITCH, SAVE/RESTORE STATE AND STUFF

             Hate to say that again, but: I didn't need that as of today.
             There are, of course, raw mode switch procedures in the kernel
             and it wouldn't be a big deal to write the interface for them...
             Hmm... maybe next release.


- ALLOCATE SPECIFIC LDT DESCRIPTOR:

             Err... hmmm... this one will never get into WDOSX, because while
             running in RAW/XMS/VCPI mode, we do not have a LDT, everything
             is in the GDT, so the selectors specified for this function to
             be free actually aren't.

             Who cares?


-------------------------------------------------------------------------------
DPMI- 0.9- functions supported so far...
-------------------------------------------------------------------------------

LDT- MANAGEMENT:

0000	ALLOC LDT DESCRIPTORS
0001	FREE LDT DESKRIPTORS
0002	SEGMENT -> SELECTOR
0003	GET SELECTOR INCRMENT
0006	GET SEGMENT BASE
0007	SET SEGMENT BASE
0008	SET SEGMENT LIMIT
0009	SET ACCESS RIGHTS
000A	CREATE ALIAS
000B	GET DESCRIPTOR
000C	SET DESCRIPTOR

DOS- MEM:

0100	ALLOC DOS- MEM
0101	FREE DOS- MEM
0102	MODIFY DOS- MEM

INTERRUPTS:

0200	GET REALMODE INTERRUPT VECTOR
0201	SET REALMODE INTERRUPT VECTOR
0204	GET PM INTERRUPT VECTOR
0205	SET PM INTERRUPT VECTOR

TRANSLATION SERVICES:

0300	SIMULATE REAL MODE INTERRUPT
0301	CALL REALMODE PROCEDURE (RETF)
0302	CALL REALMODE PROCEDURE (IRET)
0303	ALLOCATE REALMODE CALLBACK
0304	FREE REALMODE CALLBACK

VERSION:

0400	GET DPMI VERSION

MEMORY MANAGEMENT:

0500	GET FREE MEM
0501	ALLOC MEM
0502	FREE MEM
0503	RESIZE MEM

VIRTUAL MEMORY MANAGEMENT:

0600	LOCK LINEAR REGION
0601	UNLOCK LINEAR REGION
0602	UNLOCK REALMODE REGION
0603	RELOCK REALMODE REGION
0604	GET PHYSICAL PAGE SIZE

DEMAND PAGING:

0702	MARK PAGE PAGEABLE
0703	DISCARD PAGE

PHYSICAL MEMORY:

0800	MAP PHYSICAL REGION

VIRTUAL ITERRUPTS:

0900	GET AND DISABLE VI STATE
0901	GET AND ENABLE VI STATE
0902	GET STATE

-------------------------------------------------------------------------------
------------------------- Extended DOS INT 21H API ----------------------------
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
21/09 - DOS- write string to console
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/39 - DOS- MKDIR
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/3A - DOS- RMDIR
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/3B - DOS- CHDIR
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/3C - DOS- create
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/3D - DOS- open
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/3F - DOS- read
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX
- DOS uses CX = bytes to read, WDOSX uses ECX
- DOS returns AX = bytes read, WDOSX returns EAX = bytes read

This means: YES! You _can_ read more than 64k at once!

-------------------------------------------------------------------------------
21/40 - DOS- write
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX
- DOS uses CX = bytes to write, WDOSX uses ECX
- DOS returns AX = bytes written, WDOSX returns EAX = bytes written

This means: YES! You _can_ write more than 64k at once!

-------------------------------------------------------------------------------
21/41 - DOS- delete
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX


-------------------------------------------------------------------------------
21/43 - DOS- get/set file attribute
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
21/47 - DOS- get current directory
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:SI, WDOSX uses DS:ESI

-------------------------------------------------------------------------------
21/56 - DOS- rename
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX
- DOS uses ES:DI, WDOSX uses ES:EDI

-------------------------------------------------------------------------------
21/5B - DOS- create new file
-------------------------------------------------------------------------------

DIFFERENCES WDOSX/DOS:

- DOS uses DS:DX, WDOSX uses DS:EDX

-------------------------------------------------------------------------------
INT21H     AX = FFFFH: RESIZE FLAT SEGMENT
-------------------------------------------------------------------------------

THIS IS A PROPRIETARY FUNCTION, NOT A DOS- FUNCTION!

ON ENTRY: EDX = NEW SIZE
RETURNS : CF CLEAR ON SUCCESS, CF SET: ERROR, NOTHING DONE

This one is needed because with INT 31H you cannot resize the segment you're
currently running in. Using this call, you can. But NOTE: This call assumes
to get called from your initial flat segment, don't call from anywhere else!

USAGE:

 mov ax,0ffffh
 mov edx,400000h           ;new size = 4 MB
 int 21h
 jc what_the_hell_happened ;should only occur if there's not enough memory
 mov esp,edx               ;adjust stack pointer on top of segment, if you
                           ;like (depends on the memory layout you're using)
_______________________________________________________________________________

Leipzig, Germany 1996/11/26
Wuschel a.k.a. Michael Tippach
