Article View: alt.lang.asm
Article #373Re: Physical address and GDT
From: Harold Yang
Date: Mon, 14 Sep 1998 00:00
Date: Mon, 14 Sep 1998 00:00
42 lines
2669 bytes
2669 bytes
Thanks you for all those who have replied to my posting and has contributed
suggestion.
After working all weekend with my supervisor, and the help of all those who
reply to our e-mail and posting, from nice guy like you, we got it
working!!!
YES!!!!!
I thought it might be a good idea to post the solution, in case anyone might
be interested. Below is the pseudocode for obtaining physical address:
-obtain linear address from Map_Flat, passing segment:offset as the
argument
dwLinAddr = Map_Flat(segment, offset);
-from the linear address, calculate the page number:
wNumPages =((dwNumBytes + dwLinAddr AND 0x0FFF)+4095) >> 12;
-lock the page with LinPageLock which returns global linear address
dwGlobalLinAddr = LinPageLock(dwLinAddr >> 12, wNumPages)
-call CopyPageTable to obtain the final physical address
dwPhyAddr =(CopyPageTable(dwLinAddr >> 12) AND 0xFFFFF000) OR
(dwLinAddr AND 0x0FFF);
After you are done with the physical address, you can unlock the page by
calling
UnlockLinPage.
-UnlockLinPage(dwGlobalLinAddr, wNumPages);
Thanks again for your help.
Yolanda Lei
********************************************************
Signalogic
9617 Wendell @ Skillman * Dallas, Texas 75243
tel: 214-343-0069 * fax: 214-343-0163
e-mail: dspinfo@signalogic.com * web: www.signalogic.com
********************************************************
Technical Details
Message-ID:
<6tk9qc$n50$1@excalibur.flash.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6t988g$9sc$1@excalibur.flash.net> <wziuivq7ah.fsf@fizyk1.fuw.edu.pl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10891a,e6e751b7e569bca4 X-Google-Attributes: gid10891a,public X-Google-Thread: f7d8d,e6e751b7e569bca4 X-Google-Attributes: gidf7d8d,public X-Google-Thread: 1043cf,e6e751b7e569bca4 X-Google-Attributes: gid1043cf,public X-Google-Thread: 10261c,e6e751b7e569bca4 X-Google-Attributes: gid10261c,public X-Google-Thread: 114950,e6e751b7e569bca4 X-Google-Attributes: gid114950,public X-Google-Thread: 105df1,e6e751b7e569bca4 X-Google-Attributes: gid105df1,public X-Google-Thread: 108ebd,e6e751b7e569bca4 X-Google-Attributes: gid108ebd,public From: "Harold Yang" <harold@signalogic.com> Subject: Re: Physical address and GDT Date: 1998/09/14 Message-ID: <6tk9qc$n50$1@excalibur.flash.net> X-Deja-AN: 391161304 References: <6t988g$9sc$1@excalibur.flash.net> <wziuivq7ah.fsf@fizyk1.fuw.edu.pl> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Flashnet Communications, http://www.flash.net Newsgroups: alt.lang.asm,comp.os.ms-windows.programmer.vxd,comp.os.msdos.djgpp,comp.os.ms-windows.programmer.misc,borland.public.delphi.objectpascal,comp.lang.pascal.misc,alt.lang.asm,borland.public.turbopascal,comp.lang.pascal.borland