diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-05-25 19:20:58 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-05-25 19:20:58 +0000 |
commit | e36ac8f344dc31e3480af70bdd20643561c9fa44 (patch) | |
tree | c80fb47bac0088617073873dd8237f48494db4c7 /sys/arch | |
parent | afbd2fd9b7d385cda50f7b241a5ce94cbb2c3255 (diff) |
put support for test /boot environment back; some CLEANFILES and spaces
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/stand/Makefile.inc | 9 | ||||
-rw-r--r-- | sys/arch/i386/stand/boot/Makefile | 25 | ||||
-rw-r--r-- | sys/arch/i386/stand/boot/crt0.c | 19 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/Makefile | 25 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/cmd_i386.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/dev_i386.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/exec_i386.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/libsa.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/machdep.c | 4 |
9 files changed, 72 insertions, 30 deletions
diff --git a/sys/arch/i386/stand/Makefile.inc b/sys/arch/i386/stand/Makefile.inc index 9c8852115f3..d221c833441 100644 --- a/sys/arch/i386/stand/Makefile.inc +++ b/sys/arch/i386/stand/Makefile.inc @@ -1,9 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.21 1998/04/20 13:25:00 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.22 1998/05/25 19:20:45 mickey Exp $ CFLAGS=${DEBUG} -O2 -Wall -Werror CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} -SACFLAGS=-nostdinc -fno-builtin -fpack-struct -SACFLAGS+=-D_STANDALONE +SACFLAGS=-D_STANDALONE # CPPFLAGS+=-DSAVE_MEMORY # DEBUGFLAGS=-DDEBUG # DEBUGFLAGS+=-DGIDT_DEBUG @@ -21,6 +20,10 @@ BOOTREL=0x60000 BOOTMAGIC=0xdeadbeef #ROM_SIZE=32768 +.if defined(DEBUGFLAGS) && empty(DEBUGFLAGS:M-D_TEST) +SACFLAGS+=-nostdinc -fno-builtin -fpack-struct +.endif + .if exists(${SADIR}/etc/assym.h) CPPFLAGS+=-I${SADIR}/etc .else diff --git a/sys/arch/i386/stand/boot/Makefile b/sys/arch/i386/stand/boot/Makefile index 7e87b880f37..52f89b2a3be 100644 --- a/sys/arch/i386/stand/boot/Makefile +++ b/sys/arch/i386/stand/boot/Makefile @@ -1,12 +1,23 @@ -# $OpenBSD: Makefile,v 1.18 1998/05/19 18:59:11 mickey Exp $ +# $OpenBSD: Makefile,v 1.19 1998/05/25 19:20:47 mickey Exp $ + +.include "${.CURDIR}/../Makefile.inc" PROG= boot -SRCS= srt0.S boot.c cmd.c bootarg.c conf.c -#AFLAGS+=-Wa,-R -# AFLAGS+=-Wa,-a -LD?= ld -LDFLAGS+=-nostdlib -Ttext $(LINKADDR) -z -x -Bstatic +LD=ld SIZE?= size +LDFLAGS+=-nostdlib -Bstatic +CLEANFILES+= i386 machine + +.if defined(DEBUGFLAGS) && !empty(DEBUGFLAGS:M-D_TEST) +CLEANFILES+= srt0.o +SRCS= crt0.c +.else +LDFLAGS+=-Ttext $(LINKADDR) -z -x +CLEANFILES+= crt0.o +SRCS= srt0.S +.endif + +SRCS+= boot.c cmd.c vars.c bootarg.c conf.c MAN= boot.8 MLINKS= boot.8 boot.conf.8 S =${.CURDIR}/../../../.. @@ -32,3 +43,5 @@ ${PROG}: $(OBJS) $(DPADD) CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS} CFLAGS+=$(SACFLAGS) +#AFLAGS+=-Wa,-R +# AFLAGS+=-Wa,-a diff --git a/sys/arch/i386/stand/boot/crt0.c b/sys/arch/i386/stand/boot/crt0.c index 95be8cce3fb..6b9e243aa64 100644 --- a/sys/arch/i386/stand/boot/crt0.c +++ b/sys/arch/i386/stand/boot/crt0.c @@ -1,7 +1,7 @@ -/* $OpenBSD: crt0.c,v 1.2 1997/03/31 23:06:22 mickey Exp $ */ +/* $OpenBSD: crt0.c,v 1.3 1998/05/25 19:20:49 mickey Exp $ */ /* - * Copyright (c) 1997 Michael Shalayeff + * Copyright (c) 1997-1998 Michael Shalayeff * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,10 +39,11 @@ #include <sys/syscall.h> #include <termios.h> #include "libsa.h" -#include "unixdev.h" +#include <lib/libsa/unixdev.h> -extern void start __P((void)) asm("start"); -extern int main __P((int, char **, char **)); +void start __P((void)) asm("start"); +void _rtt __P((void)); +extern int boot __P((dev_t)); static void domap __P((void)); static void seterm __P((void)); @@ -51,7 +52,13 @@ start() { domap(); seterm(); - uexit(main(0, NULL, NULL)); + uexit(boot(0)); +} + +void +_rtt() +{ + uexit(1); } #define ummap(a,l,p,f,fd,o) (caddr_t)syscall((quad_t)SYS_mmap,a,l,p,f,fd,0,o) diff --git a/sys/arch/i386/stand/libsa/Makefile b/sys/arch/i386/stand/libsa/Makefile index 67be2420a55..a12565b7cef 100644 --- a/sys/arch/i386/stand/libsa/Makefile +++ b/sys/arch/i386/stand/libsa/Makefile @@ -1,5 +1,6 @@ -# $OpenBSD: Makefile,v 1.30 1998/02/24 22:06:42 weingart Exp $ +# $OpenBSD: Makefile,v 1.31 1998/05/25 19:20:50 mickey Exp $ +.include "${.CURDIR}/../Makefile.inc" LIB= sa @@ -7,17 +8,24 @@ S=${.CURDIR}/../../../.. SADIR=${.CURDIR}/.. DIR_SA= $S/lib/libsa DIR_KERN=$S/lib/libkern - -#AS=cat ; -#AS+= -R -#AS+= -a +CLEANFILES=i386 machine # i386 stuff (so, it will possibly load in the same 64k) -SRCS= gidt.S debug_i386.S alloca.S \ - machdep.c dev_i386.c exec_i386.c cmd_i386.c \ +SRCS+= machdep.c dev_i386.c exec_i386.c cmd_i386.c + +.if defined(DEBUGFLAGS) && !empty(DEBUGFLAGS:M-D_TEST) +SRCS+= unixdev.c unixsys.S nullfs.c +CLEANFILES+= gidt.o debug_i386.o alloca.o \ + biosdev.o bioscons.o gateA20.o apmprobe.o \ + memprobe.o diskprobe.o pciprobe.o smpprobe.o \ + time.o +.else +SRCS+= gidt.S debug_i386.S alloca.S \ biosdev.c bioscons.c gateA20.c apmprobe.c \ memprobe.c diskprobe.c pciprobe.c smpprobe.c \ time.c +CLEANFILES+= unixdev.o unixsys.o nullfs.o +.endif # stand routines SRCS+= alloc.c exit.c exec.c getfile.c gets.c globals.c strcmp.c strlen.c \ @@ -62,3 +70,6 @@ install: CPPFLAGS+=-DLINKADDR=${LINKADDR} -DHEAP_LIMIT=${HEAP_LIMIT} ${DEBUGFLAGS} CPPFLAGS+=-I${S}/stand/boot CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD +#AS=cat ; +#AS+= -R +#AS+= -a diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c index c294da1be5f..ecf23fba8d9 100644 --- a/sys/arch/i386/stand/libsa/cmd_i386.c +++ b/sys/arch/i386/stand/libsa/cmd_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd_i386.c,v 1.20 1998/02/24 22:06:47 weingart Exp $ */ +/* $OpenBSD: cmd_i386.c,v 1.21 1998/05/25 19:20:51 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff, Tobias Weingartner @@ -32,6 +32,7 @@ * */ +#ifndef _TEST #include <sys/param.h> #include <sys/reboot.h> #include <machine/biosvar.h> @@ -60,8 +61,8 @@ const struct cmd_table cmd_machine[] = { { "diskinfo", CMDT_CMD, Xdiskinfo }, { "memory", CMDT_CMD, Xmemory }, { "regs", CMDT_CMD, Xregs }, - {"cnvmem", CMDT_CMD, Xcnvmem}, - {"extmem", CMDT_CMD, Xextmem}, + { "cnvmem", CMDT_CMD, Xcnvmem}, + { "extmem", CMDT_CMD, Xextmem}, { NULL, 0 } }; @@ -182,3 +183,4 @@ Xmemory() return 0; } +#endif diff --git a/sys/arch/i386/stand/libsa/dev_i386.c b/sys/arch/i386/stand/libsa/dev_i386.c index 50abdad5277..5f1868a80fa 100644 --- a/sys/arch/i386/stand/libsa/dev_i386.c +++ b/sys/arch/i386/stand/libsa/dev_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_i386.c,v 1.20 1998/04/18 07:39:49 deraadt Exp $ */ +/* $OpenBSD: dev_i386.c,v 1.21 1998/05/25 19:20:53 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -47,7 +47,7 @@ const char bdevs[][4] = { const int nbdevs = NENTS(bdevs); const char cdevs[][4] = { - "", "", "", "", "", "", "", "", + "cn", "", "", "", "", "", "", "", "com", "", "", "", "pc" }; const int ncdevs = NENTS(cdevs); diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c index 3f651f6a0f2..75c0b02bffb 100644 --- a/sys/arch/i386/stand/libsa/exec_i386.c +++ b/sys/arch/i386/stand/libsa/exec_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_i386.c,v 1.21 1998/05/18 22:07:29 mickey Exp $ */ +/* $OpenBSD: exec_i386.c,v 1.22 1998/05/25 19:20:54 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -54,6 +54,7 @@ machdep_start(startaddr, howto, loadaddr, ssym, esym) char *startaddr, *loadaddr, *ssym, *esym; int howto; { +#ifndef _TEST dev_t bootdev = bootdev_dip->bootdev; size_t ac = BOOTARG_LEN; caddr_t av = (caddr_t)BOOTARG_OFF; @@ -82,4 +83,5 @@ machdep_start(startaddr, howto, loadaddr, ssym, esym) (*(startfuncp)startaddr)(howto, bootdev, BOOTARG_APIVER, round_to_size(esym), extmem, cnvmem, ac, (int)av); /* not reached */ +#endif } diff --git a/sys/arch/i386/stand/libsa/libsa.h b/sys/arch/i386/stand/libsa/libsa.h index d9148e98684..1d1a633acde 100644 --- a/sys/arch/i386/stand/libsa/libsa.h +++ b/sys/arch/i386/stand/libsa/libsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libsa.h,v 1.24 1998/02/24 22:06:54 weingart Exp $ */ +/* $OpenBSD: libsa.h,v 1.25 1998/05/25 19:20:56 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -59,4 +59,6 @@ extern u_int32_t bios_cksumlen; /* memprobe.c */ extern bios_memmap_t *memory_map; +#ifndef _TEST #define MACHINE_CMD cmd_machine /* we have i386 specific sommands */ +#endif diff --git a/sys/arch/i386/stand/libsa/machdep.c b/sys/arch/i386/stand/libsa/machdep.c index 446d7749d38..99bacc0eee7 100644 --- a/sys/arch/i386/stand/libsa/machdep.c +++ b/sys/arch/i386/stand/libsa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.26 1998/05/16 07:32:19 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.27 1998/05/25 19:20:57 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -51,8 +51,10 @@ void machdep() { /* here */ CKPT('0'); +#ifndef _TEST gateA20(1); CKPT('1'); debug_init(); CKPT('2'); +#endif /* call console init before doing any io */ printf("devices: "); cninit(); CKPT('3'); |