[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DPMI question
Hi John,
I saw your post on the DPMI sometime ago. I thought you may be able
to answer one of my questions. I have a 486 mother board, with Award
modular bios in there. I have PC-DOS running on it, and then it had
windows 95 installed. Now when I am doing a DOS only program, I use
the following code (from DPMI spec 0.9) after the next para:
The problems I see is that the values returned by AX flags is not zero
which means DPMI may not be supported. I am little confused as to why?
Did Windows95 did anything to DOS? Also, do you see any problems with
the code. I will really appreciate your time.
Thanks a lot.
Rajiv
---------------------------listing-----------------------------
Example Code
;
; Get the entry point address and save it
;
mov ax, 1687h
int 2Fh
test ax, ax
jnz Cant_Enter_PMode
mov [PMode_Entry_Seg], es
mov [PMode_Entry_Off], di
;
; Allocate memory for use by DOS extender if necessary
; NOTE: This code assumes that the program has already
; shrunk its memory block so that the DOS
; memory allocation call will work
;
test si, si
jz Enter_PMode_Now
mov bx, si
mov ah, 48h
int 21h
jc Cant_Enter_PMode
mov es, ax
; Enter protected mode as a 16-bit program
;
Enter_PMode_Now:
xor ax, ax
call DWORD PTR [PMode_Entry_Off]
jc Cant_Enter_PMode
;
**** I want to access PCI device in memory mapped mode
*********************My added code to above example code***********
****DWORD dwPhysical is physical address of the PCI device (from BAR)
****DWORD dwLength is length of the memory map
push di
push si
mov bx, WORD PTR [dwPhysical+2] ; Load arguments.
mov cx, WORD PTR [dwPhysical]
mov si, WORD PTR [dwLength+2]
mov di, WORD PTR [dwLength]
mov ax, 800h
int 31h ; Issue DPMI call.
jnc short fine_return
xor bx, bx ; zero out return
mov cx, bx ; regs on error
fine_return:
mov WORD PTR [dwLinear+2], bx ; Return value.
mov WORD PTR [dwLinear], cx
pop si
pop di
---------------------------------------------------------
Get Your *Web-Based* Free Email at http://www.hotmail.com
--------------------------------------------------------- 4 Œ y