中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 05:15
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » [Discussion] Can physical 32-bit addresses be accessed under MS-DOS?
Printable Version  1,219 / 1
Floor1 feng Posted 2003-09-10 00:00
初级用户 Posts 5 Credits 117
I've recently needed to write a driver under DOS. Can someone tell me how to use assembly under DOS to access physical 32-bit addresses.
Floor2 ATLaS Posted 2003-09-12 00:00
初级用户 Posts 29 Credits 169
You definitely have to be in protected mode to access physical 32-bit addresses.
You need a DPMI host. Under Watcom C there's dos4g/w, and now you can also use dos32a and cwsdpmi, as well as the famous pmode. Then it's just flat mode memory access: define a pointer to the memory area you want to access, the simplest and most direct way.
Under djgpp use cwsdpmi and pmode, but you can't access it directly with pointers; you need to use the _far* family of functions.
BC certainly has its own DPMI host too, but I haven't worked with it, so I'm not too sure.

As for assembly, I'd still advise you to forget it. Switching from DOS real mode to protected mode and then accessing the specified memory segment is rather cumbersome to implement in assembly.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023