Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to access 0xFF800000 data ?

68 views
Skip to first unread message

dirw

unread,
Sep 2, 2009, 10:32:31 AM9/2/09
to
Dear All,

I try to use DJGPP to write an utility to flash BIOS.
In the DJGPP, how to read/write 0xFF800000 data ?
if possible, could you please show me a sample ?
Thanks for your great help.

dirw

DJ Delorie

unread,
Sep 2, 2009, 10:48:58 AM9/2/09
to dj...@delorie.com

You don't say if you want 0xff800000 linear (just under the 4Gb mark)
or 0xff800000 as a turbo-c "far pointer (FF80:0000 or just under the
1Mb mark).

Look in <sys/farptr.h> if you've allocated a selector for that area
(use DPMI to allocate selectors).

Look in <sys/nearptr.h> if it's performance critical.

Else look in <sys/movedata.h> for generically accessing memory below
the 1Mb boundary.

dirw

unread,
Sep 2, 2009, 11:07:09 AM9/2/09
to
Dear Sir,

Thanks for your reply.
I try to access linear address 0xFF800000 (under big real mode).
I already use _farpeekb (_dos_ds, 0xFFFC0) [real mode => segment :
offset => F000:FFC0] to get data successfully!!
But I still do NOT know how to access all of 4G memory data.
Should I use DPMI function to read/write 0xFF800000 data ?
If yes, could you please show me more information?
Becasue I already study the DPMI specification, but I still do NOT
know which function can meet my request.

Thanks for your great help.

BR,
dirw

DJ Delorie

unread,
Sep 2, 2009, 11:30:24 AM9/2/09
to dj...@delorie.com

dirw

unread,
Sep 2, 2009, 11:57:24 AM9/2/09
to
Dear Sir,

Thanks for your great help.
I will study them. ^_^

BR,
dirw

Charles Sandmann

unread,
Sep 3, 2009, 12:47:53 AM9/3/09
to
> I try to use DJGPP to write an utility to flash BIOS.
> In the DJGPP, how to read/write 0xFF800000 data ?

In addition to using either far or near pointers, you also need to
map the address space with DPMI (function 0x800),
__dpmi_physical_address_mapping(__dpmi_meminfo *_info);

You can probably also use the PMODE DPMI provider if
you are running in RAW or XMS mode, since it does not
enable paging and you could access the memory directly.


dirw

unread,
Sep 3, 2009, 10:01:32 AM9/3/09
to
Dear Sir,

Thanks for your great help.

I already can read the 0xFF800000 data in the MS DOS 6.11 mode.
But I still have some question.

1. In the MS DOS 6.11 mode , I call __dpmi_physical_address_mapping
(&mi) , it will return *successfully*.
But in the Windows XP DOS mode, I call
__dpmi_physical_address_mapping (&mi) , it will return *FAIL*.
Could you please give me some suggestion about this issue ?
Is it possible use *djgpp* to write a BIOS flash application for
windows XP DOS mode ?

2. In the MS DOS 6.11 mode, it need csdpmi5b.zip to provide the DPMI
server for djgpp DPMI funtion.
In the Windows XP DOS mode, does it already have DPMI server ?

3. If I want to write Windows XP application to read/write 0xFF800000
data, may I use *djgpp" ?
Or I must use Visual C++ and MASM to call DPMI to meet my request ?
(MSFT memory access information : http://support.microsoft.com/kb/131426/en-us/)

BR,
dirw

Rugxulo

unread,
Sep 3, 2009, 5:47:13 PM9/3/09
to
Hi,

On Sep 3, 9:01 am, dirw <dirwdirw...@yahoo.com.tw> wrote:
>
> Thanks for your great help.
> I already can read the 0xFF800000 data in the MS DOS 6.11 mode.
> But I still have some question.
>
> 1. In the MS DOS 6.11 mode , I call __dpmi_physical_address_mapping
> (&mi) , it will return *successfully*.
>    But in the Windows XP DOS mode, I call
> __dpmi_physical_address_mapping (&mi) , it will return *FAIL*.

XP's DPMI 0.9 is much wimpier than others (CWSDPMI). For the record,
MS declares DOS dead ever since XP, and I can attest that Vista's
NTVDM pretty much acts worse in almost every way (hence future MS OSes
won't support it very well, if at all, e.g. x86-64).

>    Could you please give me some suggestion about this issue ?
>    Is it possible use *djgpp* to write a BIOS flash application for
> windows XP DOS mode ?

Unlikely since DPMI is heavily virtualized under Windows. My Vista
laptop does flash the BIOS from within Windows, though. My "old" Dell
P4 uses a DOS binary, though (hence have to reboot with FreeDOS
floppy).

> 2. In the MS DOS 6.11 mode, it need csdpmi5b.zip to provide the DPMI
> server for djgpp DPMI funtion.

Run "exe2coff myfile.exe" then "copy /b cwsdstub.exe + myfile myfile-
standalone.exe" if that bothers you.

>     In the Windows XP DOS mode, does it already have DPMI server ?

Yes, but you're stuck with it (can't replace it). CWSDPMI isn't needed
there and won't help you even if you have it. :-(

> 3. If I want to write Windows XP application to read/write 0xFF800000
> data, may I use *djgpp" ?

Doubtful.

>    Or I must use Visual C++ and MASM to call DPMI to meet my request ?

DPMI is only for DOS, so it doesn't apply to Win32 programming.

>    (MSFT memory access information :http://support.microsoft.com/kb/131426/en-us/)

Yes, I suspect, if you truly want to run under Windows (only), that
you'll have to use MS tools and APIs (Win32). But I'm not sure it will
be easy. I suspect MS won't publicly be very forthcoming with all the
low-level details needed to flash BIOSes (for security reasons). But
good luck anyways!!

RayeR

unread,
Oct 2, 2009, 6:09:10 PM10/2/09
to
Simply,
WinXP (and all NT-based) don't allow accessing entire physical memory
for DOS applications. It's memory protection policy which became more
restrictive since ages of Win9x. The same for win32 apps in user mode.
You will need to write some kernel mode driver that will access
physicam memory and transfer data from/to your program.
0 new messages