Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/atari/stand/bootxxx 3rd level boot
details: https://anonhg.NetBSD.org/src/rev/ef795e6cd079
branches: trunk
changeset: 516026:ef795e6cd079
user: leo <leo%NetBSD.org@localhost>
date: Sat Oct 13 20:06:57 2001 +0000
description:
3rd level boot
diffstat:
sys/arch/atari/stand/bootxxx/Makefile | 72 ++++++++++++++++++++++
sys/arch/atari/stand/bootxxx/bootxxx.c | 99 +++++++++++++++++++++++++++++++
sys/arch/atari/stand/bootxxx/filesystem.c | 41 ++++++++++++
3 files changed, 212 insertions(+), 0 deletions(-)
diffs (224 lines):
diff -r 72f899799197 -r ef795e6cd079 sys/arch/atari/stand/bootxxx/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/atari/stand/bootxxx/Makefile Sat Oct 13 20:06:57 2001 +0000
@@ -0,0 +1,72 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/10/13 20:06:57 leo Exp $
+
+# for OBJECT_FMT
+.include <bsd.own.mk>
+
+PROG= boot
+#
+# Warning: bootxxx.c should be the first source!
+#
+SRCS= bootxxx.c aout.c bsdstart.s elf.c filesystem.c sysinfo.c
+MKMAN= no
+
+STRIPFLAG=
+BINDIR= /
+BINMODE=${NONBINMODE}
+
+LIBCRT0=
+
+DEFS= -D_STANDALONE -DHEAP_VARIABLE
+INCL= -I. -I${S_LIBTOS} -I${S_MACHSA} -I${S_KERN} -I${S_SA} -I${S}
+
+CPPFLAGS+= ${DEFS} ${INCL}
+CFLAGS+= -fomit-frame-pointer -Wall -fno-function-cse -fstrength-reduce
+.if ${OBJECT_FMT} == "ELF"
+LDFLAGS= -static -nostdlib -Wl,-x,-N,-e,bootxxx,-Ttext,${LOADADDR3}
+.else
+LDFLAGS= -static -nostdlib -Wl,-N,-Ttext,${LOADADDR3}
+.endif
+
+# logically src/sys
+S=${.CURDIR}/../../../..
+S_SA=${S}/lib/libsa
+S_KERN=${S}/lib/libkern
+S_MACHSA=${S}/arch/atari/stand/libsa
+S_LIBTOS=${S}/arch/atari/stand/tostools/libtos
+
+.if exists(${S_MACHSA}/libsa.a)
+LIBSA=${S_MACHSA}/libsa.a
+.else
+. if exists(${S_MACHSA}/obj/libsa.a)
+LIBSA=${S_MACHSA}/obj/libsa.a
+. else
+LIBSA=${S_MACHSA}/obj.${MACHINE}/libsa.a
+. endif
+.endif
+
+DPADD= ${LIBSA}
+LDADD= ${LIBSA}
+
+beforeinstall:
+ ${OBJCOPY} -O binary ${PROG} ${PROG}X
+ @mv -f ${PROG} ${PROG}XX
+ @mv -f ${PROG}X ${PROG};
+
+afterinstall:
+ @mv -f ${PROG}XX ${PROG}
+
+.s.o:
+ ${CPP} ${CPPFLAGS} ${.IMPSRC} | ${AS} ${ASFLAGS} -o ${.TARGET}
+
+.c.o:
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+
+${PROG}:
+ ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
+
+${PROG}: ../xxboot/LOADADDR
+
+.PATH: ${S_LIBTOS}
+
+.include "../xxboot/LOADADDR"
+.include <bsd.prog.mk>
diff -r 72f899799197 -r ef795e6cd079 sys/arch/atari/stand/bootxxx/bootxxx.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/atari/stand/bootxxx/bootxxx.c Sat Oct 13 20:06:57 2001 +0000
@@ -0,0 +1,99 @@
+/* $NetBSD: bootxxx.c,v 1.1.1.1 2001/10/13 20:06:57 leo Exp $ */
+
+/*
+ * Copyright (c) 2001 Leo Weppelman.
+ * Copyright (c) 1995 Waldi Ravens.
+ * 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 Waldi Ravens.
+ * 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.
+ */
+
+#define boot_BSD bsd_startup
+
+#include <stand.h>
+#include <atari_stand.h>
+#include <string.h>
+#include <libkern.h>
+#include <sys/boot_flag.h>
+#include <sys/reboot.h>
+#include <machine/cpu.h>
+#include <kparamb.h>
+#include <libtos.h>
+#include <tosdefs.h>
+
+void boot_BSD __P((struct kparamb *)__attribute__((noreturn)));
+
+int
+bootxxx(readsector, disklabel, od)
+ void *readsector,
+ *disklabel;
+ osdsc_t *od;
+{
+ int fd;
+ char *errmsg;
+ extern char end[], edata[];
+
+ bzero(edata, end - edata);
+
+ /* XXX: Limit should be 16MB */
+ setheap(end, (void*)0x1000000);
+ printf("\033v\nNetBSD/Atari tertiary bootloader "
+ "($Revision: 1.1.1.1 $)\n\n");
+
+ if (init_dskio(readsector, disklabel, od->rootfs))
+ return(-1);
+
+ sys_info(od);
+ if (!(od->cputype & ATARI_ANYCPU)) {
+ printf("Unknown CPU-type.\n");
+ return(-2);
+ }
+
+ if ((fd = open(od->osname, 0)) < 0) {
+ printf("Cannot open kernel '%s'\n", od->osname);
+ return (-3);
+ }
+
+#ifndef __ELF__ /* a.out */
+ if (aout_load(fd, od, &errmsg, 1) != 0)
+#else
+ if (elf_load(fd, od, &errmsg, 1) != 0)
+#endif
+ return(-4);
+
+ boot_BSD(&od->kp);
+ return(-5);
+
+ /* NOTREACHED */
+}
+
+void
+_rtt()
+{
+ printf("Halting...\n");
+ for(;;)
+ ;
+}
diff -r 72f899799197 -r ef795e6cd079 sys/arch/atari/stand/bootxxx/filesystem.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/atari/stand/bootxxx/filesystem.c Sat Oct 13 20:06:57 2001 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: filesystem.c,v 1.1.1.1 2001/10/13 20:06:57 leo Exp $ */
+
+/*
+ * Copyright (c) 1993 Philip A. Nelson.
+ * 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 Philip A. Nelson.
+ * 4. The name of Philip A. Nelson may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PHILIP NELSON ``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 PHILIP NELSON 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.
+ */
+
+#include <stand.h>
+#include <ufs.h>
+
+struct fs_ops file_system[] = {
+ { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
+};
+
+int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
Home |
Main Index |
Thread Index |
Old Index