dosemu & sys_vm86 = -ENOSYS

Herbert Rosmanith (herp@wildsau.idv.uni-linz.ac.at)
Mon, 8 Apr 1996 06:20:50 +0200 (MET DST)


hi,

I can't get dosemu to work. whenever I call "dos", it hangs after
printing "DPMI Server version". when I check what "dos" is doing,
strace shows that it loops around the vm86() call infinitely, returning
-ENOSYS = Function not implemented.

I've read through various files, and have some questions about
the "ret_from_sys_call" function.

"ret_from_sys_call" is called from dosemu/src/arch/linux/emumod/vm86.c
with the following instruction: (I know that this file is a modified
copy from the linux-source tree)

asmlinkage int sys_vm86(struct vm86_struct * v86)
{

....

__asm__ __volatile__("movl %0,%%esp\n\t"
"jmp ret_from_sys_call"
: /* no outputs */
:"r" (&info.regs));

why is %esp set to zero ?

next, I think it's ret_from_sys_call which returns -ENOSYS.
ret_from_sys_call is coded in entry.S in the linux source tree.
at the end of the file, there's a table of .long words containing
the various systemcall offsets. of course, sys_vm86 can be found in
this table.
but since dosemu defines its own sys_vm86, wouldn't this lead to a
conflict ? if we suppose that ret_from_sys_call tries to find the address
of the routine it's being called from in this table, then this could
be the reason for dosemu returning -ENOSYS. but I confess that I don't
know if ret_from_sys_call works this way, and allthough I know some
assembly, the code looks ... hm, I do understand the instructions, but
not what the code is supposed to do as a whole.
could someone explain how "ret_from_sys_call" works ?

here's part of the output that strace generated:

gettimeofday({828935886, 880440}, NULL) = 0
select(25, [8], NULL, NULL, {0, 0}) = 0 (Timeout)
vm86(0x200be024 <unfinished ...>
--- SIGALRM (Alarm clock) ---
<... vm86 resumed> ) = -1 ENOSYS (Function not implemented)
gettimeofday({828935886, 892434}, NULL) = 0
select(25, [8], NULL, NULL, {0, 0}) = 0 (Timeout)
vm86(0x200be024 <unfinished ...>
--- SIGALRM (Alarm clock) ---
<... vm86 resumed> ) = -1 ENOSYS (Function not implemented)
gettimeofday({828935886, 901423}, NULL) = 0
select(25, [8], NULL, NULL, {0, 0}) = 0 (Timeout)
vm86(0x200be024 <unfinished ...>
--- SIGALRM (Alarm clock) ---
<... vm86 resumed> ) = -1 ENOSYS (Function not implemented)

regards, herp
herp@wildsau.idv.uni-linz.ac.at
rosmanith@edvz.uni-linz.ac.at