summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>1997-03-31 05:52:26 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>1997-03-31 05:52:26 +0000
commitc86f8a8453abfe2aa749b020a8cd020c66a84961 (patch)
tree3a844a5786eca6ae0baf1093a7e211603fadaea2 /sys/arch
parent7a9b70598267acb9fa76b3df3e4150d1749e909f (diff)
Move closer to boot/. Add some debug stuff
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/stand/libsa/Makefile4
-rw-r--r--sys/arch/i386/stand/libsa/exec_i386.c45
-rw-r--r--sys/arch/i386/stand/libsa/startprog.S4
3 files changed, 39 insertions, 14 deletions
diff --git a/sys/arch/i386/stand/libsa/Makefile b/sys/arch/i386/stand/libsa/Makefile
index 42b2feed81e..4d9b58bcbfe 100644
--- a/sys/arch/i386/stand/libsa/Makefile
+++ b/sys/arch/i386/stand/libsa/Makefile
@@ -1,11 +1,11 @@
-# $OpenBSD: Makefile,v 1.2 1997/03/31 03:12:08 weingart Exp $
+# $OpenBSD: Makefile,v 1.3 1997/03/31 05:52:24 weingart Exp $
LIB= sa
CFLAGS+=-Wall
#CFLAGS+=-DBIOS_DEBUG
-CFLAGS+=-DEXEC_DEBUG
+#CFLAGS+=-DEXEC_DEBUG
CFLAGS+=-DNO_IDTR
CFLAGS+=-DHEAP_START="0x10000"
CFLAGS+=-DHEAP_LIMIT="0xa0000"
diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c
index 3a437498264..f9eb127a3b9 100644
--- a/sys/arch/i386/stand/libsa/exec_i386.c
+++ b/sys/arch/i386/stand/libsa/exec_i386.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: exec_i386.c,v 1.1 1997/03/31 03:12:13 weingart Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.2 1997/03/31 05:52:25 weingart Exp $ */
#include <sys/param.h>
#include <sys/exec.h>
@@ -13,9 +13,25 @@ machdep_start(startaddr, howto, loadaddr, ssym, esym)
int howto;
{
static int argv[9];
- static int (*x_entry)() = 0;
+ struct exec *x;
+
+
+#ifdef DEBUG
+ x = (void *)loadaddr;
+ printf("exec {\n");
+ printf(" a_midmag = %lx\n", x->a_midmag);
+ printf(" a_text = %lx\n", x->a_text);
+ printf(" a_data = %lx\n", x->a_data);
+ printf(" a_bss = %lx\n", x->a_bss);
+ printf(" a_syms = %lx\n", x->a_syms);
+ printf(" a_entry = %lx\n", x->a_entry);
+ printf(" a_trsize = %lx\n", x->a_trsize);
+ printf(" a_drsize = %lx\n", x->a_drsize);
+ printf("}\n");
+
+ getchar();
+#endif
- x_entry = (void *)startaddr;
(int)startaddr &= 0xffffff;
/*
@@ -25,7 +41,7 @@ machdep_start(startaddr, howto, loadaddr, ssym, esym)
* arg0 = 8 (magic)
* arg1 = boot flags
* arg2 = boot device
- * arg3 = start of symbol table (0 if not loaded)
+ * arg3 = Cylinder offset (XXX - used to be ssym)
* arg4 = end of symbol table (0 if not loaded)
* arg5 = transfer address from image
* arg6 = transfer address for next image pointer
@@ -34,13 +50,22 @@ machdep_start(startaddr, howto, loadaddr, ssym, esym)
*/
argv[0] = 8;
argv[1] = howto;
- argv[2] = 0; /* Boot device */
- argv[3] = 0; /* Cyl offset */
- argv[4] = (int)esym;
+ argv[2] = bootdev; /* Boot device */
+ argv[3] = 0; /* Cyl offset */
+ argv[4] = 0;
argv[5] = (int)startaddr;
- argv[6] = (int)&x_entry;
- argv[7] = 0;
- argv[8] = 0;
+ argv[6] = 0;
+ argv[7] = memsize(0);
+ argv[8] = memsize(1);
+
+#ifdef DEBUG
+ { int i;
+ for(i = 0; i <= argv[0]; i++)
+ printf("argv[%d] = %x\n", i, argv[i]);
+
+ getchar();
+ }
+#endif
/****************************************************************/
/* copy that first page and overwrite any BIOS variables */
diff --git a/sys/arch/i386/stand/libsa/startprog.S b/sys/arch/i386/stand/libsa/startprog.S
index e1f4e267a43..465c8f888a5 100644
--- a/sys/arch/i386/stand/libsa/startprog.S
+++ b/sys/arch/i386/stand/libsa/startprog.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: startprog.S,v 1.1 1997/03/31 03:12:17 weingart Exp $ */
+/* $OpenBSD: startprog.S,v 1.2 1997/03/31 05:52:25 weingart Exp $ */
#include <machine/asm.h>
@@ -32,7 +32,7 @@ ENTRY(startprog)
# push on our entry address
movl $0x8, %ebx # segment
- pushw %bx
+ pushl %bx
pushl %ecx
# convert over the other data segs