阅读:1260回复:3
How to get a buffer which virtual address is below 4GB under 64 bit Windows2003 server kernel mode?
Under 64 bit Windows2003 server, I need to thunk from 64 bit mode to 16 bit compatibility mode in kernel (ring 0). So I allocate a buffer and place my 16 bit code to this buffer, and I create a new GDT descriptor as 16 bit code segment. Because 64 bit mode and 16 bit compatibility mode share OS 64 bit page table and my buffer is always above 4GB, and because AMD 64 bit CPU supports all GDT descriptor’s length as legacy, all descriptor’s base field is 32 bit length, so in 16 bit compatibility mode, CPU can not get instruction from my 16 bit code segment which is above 4 GB.
Then If I can get a buffer below 4 GB and I place my 16 bit code into this buffer, OFFSET + CS.BASE(32 bit) can locate my 16 bit instruction. But OS can not support to allocate a buffer below 4 GB with normal ways. There are any way to help me to get a buffer which virtual address is below 4GB under 64 bit Windows2003 server kernel mode? |
|
沙发#
发布于:2005-03-16 18:03
你可以自己构造页表指向你分配的页.
|
|
|
板凳#
发布于:2005-03-17 08:47
对页表的操作不太了解,用什么API来实现?能不能具体一点, 好赶时间的。 谢谢!
|
|
地板#
发布于:2005-03-17 15:54
其实我们的问题最终是要在64bit里能call 实模式下16bit的程序, 由于兼容性和架构的愿因, 不得不如此,但现有的资料实在太少,哪位有空帮帮忙, 少不了庆功酒的!
|
|