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
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.
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
http://www.delorie.com/djgpp/doc/dpmi/api/310000.html
http://www.delorie.com/djgpp/doc/dpmi/api/310007.html
http://www.delorie.com/djgpp/doc/dpmi/api/310008.html
http://www.delorie.com/djgpp/doc/dpmi/api/310009.html
http://www.delorie.com/djgpp/doc/libc/libc_304.html
(2) using <sys/nearptr.h> you just need to add
__djgpp_conventional_base to your 32-bit linear address.
Thanks for your great help.
I will study them. ^_^
BR,
dirw
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.
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
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!!