flat assembler
Message board for the users of flat assembler.

Index > DOS > DPMI program under Win32&DOS

Author
Thread Post new topic Reply to topic
Fenist



Joined: 28 Feb 2004
Posts: 6
Location: Russia - Rostov on Don
Fenist
Need to code program, works under WIN 9X/NT & DOS
Optimal way - dos DPMI.
Need:
1) DosExtender for FASM - may use "dos32"
2) Example of allocation memory under dpmi - allocate 2 MB, read and write something. I already have PM examples from Forum, and mass other.

Sorry for terrible english. My native language is Russian



[url]mailto:kolia_85@rambler.ru[/url]
Post 01 Mar 2004, 07:15
View user's profile Send private message Reply with quote
Fenist



Joined: 28 Feb 2004
Posts: 6
Location: Russia - Rostov on Don
Fenist
Did anybody have experience on DPMI programing? I have read many references, but no one of them does not complete: they only about RAW PM - working on DOS without HIMEM.SYS or EMM386. But i want to code in win32 AND dos - programs that work on ALL platforms. Coding with DosExtender - is best way (i think), but i need some examples of DPMI programing. Best code i get from Internet - from Dieter Pawelczak's PASS32 assembler - with bult-in Extender
=============================================
3.27 Function 0501h - Allocate Memory Block

Allocates a block of extended memory.

Function call: INT 31h
AX = 0501h
BX:CX = memory size to allocate in bytes

Results:
if successful:
carry flag clear
BX:CX = linear address of allocated memory block (*)
SI:DI = memory handle

if failed:
carry flag set
AX = error code

Notes:
(*) You can easily allocate an descriptor for the linear address, see example

Example:
mov ax,0 ;Funktion 0
mov cx,1 ;Allocate 1 Descriptor
int 31h
mov MemDesk,AX
mov ax,0501h ;Allocate Memory
mov cx,0
mov bx,1 ;010000h Bytes of Memory
int 31h ;DPMI CALL
jc TooLessMemory
mov AX,0007h ;Function 7:Set Basis Address
mov BX,MemDesk
mov dx,cx ;Low Part of Linear Address
mov cx,bx ;upper Part of Linear Address
int 31h ;DPMI CALL
mov BX,MemDesk
mov ax,0008h ;Function 8:Set Limit of descriptor
mov cx,0ffffh
mov dx,0
int 31h ;set Limit
mov BX,MemDesk
mov fs,BX ; FS selector to 64K XMS Memory Location!
=============================================
But when i try to read or write on this selector - program fail. GP - is wery bad thing. May be problem in wrong rivelegies levels? I seat on this code for 6 month. Dont give to dead. Please HEELP!
kolia_85@rambler.ru

_________________
Sorry for my english.
SAR:ALU
Post 04 Mar 2004, 06:01
View user's profile Send private message Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog
Win interrupt functions, INT 71h ? has a LFN Long File Name checking interrupt.
I made a simple .COM file that returns an errorlevel to a batch file according to which OS is running, (Win or DOS) and
the batch file loads the DPMI if DOS 7.x is running,
Win doesn't need a DPMI loaded to use Fasm DOS if Win98 is running.
If you want the LFN checker (maybe even source code included in this version?)
http://bitdog.home.att.net/files/fasmenv.zip

Stuff I made is free to use in any way you want...
Post 08 Mar 2004, 09:37
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
You might want to have a look at WDOSX:
http://michael.tippach.bei.t-online.de/wdosx/

It's pretty old by now, but it worked very well for me back in the dos extending days. It works under both dos and windows (iirc it supports raw, himem.sys, emm386 and such), handles a couple of fileformats (including PE), and even has limited win32 API emulation.

If you want a more "raw" dos extender, see if you can find Tran's PMODE somewhere.

There are probably better extenders available by now, I saw something used in the dos version of the kaspersky antivirus scanner, I think the dos extender used is publicly available (and was written by a russian - I could be wrong, though).
Post 08 Mar 2004, 15:16
View user's profile Send private message Visit poster's website 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


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.