diff --git a/kernel/procsupt.asm b/kernel/procsupt.asm index ecf25b7..01fedc4 100644 --- a/kernel/procsupt.asm +++ b/kernel/procsupt.asm @@ -45,8 +45,7 @@ segment HMA_TEXT ; ; Special call for switching processes ; -; void exec_user(irp) -; iregs far *irp; +; void exec_user(iregs far *irp, int disable_a20) ; global _exec_user _exec_user: @@ -60,15 +59,20 @@ _exec_user: pop ax ; return address (unused) pop ax ; irp (user ss:sp) - pop dx + pop dx + pop cx ; disable A20? cli mov ss,dx mov sp,ax ; set-up user stack sti ; + or cx,cx POP$ALL + jz do_iret extern _ExecUserDisableA20 jmp far _ExecUserDisableA20 +do_iret: + iret segment _LOWTEXT diff --git a/kernel/proto.h b/kernel/proto.h index 0c99ff0..d2b2c09 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -373,7 +373,7 @@ UWORD get_machine_name(BYTE FAR * netname); VOID set_machine_name(BYTE FAR * netname, UWORD name_num); /* procsupt.asm */ -VOID ASMCFUNC exec_user(iregs FAR * irp); +VOID ASMCFUNC exec_user(iregs FAR * irp, int disable_a20); /* new by TE */ diff --git a/kernel/task.c b/kernel/task.c index 3c3f6c7..9fb30fd 100644 --- a/kernel/task.c +++ b/kernel/task.c @@ -314,7 +314,7 @@ int load_transfer(UWORD ds, exec_blk *exp, UWORD fcbcode, COUNT mode) if (InDOS) --InDOS; - exec_user(irp); + exec_user(irp, 1); /* We should never be here fatal("KERNEL RETURNED!!!"); */ @@ -528,7 +528,7 @@ VOID return_user(void) if (InDOS) --InDOS; - exec_user((iregs FAR *) q->ps_stack); + exec_user((iregs FAR *) q->ps_stack, 0); } COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)