Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DWED first alpha (Announce)

posted by Laaca Homepage, Czech republic, 15.11.2020, 21:05

> Another story: looks like Borland's DPMI16-server does not support LFN
> (passthru INT 21 for LFN). I try dwed16 with WinXP and have a fail.
> At the same time - real-mode dwed works with LFN under WinXP.
> Need do more research.
>

Of course that Borland's DPMI16 server (RTM.EXE) does not support the LFN. Or to be more correct - it does not support the API translation for LFN routines.
In legacy SFN routines the Borland's server detects that you are trying to call f.e. INT21h/AH=47h (GetCurrentDirectory). RTM.EXE has this call in its database and knows that DOS will use the realmode return buffer at DS:SI so RTM kindly copies realmode DS:SI into your protected mode DS:SI.
It works nice but RTM.EXE has to have the called function in it's database.
LFNs are not in this database.
In such cases you have to use the direct call od DPMI service 300h (simulate realmode interrupt).
The situation applies to VESA BIOS standard.
Look at this my Borland pascal 16-bit PM code:


{$DEFINE _Bez_WinAPI}  {Jestli chces, tak umaz podtrzitko :-)   }


{$IFNDEF Bez_WinAPI}
uses WinAPI;
{$ENDIF}
type DPMIregs=record
      EDI,ESI,EBP,Reserved,EBX,EDX,ECX,EAX:Longint;
      Flags,ES,DS,FS,GS,IP,CS,SP,SS:word;
     end;


{$IFDEF Bez_WinAPI}
Function GlobalDOSAlloc(w:word):longint;assembler;
asm
mov ax,100h
mov bx,w
shr bx,4  {BX se neuvadi v bajtech, ale v tzv. paragrafech. 1 paragraf=16 bajtu}
int 31h
xchg ax,dx
end;


Procedure GlobalDOSFree(w:word);assembler;
asm
mov ax,101h
mov dx,w
int 31h
end;
{$ENDIF}


Procedure DPMI_Preruseni(i:byte;var r:DPMIregs);assembler;
asm
mov ax,300h
xor bx,bx;mov bl,i
xor cx,cx           { nebudu predavat zadny zasobnik }
les di,r
int 31h
end;


Function Segment_Na_Deskriptor(w:word):word;assembler;
asm
mov ax,2
mov bx,w
int 31h
end;


var vyrobce:pchar;
    buffer:array[0..127] of word;
    konv_buffer:longint;
    real_segment:word;
    r:DPMIregs;
    p:pointer;
    pp:^byte;


begin
konv_buffer:=GlobalDOSAlloc(256);
real_segment:=(word(konv_buffer shr 16));
p:=pointer(0);                 {Za tyhle tri radky se omlouvam, ale}
pp:=@p;inc(pp,2);              {nepodarilo se mi to napsat}
move(konv_buffer,pp^,2);       {srozumitelneji}
{-------------------------}
FillChar(r,sizeof(r),0);
r.es:=real_segment;
r.edi:=0;
r.eax:=$4f00;
DPMI_Preruseni($10,r);
{-------------------------}
Move(p^,buffer,256);
buffer[4]:=Segment_Na_Deskriptor(buffer[4]);
{ prevod realmodoveho segmentu na selektor pristupny z protektu }
Move(buffer[3],vyrobce,4);


writeln('Manufacturer of your videocard is: ',vyrobce);
readln;
GlobalDOSFree(word(konv_buffer));
end. 

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 205 users online (0 registered, 205 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum