[ros-dev] (Free)DOS subsystem

Myria myriachan at cox.net
Thu Aug 31 06:57:20 CEST 2006


> Not like Windows. The 386 emulator is used on systems that lack the vm86
> system call. For DOSemu to run on an x86 platform *without* needing an
> emulator it needs a way to run the executable in a sandboxed x86 VM. In 
> Linux
> on the x86 platform this is supplied by the vm86 syscall.

In NT 32, use NtSetContextThread to set the VM flag in the EFLAGS register 
of the target thread while suspended.  It's as simple as that.  Presumably, 
you'd want to set the segment registers and EIP afterward. 
(NtSetContextThread disables segment register value validation if EFLAGS.VM 
is set on the target since setting e.g. CS=0008 would be legal then.)

NT does have a lot of special functions through NtVdmControl, but the core 
of V86 mode doesn't require it.  NtSetLdtEntries is also important, for DPMI 
and Win16.

Melissa 



More information about the Ros-dev mailing list