Re: Read_***_ulong



On Mon, 17 Apr 2006 02:48:21 -0500, Markus09
<Markus09.26ehtq@xxxxxxxxxxxxxxxxxxxxx> wrote:


I treid READ_REGISTER_ULONG(mappedAddress + offset).

But when I set offset to a high value (e.g. 0x8004360) the driver
bugchecks with a "STOP":
(Edit: It also bug-checks with offset=0x0)

Bugcheck: 0x8E

Arg1: c0000005, The exception code that was not handled
Arg2: a7fb29ec, The address that the exception occurred at
Arg3: a7f09b2c, Trap Frame
Arg4: 00000000

Is the maximum of mapped Memory with 256 MB (Win XP) reached?


No you have a bug in your code. Did you map your memory resource into
a system virtual address using MmMapIoSpace? That either worked or it
didn't work and if it worked the returned value is what you should be
passing into READ_REGISTER, not the PHYSICAL_ADDRESS handed to you in
StartDevice.

Also note that to read large buffers you should be using the
READ_REGISTER_BUFFER_* methods rather than calling READ_REGISTER_ULONG
in a loop.


Maxim S. Shatskih wrote:
*> I got the Memory-Resource from the PnP Manager and mapped 256 MB
with
MmMapIoSpace(...).
But how should I access this "area"?
Should I use READ_REGISTER_ULONG(adr) or READ_PORT_ULONG(adr)?

For memory resource, you must use READ_REGISTER_ULONG.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
[url]http://www.storagecraft.com[/url] *


=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com
.



Relevant Pages

  • Re: Read_***_ulong
    ... What is the data type of mappedAddress? ... But when I set offset to a high value the driver ... bugchecks with a "STOP": ... Maxim Shatskih, Windows DDK MVP ...
    (microsoft.public.development.device.drivers)
  • Read_***_ulong
    ... But when I set offset to a high value the driver ... bugchecks with a "STOP": ... Is the maximum of mapped Memory with 256 MB reached? ... Maxim Shatskih, Windows DDK MVP ...
    (microsoft.public.development.device.drivers)
  • Re: Start and stop via SCM not multiprocessor-safe?
    ... your Unload routine can forget to cancel outstanding IO ... > Currently, I'm working on a driver which is not WDM, but legacy NT4. ... > machine, the system bugchecks. ...
    (microsoft.public.development.device.drivers)
  • Re: Start and stop via SCM not multiprocessor-safe?
    ... I would think it's your driver not multiprocessor-safe. ... "Spiro Trikaliotis" wrote in message ... > machine, the system bugchecks. ...
    (microsoft.public.development.device.drivers)
  • Start and stop via SCM not multiprocessor-safe?
    ... Currently, I'm working on a driver which is not WDM, but legacy NT4. ... machine, the system bugchecks. ... I do not have a HT or an SMP machine here. ... driver, thus, the driver would never reach the DriverEntryroutine. ...
    (microsoft.public.development.device.drivers)

Loading