Discussion:
allocating and using real mode memory from a dynamic vxd
(too old to reply)
Robert Zanatta
2004-08-23 08:15:44 UTC
Permalink
I want to create a dynamic VxD that performs direct disk access on behalf of
a Win32 app. The Win32 app will open the VxD, thereby loading it, and then
submit read/write requests via DeviceIoCtrl.

The VxD will do direct disk access via Int 13h. So, the VxD needs to
alloctate at least a sector size of real mode memory, then perform an int
13h.

I can allocate a page by scanning for free page in the v86 pages array,
assign the page globally, allocate a page of memory, then map the page into
v86 memory.
VMMCall _Get_Device_V86_Pages_Array
VMMCall _Assign_Device_V86_Pages
VMMCall _PageAllocate
VMMCall _MapIntoV86

The last call, I assume, gives the segment, which I can do a Map_Flat on to
get the linear address.

I thought I could pass the segment in via the client regs to the int 13h
call, but int 13h call ends up moving data into the memory location 0:0
instead of seg:0.

What do I need to do to properly 512 byte block of real mode memory,
preferably available across all VMs, that I can receive a real mode seg/off
value that can be passed in the client regs?

On a static VxD, I can allocate a block during device init using
V86MMGR_Allocate_Buffer, and the result in edi can be converted into a
seg/offset (high word, low word) that works. But I need to do this in a
dynamic VxD.

Thanks in advance for any help.
Ross Ridge
2004-08-23 14:25:38 UTC
Permalink
Post by Robert Zanatta
I want to create a dynamic VxD that performs direct disk access on behalf of
a Win32 app. The Win32 app will open the VxD, thereby loading it, and then
submit read/write requests via DeviceIoCtrl.
The VxD will do direct disk access via Int 13h.
Windows already provides a VxD that does this. Open "\\.\vwin32"
and use the VWIN32_DIOC_DOS_INT13 IOCTL to do direct disk access.
Check the Platform SDK documentation for more details.
Post by Robert Zanatta
So, the VxD needs to alloctate at least a sector size of real mode
memory, then perform an int 13h.
You would've wanted to use _Allocate_Global_V86_Data_Area do this.

Ross Ridge
--
l/ // Ross Ridge -- The Great HTMU
[oo][oo] ***@csclub.uwaterloo.ca
-()-/()/ http://www.csclub.uwaterloo.ca/u/rridge/
db //
Loading...