From 68805961dc4ca2ce98ef213dfd9a6f8148e3dd17 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Thu, 28 Aug 2003 20:25:09 +0000 Subject: [PATCH] Don't disable a20 for "exit" int21/ah=4c git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@654 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/procsupt.asm | 10 +++++++--- kernel/proto.h | 2 +- kernel/task.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) 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)