Hi

My previous question was maybe too detailed and seemed complex or unclear. I
did not get any answer to it...

So I ask it again, but in a simpler way (I hope) :

From the DriverEntry of one of my boot drivers, I need to read some bytes in
conventional memory (below 640KB of physical address).

I can use MmMapIoSpace but this fails when I use WinXP Checked Build (ASSERT
(PointerPte->u.Hard.Valid == 0))

I need to be able to use a "Checked Build Valid" method to read bytes from
physical addresses below 640KB. This method must also be accepted by
DriverVerifier. These are customer requirements.

What is the correct method to read such bytes from boot drivers under
CheckedBuild and with DriverVerifier under free build?

Thanks in advance for your help

Re: read conventional memory from DriverEntry/Checked build by Mark

Mark
Thu Apr 13 08:57:28 CDT 2006

princetarhn wrote:
> Hi
>
> My previous question was maybe too detailed and seemed complex or unclear. I
> did not get any answer to it...
>
> So I ask it again, but in a simpler way (I hope) :
>
> From the DriverEntry of one of my boot drivers, I need to read some bytes in
> conventional memory (below 640KB of physical address).
>
> I can use MmMapIoSpace but this fails when I use WinXP Checked Build (ASSERT
> (PointerPte->u.Hard.Valid == 0))
>

The checked build assertion is correct as you are attempting to map
memory that is already claimed. You've been warned that your design is
terrible. Read up on ZwMapViewOfSection and pay attention to the
reference to \Device\PhysicalMemory.

Re: read conventional memory from DriverEntry/Checked build by princetarhn

princetarhn
Thu Apr 13 16:13:02 CDT 2006



"Mark Roddy" wrote:

> princetarhn wrote:
> > Hi
> >
> > My previous question was maybe too detailed and seemed complex or unclear. I
> > did not get any answer to it...
> >
> > So I ask it again, but in a simpler way (I hope) :
> >
> > From the DriverEntry of one of my boot drivers, I need to read some bytes in
> > conventional memory (below 640KB of physical address).
> >
> > I can use MmMapIoSpace but this fails when I use WinXP Checked Build (ASSERT
> > (PointerPte->u.Hard.Valid == 0))
> >
>
> The checked build assertion is correct as you are attempting to map
> memory that is already claimed. You've been warned that your design is
> terrible. Read up on ZwMapViewOfSection and pay attention to the
> reference to \Device\PhysicalMemory.

In fact, we were using ZwMapViewOfSection but this caused a BugCheck in
Driver Verifier, so we switched to MmMapIoSpace (after readingthis post

http://groups.google.com/group/comp.os.ms-windows.programmer.nt.kernel-mode/browse_thread/thread/90aca8a71216ded3/594fd8f909f4dd71?lnk=st&rnum=1#594fd8f909f4dd71
) .

But thanks, we will try to switch back to ZwMapViewOfSection.
Any hint on tings to avoid when using ZwMapViewOfSection to read some
physical address under 640KB (things that could cause a bugckeck in
DriverVerifier)?



Re: read conventional memory from DriverEntry/Checked build by Maxim

Maxim
Thu Apr 13 17:38:41 CDT 2006

> I need to be able to use a "Checked Build Valid" method to read bytes from
> physical addresses below 640KB. This method must also be accepted by
> DriverVerifier. These are customer requirements.

Also try:

- exclude the "magic memory" from int 15h and all other BIOS (int 11h etc)
memory map at all by hooking these BIOS ints in the real mode loader.
- then map it using MmMapIoSpace. You should know the address - 640KB -
YourSize.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com