flat assembler
Message board for the users of flat assembler.

Index > DOS > How to program with CWSDPMI?

Author
Thread Post new topic Reply to topic
Cas



Joined: 26 Feb 2004
Posts: 82
Location: Argentina
Cas
Guys. I've found lots of lists with the different DPMI functions and I have gotten an idea, yes... but I still don't get the main point. How am I supposed to use a DPMI program? The example that comes with FASM is too short. I need something that shows me how to make a complete program (a bitmap editor, for example) that uses the DPMI in its simplest way.
Say I want to make, for example, a program that loads a whole WAV file (50 megs) into memory and then executes it (I know that is not optimal at all, but it's an example). What should the code look like? Which functions should I call first?
I will appreciate your help. Thanks in advance! Smile

_________________
Ā«Earth is my country; science is my religionĀ» - Christian Huygens
Post 04 May 2005, 05:59
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I do not know much about DPMI, but "Dex4u" is like a 32bit pmode Dos, it has a full set of function you can call from pmode, but the best thing is you can uses upto 4GB of memory.
You can load programs from a floppy or cd.
Heres a hello world" example:
Code:
;=========================================================;; Test calltable                                 18/03/05 ;;---------------------------------------------------------;; By Dex4u.                                               ;;                                                         ;; Here is a simple "hello world" program.                 ;; for Dex4u, using the calltable functions.               ;; To assemble use fasm as follows                         ;; c:\fasm hello.asm hello.dex                             ;;=========================================================;use32        ORG   0x200000          ; where our program is loaded to        jmp   start             ; jump to the start of program.        db    'DEX1'            ; We check for this, to make shore it a valid Dex4u file.msg1:   db 'Hello world! ',13,0 ;----------------------------------------------------; ; Start of program.                                  ; ;----------------------------------------------------;start:        mov   ax,18h        mov   ds,ax        mov   es,ax ;----------------------------------------------------; ; Get calltable address.                             ; ;----------------------------------------------------;        mov   edi,Functions     ; this is the interrupt        mov   al,0              ; we use to load the DexFunction.inc        mov   ah,0x0a           ; with the address to dex4u functions.        int   40h  ;----------------------------------------------------; ; Try print string.                                  ; ;----------------------------------------------------;        mov   esi,msg1          ; this point's to our string.        call  [PrintString]     ; this call the print function.        call  [WaitForKeyPress] ; is the wait for keypress function.        ret                     ; This returns to the CLI/GUI ;----------------------------------------------------; ; Data.                                              ; ;----------------------------------------------------;include 'DexFunctions.inc'      ; Here is where we includ our "DexFunctions.inc" file    

you can get the OS here: http://falconrybells.co.uk/
Or see the forum here: http://dex.7.forumer.com/
Post 04 May 2005, 13:04
View user's profile Send private message Reply with quote
Cas



Joined: 26 Feb 2004
Posts: 82
Location: Argentina
Cas
Hey. I am VERY interested in that. Where should I go to check that? And where can I get a documentation with all the services and such? Thanks.
Post 08 May 2005, 04:17
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You can down load it here: http://falconrybells.co.uk/
And you can get info on programming for it at this forum : http://dex.7.forumer.com/

here are some of the services you can call
Code:
;=========================================================;; Dex Functions                                  11/12/03 ;;---------------------------------------------------------;; Function call table.                                    ;;                                                         ;; Dex4u V0.01                                             ;; (c) Craig Bamford, All rights reserved.                 ;;=========================================================;;----------------------------------------------------;; Functions                    ; Function calltable. ;;----------------------------------------------------;Functions:CallTableAddress     rd 1           ;  0.call-table address,DO NOT call as function.Function1            rd 1           ;  1.RealModeInt10h       rd 1           ;  2.Call realmode int 10h,fill in AX,BX,CX,DX, with function number etc, be carefull may not work will all functions.RealModeRegs         rd 1           ;  3.Fills in AX,BX,CX,DX with result from above function,set CF to 1 on error.WaitForKeyPress      rd 1           ;  4.Wait for keypress,Exit: ASCII code of keypressed in AL .KeyPressedNoWait     rd 1           ;  5.If keyperssed AL=1,if no keypressed AL=0.ExtendedMemory       rd 1           ;  6.puts extended memory in eax (in KBs),puts total ram in ebx (in MB)ConvenMemorySize     rd 1           ;  7.puts conventional memory in eax (in KBs)TextColor            rd 1           ;  8.Sets the text color, Entry: AL=color.PrintString          rd 1           ;  9.prints a string,esi should point to a 0 termanated string.PrintChar            rd 1           ; 10.prints the char,in alPrintCharCursor      rd 1           ; 11.prints the char,in al and moves cursorSetCursorPos         rd 1           ; 12.Sets Cursor Pos, Entry: AL=X, AH=Y, if the X or Y is bigger than screen size, CF to 1, succes AH=0.WriteHex32           rd 1           ; 13.print the hex value,in eaxWriteHex16           rd 1           ; 14.print the hex value,in alUpperCase            rd 1           ; 15.Converts a 0 termanated string,to uppercase (es:edi = string buffer)CompearString        rd 1           ; 16.Compear two strings,set CF to 1, if strings are not the sameSetDex4uFonts        rd 1           ; 17.Goes to realmode and back sets 50x80 mode/fontsFloppyfileLoad       rd 1           ; 18.Loads a file from floppy,ESI points to name of file to load,EDI = place to load file to,set's CF to 1 on error.CdfileLoad           rd 1           ; 19.Loads a file from CD, CX = file name lenth,ESI = name of file to load,EDI points to place to load to,set's CF to 1 on error.SetDelay             rd 1           ; 20.Sets a delay, ax = delay,18.2 = 1 second.DetectPciBus         rd 1           ; 21.Detect Pci Bus present, set's CF to 1, if no pci busPciFindDevice        rd 1           ; 22.Scan through PCI space looking for a device+vendor ID,CF to 1,if no vender/device found.PciRegWrite8         rd 1           ; 23.Entry: EAX=PCI Bus/Device/fn/register number,DL=data to write.PciRegWrite16        rd 1           ; 24.Entry: EAX=PCI Bus/Device/fn/register number,DX=data to write.PciRegWrite32        rd 1           ; 25.Entry: EAX=PCI Bus/Device/fn/register number,EDX=data to write.PciRegRead8          rd 1           ; 26.Entry: EAX=PCI Bus/Device/fn/register number,Exit: DL register data.PciRegRead16         rd 1           ; 27.Entry: EAX=PCI Bus/Device/fn/register number,Exit: DX register data.PciRegRead32         rd 1           ; 28.Entry: EAX=PCI Bus/Device/fn/register number,Exit: EDX register data.Function29           rd 1GetUserInput         rd 1           ; 30.Gets user input, until enter pressed. Exit: EDI = buffer address, cx = string len.LoadVesaInfo         rd 1           ; 31.loads the address of vesainfo in esi, use this to fill a vesa info structure.SetVesaMode          rd 1           ; 32.Sets vesa mode 4112h (640*480 32bpp),need vesa info structure filling in, use above function.Function33           rd 1    


Theres more function being add each week, you can also load the OS from dos just by running kernel32.exe from dos (not a dos box,but real dos).

Hope this helps.
Post 08 May 2005, 13:14
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


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

Website powered by rwasa.