flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > DOS > DPMI help

Author
Thread Post new topic Reply to topic
ring0



Joined: 14 Mar 2005
Posts: 15
Location: Australia
DPMI help
I decided to have a go at DPMI. I compiled and executed the example code useDPMI without any problem. I understood that I would have 4GB segments and that I would be able to access anything above the base address however if I insert this simple code in segment main I get a page fault.


Code:

mov    esi0x000F0000
mov    eax, [esi]




I understand (I think)
logical address -> segmentation unit -> linear address -> paging unit -> physical address.

I am using cwsdpr0, and also turned off paging in CR0 and the error persists. There is something I don't understand here and I would appreciate a simple explanation.

Thanks
Post 02 Jun 2015, 07:34
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 208
Location: film "CandyMan" directed through Bernard Rose
when you turned off paging in CR0 and the error persists it mean that there is a general protection fault instead of paging fault
perhaps a segment limit was exceeded

Code:

        mov     esi,0x000F0000
        mov     eax,[fs:esi]





Code:

        mov     esi,0x000F0000
        mov     eax,ds
        lsl     eax,ax
        cmp     eax,esi
        mov     eax,0
        ja      @F
        mov     al,[esi]
@@:



_________________
smaller is better
Post 02 Jun 2015, 16:08
View user's profile Send private message Reply with quote
ring0



Joined: 14 Mar 2005
Posts: 15
Location: Australia
Hello Candyman

I did load and check the segment limit as suggested - it is 4GB. Page fault is what is reported by the DPMI host.

Could someone who uses DPMI please respond?
Post 03 Jun 2015, 10:44
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1907
> Could someone who uses DPMI please respond?

Give complete info ... complete code, and shot of the crash screen from HDPMI32.
Post 23 Jun 2015, 17:23
View user's profile Send private message Reply with quote
ring0



Joined: 14 Mar 2005
Posts: 15
Location: Australia
Hello DOS386,

Sorry to take some time to respond. Please find attached source code - just a small variation from the FASM example useDPMI. The line which causes the error is marked in the source - near to the bottom of the code.

I am using CWSDPMI, specifically CWSDPR0.exe with FreeDOS - no drivers loaded. I do not have HDPMI32 - unable to download from Japeth.

Screen dump - I will just tell you what it says:

Hello from protected mode!
Page Fault cr2=0011e670 @ eip=17; flags=3246
eax=0000,0200 ebx=0002,0064 ecx=0000,ffff edx=bfe9,ff0a
esi=000f,0000 edi=0000,0064 ebp=0000,091e esp=0000,1002
cs=ac ds=b4 es=b4 fs=b4 gs=b4 ss=a4 error=0000


Description:
Download
Filename: FASM_useDPMI.asm
Filesize: 1.67 KB
Downloaded: 20 Time(s)

Post 27 Jun 2015, 08:38
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 208
Location: film "CandyMan" directed through Bernard Rose
in HDPMI32 everything is acting correctly, and in 32rtm the mistake still is appearing
in CR2 there is linear address of page fault (0xF0000+(Main shl 4)) is above 1MB
JAPHETH's side not respond, try download HDPMI by this address: http://web.archive.org/web/www.japheth.de

_________________
smaller is better
Post 27 Jun 2015, 14:16
View user's profile Send private message Reply with quote
ring0



Joined: 14 Mar 2005
Posts: 15
Location: Australia
Hello CandyMan
Thankyou for taking the time to test under HDPMI and thankyou for the link - I shall get HDPMI but I would really like to know about the issue with CWSDPMI if anyone here knows the answer please share.
Post 27 Jun 2015, 22:51
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1907
> would really like to know

0. CWSDPR0.exe gives you Ring0, but paging is still on (it is always on with CWSDPMI), and you still risk PF's

1. segment limit is 4 GiO, so you can't get a GPF due to segment limit

2. you simply forgot to hog your memory before reading from it Wink

3. if you want to access physical memory, you must map it before

4. there is no official way to hog physical memory with D.P.M.I.
Post 12 Sep 2015, 11:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.