summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-04-03 22:20:03 +0000
committerjdp <jdp@FreeBSD.org>1999-04-03 22:20:03 +0000
commit60ad9560502beabab095c9441389f5ad42ab0d86 (patch)
treec740f0812cd3e34726c1c768f6008d375c5d68a5 /sys/kern
parentdd18b40e3fd648d6d36b7b384929832ec0177168 (diff)
downloadFreeBSD-src-60ad9560502beabab095c9441389f5ad42ab0d86.zip
FreeBSD-src-60ad9560502beabab095c9441389f5ad42ab0d86.tar.gz
Restore support for executing BSD/OS binaries on the i386 by passing
the address of the ps_strings structure to the process via %ebx. For other kinds of binaries, %ebx is still zeroed as before. Submitted by: Thomas Stephens <tas@stephens.org> Reviewed by: jdp
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_aout.c5
-rw-r--r--sys/kern/kern_exec.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 871efe8..0092aeb 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_aout.c,v 1.47 1999/03/04 18:04:40 alc Exp $
+ * $Id: imgact_aout.c,v 1.48 1999/03/10 07:07:42 alc Exp $
*/
#include <sys/param.h>
@@ -119,6 +119,9 @@ exec_aout_imgact(imgp)
case QMAGIC:
virtual_offset = PAGE_SIZE;
file_offset = 0;
+ /* Pass PS_STRINGS for BSD/OS binaries only. */
+ if (N_GETMID(*a_out) == MID_ZERO)
+ imgp->ps_strings = PS_STRINGS;
break;
default:
/* NetBSD compatibility */
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index f961a3a..c96055d 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_exec.c,v 1.95 1999/01/28 00:57:47 dillon Exp $
+ * $Id: kern_exec.c,v 1.96 1999/02/19 14:25:34 luoqi Exp $
*/
#include <sys/param.h>
@@ -117,6 +117,7 @@ execve(p, uap)
imgp->auxargs = NULL;
imgp->vp = NULL;
imgp->firstpage = NULL;
+ imgp->ps_strings = 0;
/*
* Allocate temporary demand zeroed space for argument and
@@ -309,8 +310,9 @@ interpret:
/* clear "fork but no exec" flag, as we _are_ execing */
p->p_acflag &= ~AFORK;
- /* Set entry address */
- setregs(p, imgp->entry_addr, (u_long)(uintptr_t)stack_base);
+ /* Set values passed into the program in registers. */
+ setregs(p, imgp->entry_addr, (u_long)(uintptr_t)stack_base,
+ imgp->ps_strings);
exec_fail_dealloc:
OpenPOWER on IntegriCloud