Robert Zanatta
2004-08-23 08:15:44 UTC
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.
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.