beep control

I’m trying to use the beep as a tool in testing my driver.
When I call MmMapIoSpace to map the physical port address
0x00000061 (range of one byte), NT returns a different virtual
address every time. I would call MmMapIoSpace followed by
MmUnmapIoSpace, and the returned virtual address increases
by 0x00001000 with every mapping/unmapping cycle. Only
virtual addresses of the form 0xNNNN0061 generate a beep
when I write “0x2f” to that address.

Does anyone have any idea why MmMapIoSpace is returning
different virtual addresses for the same physical port
address?

TIA.
Chris


YOU’RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there’s no risk! For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

> When I call MmMapIoSpace to map the physical port address

0x00000061 (range of one byte), NT returns a different virtual
address every time. I would call MmMapIoSpace followed by
MmUnmapIoSpace, and the returned virtual address increases
by 0x00001000 with every mapping/unmapping cycle. Only
virtual addresses of the form 0xNNNN0061 generate a beep
when I write “0x2f” to that address.

MmMapIoSpace is not necessary for 0x61 controller port - it is necessary for
memory-mapped hardware registers only, not for x86-style “ports”.
Just use WRITE_PORT_UCHAR to 0x61 - or maybe pass it through
HalTranslateBusAddress with Internal bus type before
WRITE_PORT_UCHAR.

Max