Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
x86Novice(R)

17.03.2013, 01:14
 

File Reading AH=3Fh, int 21h under DPMI not working (Developers)

Hello Everyone,
Sorry if this is an old age problem, searched many threads but unable to find anything related. My work environment is running MS-DOS 7, NASM (Ver 2.10.07) & HDPMI32 (ver 3.17) , having problem with loading a file's content to a buffer above 1MB, i.e
.
.
.
mov AH, 3Fh ;Read from file
mov BX, word [DS:FileHandle] ;File successfully Opened prior to this
mov ECX, 1000h ;Read 4096 Bytes from File
mov EDX, 300000h ;Buffer to store 1000h bytes to.
int 21h

.
.

Compiled Ok but hangs when executed with HDPMI32 loaded or otherwise.

I thought HDPMI32 would somehow intercept int 21h/AH=3F in protected mode and accept 32bit addressing unlike its 16bit counterpart ?
Would appreciate any suggestions, thanks for reading.

NOTE: Also tried other DPMIs to no avail.

Japheth(R)

Homepage

Germany (South),
17.03.2013, 02:45

@ x86Novice

File Reading AH=3Fh, int 21h under DPMI not working

> Hello Everyone,
> mov AH, 3Fh ;Read from file
> mov BX, word [DS:FileHandle] ;File successfully Opened prior to this
> mov ECX, 1000h ;Read 4096 Bytes from File
> mov EDX, 300000h ;Buffer to store 1000h bytes to.
> int 21h

>
> I thought HDPMI32 would somehow intercept int 21h/AH=3F in protected mode

Yes, it does. But the address in DS:EDX must point to a valid buffer. "Valid" in this context means: either an address in the first MB ( conventional memory ) or the address of a - committed - memory block allocated with one of the DPMI memory functions. Address 300000h does not actually look like belonging to this set.

---
MS-DOS forever!

DOS386(R)

27.03.2013, 09:01

@ x86Novice

File Reading AH=$3F, INT $21 under DPMI | True DPMI

> Sorry if this is an old age problem

it is

> I thought HDPMI32 would somehow intercept int 21h/AH=3F in protected mode

Every DPMI host does "intercept".

> and accept 32bit addressing unlike its 16bit counterpart ?

You can have ECX >= 64 KiB and EDX > 1 MiB but only with True DPMI (HDPMI: YES | WATCOM extenders: YES | CWSDPMI : NO), but the buffer must be valid ( see above and http://board.flatassembler.net/topic.php?t=6384 ).

---
This is a LOGITECH mouse driver, but some software expect here
the following string:*** This is Copyright 1983 Microsoft ***

Back to the board
Thread view  Mix view  Order
15112 Postings in 1359 Threads, 247 registered users, 13 users online (0 registered, 13 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum