From 38c931abc7fbf7136dcc1eab07825ad8ef67f454 Mon Sep 17 00:00:00 2001 From: Robert Nordier Date: Sun, 13 Sep 1998 13:28:07 +0000 Subject: [PATCH] Enable client entry point support. --- sys/boot/i386/btx/btx/btx.S | 4 ++-- sys/boot/i386/btx/btx/btx.s | 4 ++-- usr.sbin/btxld/btxld.c | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/boot/i386/btx/btx/btx.S b/sys/boot/i386/btx/btx/btx.S index 2b0135927f72..522a3c4ca828 100644 --- a/sys/boot/i386/btx/btx/btx.S +++ b/sys/boot/i386/btx/btx/btx.S @@ -13,7 +13,7 @@ # purpose. # -# $Id:$ +# $Id: btx.s,v 1.1.1.1 1998/09/12 04:29:23 rnordier Exp $ # # Memory layout. @@ -219,7 +219,7 @@ init.9: xorl %ecx,%ecx # Zero pushl %eax # Set ESP pushl $0x202 # Set flags (IF set) pushl $SEL_UCODE # Set CS - pushl $0x0 # Set EIP + pushl btx_hdr+0xc # Set EIP pushl %ecx # Set GS pushl %ecx # Set FS pushl %ecx # Set DS diff --git a/sys/boot/i386/btx/btx/btx.s b/sys/boot/i386/btx/btx/btx.s index 2b0135927f72..522a3c4ca828 100644 --- a/sys/boot/i386/btx/btx/btx.s +++ b/sys/boot/i386/btx/btx/btx.s @@ -13,7 +13,7 @@ # purpose. # -# $Id:$ +# $Id: btx.s,v 1.1.1.1 1998/09/12 04:29:23 rnordier Exp $ # # Memory layout. @@ -219,7 +219,7 @@ init.9: xorl %ecx,%ecx # Zero pushl %eax # Set ESP pushl $0x202 # Set flags (IF set) pushl $SEL_UCODE # Set CS - pushl $0x0 # Set EIP + pushl btx_hdr+0xc # Set EIP pushl %ecx # Set GS pushl %ecx # Set FS pushl %ecx # Set DS diff --git a/usr.sbin/btxld/btxld.c b/usr.sbin/btxld/btxld.c index 0e853e581d71..51620acf627c 100644 --- a/usr.sbin/btxld/btxld.c +++ b/usr.sbin/btxld/btxld.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "$Id:$"; + "$Id: btxld.c,v 1.1.1.1 1998/09/12 06:49:48 rnordier Exp $"; #endif /* not lint */ #include @@ -100,6 +100,8 @@ static unsigned format; /* Output format */ static uint32_t centry; /* Client entry address */ static uint32_t lentry; /* Loader entry address */ +static int Eflag; /* Client entry option */ + static int quiet; /* Inhibit warnings */ static int verbose; /* Display information */ @@ -142,6 +144,7 @@ main(int argc, char *argv[]) break; case 'E': centry = optaddr(optarg); + Eflag = 1; break; case 'e': lentry = optaddr(optarg); @@ -239,6 +242,7 @@ btxld(const char *iname) cwr++; } btx.btx_pgctl -= cwr; + btx.btx_entry = Eflag ? centry : ihdr.entry; if (snprintf(name, sizeof(name), "%s.tmp", oname) >= sizeof(name)) errx(2, "%s: Filename too long", oname); if ((fdo = open(name, O_CREAT | O_TRUNC | O_WRONLY, 0666)) == -1)