From: niklas Date: Tue, 25 Mar 1997 17:05:49 +0000 (+0000) Subject: Fixed obj-dir building, compacted the bootblock enough to fit (at least) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=20cc22326e1688920271d097887fac9ed5efc618;p=openbsd Fixed obj-dir building, compacted the bootblock enough to fit (at least) the HD one, floppy is still too large. Added our BOOT_CONFIG -c option. Some small style nits. --- diff --git a/sys/arch/amiga/stand/boot/Makefile b/sys/arch/amiga/stand/boot/Makefile index 79cd0b85032..3cbdd4ee54e 100644 --- a/sys/arch/amiga/stand/boot/Makefile +++ b/sys/arch/amiga/stand/boot/Makefile @@ -1,42 +1,47 @@ -# $OpenBSD: Makefile,v 1.2 1997/03/22 00:19:56 niklas Exp $ +# $OpenBSD: Makefile,v 1.3 1997/03/25 17:05:49 niklas Exp $ NOPROG= installboot MAN=installboot.8 SUBDIR=aout2bb txlt -TXLT=txlt/txlt +AOUT2BB!=cd $(.CURDIR)/aout2bb; \ + printf "xxx:\n\techo \$${.OBJDIR}/aout2bb\n" | \ + ${MAKE} -r -s -f - xxx | grep aout2bb -OBJS = configure.o main.o -OBJS += console.o xd.o +TXLT!= cd $(.CURDIR)/txlt; \ + printf "xxx:\n\techo \$${.OBJDIR}/txlt\n" | \ + ${MAKE} -r -s -f - xxx | grep txlt + +OBJS= configure.o main.o +OBJS+= console.o xd.o # libsa library replacements: -OBJS += alloc.o printf.o twiddle.o +OBJS+= alloc.o printf.o twiddle.o # libkern replacements: -OBJS += bcopy.o bzero.o ashrdi3.o muldi3.o +OBJS+= bcopy.o ashrdi3.o muldi3.o # machine language startup code: -OBJS += startit.o +OBJS+= startit.o -SRCS = installboot.sh configure.c main.c console.c xd.c -SRCS+= twiddle.c -SRCS+= bbstart.s libstubs.s alloc.s printf.s startit.s -SRCS+= bcopy.s bzero.c ashrdi3.s muldi3.s +SRCS= installboot.sh configure.c main.c console.c xd.c twiddle.c +SRCS+= bbstart.s libstubs.s alloc.s printf.s startit.s +SRCS+= bcopy.s ashrdi3.s muldi3.s -CLEANFILES = $(OBJS) $(BOOTBLOCKS) x.out xxstart.s f.out fdstart.s +CLEANFILES= $(OBJS) $(BOOTBLOCKS) x.out xxstart.s f.out fdstart.s -S= ${.CURDIR}/../../../.. -INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa -COPTIM= -O2 -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 -Wa,-m68030 -CFLAGS = ${COPTIM} ${INCPATH} ${DEFS} -COPTS += -Wall -Wstrict-prototypes +S= ${.CURDIR}/../../../.. +INCPATH= -I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa +COPTIM= -O -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 \ + -Wa,-m68030 +CFLAGS= ${COPTIM} ${INCPATH} ${DEFS} +COPTS+= -Wall -Wstrict-prototypes -BOOTBLOCKS=xxboot # XXX fdboot is too large at the moment. +BOOTBLOCKS= xxboot # XXX fdboot is too large at the moment. .s.o: - $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $*.o -c \ - ${.CURDIR}/$*.s + $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $*.o -c $< #libs: @@ -69,11 +74,11 @@ $(BOOTBLOCKS): aout2bb xxboot: x.out rm -f $@ - aout2bb/aout2bb x.out $@ || nm -u x.out + ${AOUT2BB} x.out $@ || nm -u x.out fdboot: f.out rm -f $@ - aout2bb/aout2bb -F f.out $@ || nm -u f.out + ${AOUT2BB} -F f.out $@ || nm -u f.out clean:: rm -f $(OBJS) fdstart.[os] xxstart.[os] f.out x.out installboot diff --git a/sys/arch/amiga/stand/boot/bzero.c b/sys/arch/amiga/stand/boot/bzero.c deleted file mode 100644 index 11192df59a5..00000000000 --- a/sys/arch/amiga/stand/boot/bzero.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * $OpenBSD: bzero.c,v 1.1 1997/01/16 09:26:30 niklas Exp $ - * $NetBSD: bzero.c,v 1.1.1.1 1996/11/29 23:36:29 is Exp $ - * - * Copyright (c) 1996 Ignatios Souvatzis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ignatios Souvatzis - * for the NetBSD project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Lightweight bzero. - */ - -#include -#include - -void -bzero(p, len) - void *p; - size_t len; -{ - char *s = p; - while (len > 0) { - *s++ = 0; - --len; - } -} diff --git a/sys/arch/amiga/stand/boot/libsa/Makefile b/sys/arch/amiga/stand/boot/libsa/Makefile index f6a3ee7fa06..68b62bc3a59 100644 --- a/sys/arch/amiga/stand/boot/libsa/Makefile +++ b/sys/arch/amiga/stand/boot/libsa/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 1997/01/16 09:26:53 niklas Exp $ +# $OpenBSD: Makefile,v 1.2 1997/03/25 17:05:57 niklas Exp $ # $NetBSD: Makefile,v 1.1.1.1 1996/11/29 23:36:30 is Exp $ LIB= sa @@ -7,7 +7,9 @@ DIR_SA = ${.CURDIR}/../../../../../lib/libsa DIR_KERN = ${.CURDIR}/../../../../../lib/libkern DIR_KERN_MD = ${.CURDIR}/../../../../../lib/libkern/arch/$(MACHINE_ARCH) -TXLT = ${.CURDIR}/../txlt/txlt +TXLT!= cd $(.CURDIR)/../txlt; \ + printf "xxx:\n\techo \$${.OBJDIR}/txlt\n" | \ + ${MAKE} -r -s -f - xxx | grep txlt .PATH: $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) @@ -18,7 +20,7 @@ CFLAGS+=-O2 -fomit-frame-pointer -fno-function-cse -m68060 -Wa,-l -Wa,-m68030 CFLAGS+=$(COPTS) # stand routines -SRCS= gets.c +SRCS= gets.c memset.c # memcpy.c bcopy.c strerror.c # io routines @@ -30,7 +32,7 @@ SRCS+= close.c lseek.c open.c read.c dev.c SRCS+= ufs.c # kernlib routines -SRCS+= strlen.S strcmp.S +SRCS+= strlen.S strcmp.S strncpy.S #$(DIR_KERN)/bcmp.c diff --git a/sys/arch/amiga/stand/boot/main.c b/sys/arch/amiga/stand/boot/main.c index 431468423bf..9f7e78f71ac 100644 --- a/sys/arch/amiga/stand/boot/main.c +++ b/sys/arch/amiga/stand/boot/main.c @@ -1,5 +1,5 @@ /* - * $OpenBSD: main.c,v 1.1 1997/01/16 09:26:38 niklas Exp $ + * $OpenBSD: main.c,v 1.2 1997/03/25 17:05:53 niklas Exp $ * $NetBSD: main.c,v 1.1.1.1 1996/11/29 23:36:29 is Exp $ * * @@ -79,7 +79,7 @@ int get_cpuid __P((u_int32_t *)); static long get_number(char **); const char version[] = "2.0"; -char default_command[] = "openbsd -Sn2"; +char default_command[] = "bsd -Sn2"; int pain() @@ -97,7 +97,6 @@ pain() int Z_flag = 0; int m_value = 0; int S_flag = 0; - int t_flag = 0; long stringsz; u_int32_t fmem = 0x0; @@ -105,6 +104,9 @@ pain() int cmemsz = 0x0; int eclock = SysBase->EClockFreq; /* int skip_chipmem = 0; */ +#if 0 + const char *memt; +#endif void (*start_it)(void *, u_long, u_long, void *, u_long, u_long, int, void *, int, int, u_long, u_long, int) = startit; @@ -132,13 +134,12 @@ pain() */ if (SysBase->LibNode.Version < EXECMIN) { - printf("Exec V%ld, need V%ld\n", + printf("Exec V%ld < V%ld\n", (long)SysBase->LibNode.Version, (long)EXECMIN); goto out; } - printf("\2337mOpenBSD/Amiga bootblock %s\2330m\n%s :- ", - version, kernel_name); + printf("\2337mOpenBSD/Amiga %s\2330m\n%s : ",version, kernel_name); timelimit = 3; gets(linebuf); @@ -164,8 +165,8 @@ pain() case 'b': /* ask for root device */ boothowto |= RB_ASKNAME; break; - case 'c': /* force machine model */ - cpuid = get_number(&path) << 16; + case 'c': + boothowto |= RB_CONFIG; break; case 'k': /* Reserve first 4M fastmem */ k_flag++; @@ -183,20 +184,18 @@ pain() case 's': /* single-user state */ boothowto |= RB_SINGLE; break; - case 't': /* test flag */ - t_flag = 1; - break; case 'A': /* enable AGA modes */ amiga_flags |= 1; break; + case 'C': /* force machine model */ + cpuid = get_number(&path) << 16; + break; case 'D': /* enter Debugger */ boothowto |= RB_KDB; break; case 'I': /* inhibit sync negotiation */ I_flag = get_number(&path); break; - case 'K': /* remove 1st 4MB fastmem */ - break; case 'S': /* include debug symbols */ S_flag = 1; break; @@ -364,7 +363,7 @@ pain() kvers = (u_short *)(kp + eh->a_entry - 2); if (*kvers > KERNEL_STARTUP_VERSION_MAX && *kvers != 0x4e73) { - printf("\nnewer bootblock required: %ld\n", (long)*kvers); + printf("\nbootblock < V%ld\n", (long)*kvers); goto freeall; } #if 0 @@ -422,9 +421,9 @@ pain() (char *)startit_end - (char *)startit); CacheClearU(); (caddr_t)start_it = kp + ksize + 256; - printf("*** Loading from %08lx to Fastmem %08lx ***\n", - (u_long)kp, (u_long)fmem); - /* sleep(2); */ +#if 0 + memt = "fast"; +#endif } else { /* * Either the kernel doesn't suppport loading directly to @@ -432,13 +431,20 @@ pain() * fits into chipmem. */ if (ksize >= cmemsz) { - printf("Kernel size %d exceeds Chip Memory of %d\n", + printf("Kernel size %d > chipmem size %d\n", ksize, cmemsz); return 20; } Z_flag = 1; - printf("*** Loading from %08lx to Chipmem ***\n", (u_long)kp); +#if 0 + memt = "chip"; + fmem = 0; +#endif } +#if 0 + printf("Loading %08lx to %smem %08lx\n", (u_long)kp, memt, + (u_long)fmem); +#endif #if 0 printf("would start(kp=0x%lx, ksize=%ld, entry=0x%lx,\n" @@ -461,7 +467,7 @@ freeall: free(kp, ksize); free(eh, sizeof(*eh)); err: - printf("\nError %ld\n", (long)errno); + printf("\nErr %ld\n", (long)errno); close(io); out: timelimit = 10; @@ -486,10 +492,7 @@ char **ptr; sign = -1; c = *++p; } - if (c == '$') { - base = 16; - c = *++p; - } else if (c == '0') { + if (c == '0') { c = *++p; if ((c & 0xdf) == 'X') { base = 16; @@ -539,8 +542,7 @@ get_cpuid(cpuid) case 4000: return 0; default: - printf("Amiga %ld ???\n", - (long)(*cpuid >> 16)); + printf("A%ld?\n", (long)(*cpuid >> 16)); return(1); } } diff --git a/sys/arch/amiga/stand/boot/startit.s b/sys/arch/amiga/stand/boot/startit.s index a8dd10c9c2f..7e323fe330d 100644 --- a/sys/arch/amiga/stand/boot/startit.s +++ b/sys/arch/amiga/stand/boot/startit.s @@ -1,4 +1,4 @@ -/* $OpenBSD: startit.s,v 1.1 1997/01/16 09:26:41 niklas Exp $ */ +/* $OpenBSD: startit.s,v 1.2 1997/03/25 17:05:55 niklas Exp $ */ /* $NetBSD: startit.s,v 1.1.1.1 1996/11/29 23:36:29 is Exp $ */ /* @@ -30,9 +30,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * From: $NetBSD: startit.s,v 1.1.1.1 1996/11/29 23:36:29 is Exp $ */ .set ABSEXECBASE,4