Sun Bug ID 1251858 (on http://sunsolve1.sun.com) discusses the way that

Sun implemented iBCS2 compatibility on Solaris >= 2.6:  The emulator
runs in user-mode, patching the LDT so that client programs making
syscalls through the old iBCS2 call gate get handled by the emulator
process.  Unemulated syscalls therefore need their own call-gate that
bypasses the emulator.  Sun chose LDT entry 4 to implement this, which
is what we've been using as LUDATA_SEL, so we need to change LUDATA_SEL
if we want to run Solaris executables.

Discussed with: Mike Smith
This commit is contained in:
Mark Newton 1999-01-28 11:45:49 +00:00
parent 22cd7960a2
commit 27286ca9a8
4 changed files with 28 additions and 6 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
* $Id: machdep.c,v 1.322 1999/01/15 17:24:05 msmith Exp $
*/
#include "apm.h"
@ -1069,6 +1069,15 @@ static struct soft_segment_descriptor ldt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
/* Null Descriptor - overwritten by call gate */
{ 0x0, /* segment base address */
0x0, /* length - all address space */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Data Descriptor for user */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
@ -1587,6 +1596,7 @@ init386(first)
/* XXX does this work? */
ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];
ldt[LSOL26CALLS_SEL] = ldt[LSYS5CALLS_SEL];
/* transfer to user mode */

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
* $Id: segments.h,v 1.16 1997/08/18 06:58:31 charnier Exp $
* $Id: segments.h,v 1.17 1997/08/21 06:32:49 charnier Exp $
*/
#ifndef _MACHINE_SEGMENTS_H_
@ -229,7 +229,8 @@ struct region_descriptor {
#define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3
#define LUDATA_SEL 4
#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */
#define LUDATA_SEL 5
/* separate stack, es,fs,gs sels ? */
/* #define LPOSIXCALLS_SEL 5*/ /* notyet */
#define LBSDICALLS_SEL 16 /* BSDI system call gate */

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
* $Id: machdep.c,v 1.322 1999/01/15 17:24:05 msmith Exp $
*/
#include "apm.h"
@ -1069,6 +1069,15 @@ static struct soft_segment_descriptor ldt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
/* Null Descriptor - overwritten by call gate */
{ 0x0, /* segment base address */
0x0, /* length - all address space */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Data Descriptor for user */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
@ -1587,6 +1596,7 @@ init386(first)
/* XXX does this work? */
ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];
ldt[LSOL26CALLS_SEL] = ldt[LSYS5CALLS_SEL];
/* transfer to user mode */

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
* $Id: segments.h,v 1.16 1997/08/18 06:58:31 charnier Exp $
* $Id: segments.h,v 1.17 1997/08/21 06:32:49 charnier Exp $
*/
#ifndef _MACHINE_SEGMENTS_H_
@ -229,7 +229,8 @@ struct region_descriptor {
#define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3
#define LUDATA_SEL 4
#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */
#define LUDATA_SEL 5
/* separate stack, es,fs,gs sels ? */
/* #define LPOSIXCALLS_SEL 5*/ /* notyet */
#define LBSDICALLS_SEL 16 /* BSDI system call gate */