From 273e8ae57159d69db504fabe70b0724de5297161 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 19 Jan 2009 19:56:07 -0500 Subject: Minor - call16 should not assume %cs==SEG_BIOS. Should be slightly more compatible with protected mode accesses. --- src/romlayout.S | 2 +- src/util.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/romlayout.S b/src/romlayout.S index c31d9cc..efae759 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -285,7 +285,7 @@ __call16: pushl %eax // Setup for iretw call - pushw $SEG_BIOS + pushw %cs pushw $1f // return point pushw BREGS_flags(%eax) // flags pushl BREGS_ip(%eax) // CS:IP diff --git a/src/util.c b/src/util.c index 66b3343..ad918d7 100644 --- a/src/util.c +++ b/src/util.c @@ -4,9 +4,8 @@ // // This file may be distributed under the terms of the GNU LGPLv3 license. -#include "util.h" // usleep +#include "util.h" // call16 #include "bregs.h" // struct bregs -#include "config.h" // SEG_BIOS #include "farptr.h" // GET_FLATPTR #include "biosvar.h" // get_ebda_seg @@ -43,7 +42,10 @@ call16big(struct bregs *callregs) inline void __call16_int(struct bregs *callregs, u16 offset) { - callregs->cs = SEG_BIOS; + if (MODE16) + callregs->cs = GET_SEG(CS); + else + callregs->cs = SEG_BIOS; callregs->ip = offset; call16(callregs); } -- cgit v1.1