From d233a1d304ebff6369f00312c356338af839e9c8 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Tue, 27 Mar 2001 02:56:58 +0000 Subject: [PATCH] Fixed bugs in entry.asm: stack segment and int 2A/82 Ralf Brown compliant. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@179 6ac86273-5f31-0410-b378-82cca8765d1b --- docs/history.txt | 3 +++ kernel/entry.asm | 23 +++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/history.txt b/docs/history.txt index 120343e..109029c 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -1,3 +1,6 @@ +2001 Mar 27 - Build 2023 +-------- Bart Oldeman (bart.oldeman@bristol.ac.uk) ++ Fixes Bug fix release 2023a: fixed stack segment bug in entry.asm. 2001 Mar 25 - Build 2023 -------- Bart Oldeman (bart.oldeman@bristol.ac.uk) + Fixes sys.com compilation: it is a proper .com and works again. diff --git a/kernel/entry.asm b/kernel/entry.asm index e5495cb..e156ac3 100644 --- a/kernel/entry.asm +++ b/kernel/entry.asm @@ -28,6 +28,9 @@ ; $Id$ ; ; $Log$ +; Revision 1.7 2001/03/27 02:56:58 bartoldeman +; Fixed bugs in entry.asm: stack segment and int 2A/82 Ralf Brown compliant. +; ; Revision 1.6 2001/03/24 22:13:05 bartoldeman ; See history.txt: dsk.c changes, warning removal and int21 entry handling. ; @@ -219,7 +222,7 @@ reloc_call_int21_handler: ; NB: stack frame is MS-DOS dependent and not compatible ; with compiler interrupt stack frames. ; - sti + sti PUSH$ALL ; @@ -255,12 +258,12 @@ int21_user: ; ; DX=DGROUP ; CX=STACK -; AX=userSS +; SI=userSS ; BX=userSP int21_1: - mov ax,ss ; save user stack, to be retored later + mov si,ss ; save user stack, to be retored later mov bx,sp @@ -304,7 +307,7 @@ int21_onerrorstack: mov sp,cx sti - push ax ; user SS:SP + push si ; user SS:SP push bx call _int21_service @@ -312,9 +315,13 @@ int21_onerrorstack: int21_2: inc byte [_InDOS] + mov cx,_char_api_tos + or ah,ah + jz int21_3 cmp ah,0ch - mov cx,_char_api_tos jle int21_normalentry + cmp ah,59h + je int21_normalentry int21_3: call dos_crit_sect @@ -332,7 +339,7 @@ int21_normalentry: ; int21_syscall and remainder of kernel. ; - push ax ; user SS:SP + push si ; user SS:SP push bx call _int21_service @@ -346,10 +353,10 @@ int21_exit: dec byte [_InDOS] int21_exit_nodec: pop bx ; get back user stack - pop ax + pop si cli - mov ss,ax + mov ss,si mov sp,bx sti int21_ret: POP$ALL