I have a simple but working multitasking implementation and can tun tasks with
pl3.
here is the code I'm using to run a 16bits program in vm86, this program is
loaded at linear address 0x90000.
my context initialisation code for the vm86 task is :
Code: Select all
v86t._ldtss=0;
v86t._t=0;
v86t._iomapaddr=sizeof(struct _tss);
v86t._cr3 = (u32)_PD_ADDR_;
v86t._fs = xtss[i]._gs = 0;
v86t._ds = 0x0;
xtss[i]._es = 0;
v86t._ss =0x9000;
v86t._cs=0x9000;
v86t._esp=(u32)&task_stack[3];
v86t._ss0=0x10;
v86t._esp0=(u32)&pl0_stack[3];
v86t._eflags=0x23202;
v86t._eip=0;
except the last byte which contain 0xFF.
so... when I load and run this 16bits code
Code: Select all
[BITS 16]
[section .text]
mov ax, 0xDEAD
mov bx, 0xDEAD
mov cx, 0xDEAD
mov dx, 0xDEAD
jmp $
bx, cx, dx regesters contains 0xDEAD
but when I try the same code with a call to an int n instruction :
Code: Select all
[BITS 16]
[section .text]
mov ax, 0xDEAD
mov bx, 0xDEAD
mov cx, 0xDEAD
mov dx, 0xDEAD
int 3
jmp $
with a lot of "write beyond limit" messages.
I tried the same code with IOPL=0 and get the same error.
I folowwed everythink in intel manual except what they called "Software
interrupt redirection bit map"... do you think this is the source of my
problem ?
and how can I fix it ?