flat assembler
Message board for the users of flat assembler.
Index
> DOS > DPMI program under Win32&DOS |
Author |
|
Fenist 04 Mar 2004, 06:01
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 |
|||
04 Mar 2004, 06:01 |
|
Bitdog 08 Mar 2004, 09:37
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... |
|||
08 Mar 2004, 09:37 |
|
f0dder 08 Mar 2004, 15:16
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). |
|||
08 Mar 2004, 15:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.