Module Name: src
Committed By: tsutsui
Date: Wed Apr 22 17:13:36 UTC 2009
Modified Files:
src/sys/arch/landisk/stand/boot: Makefile.boot conf.c
src/sys/arch/landisk/stand/bootxx: Makefile.bootxx
Added Files:
src/sys/arch/landisk/stand/bootxx: bios.S
src/sys/arch/landisk/stand/bootxx/bootxx_ustarfs: Makefile
Log Message:
Add ustarfs boot support.
This will be useful for disk size independent bootstrap installation image.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/landisk/stand/boot/Makefile.boot \
src/sys/arch/landisk/stand/boot/conf.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/landisk/stand/bootxx/Makefile.bootxx
cvs rdiff -u -r0 -r1.1 src/sys/arch/landisk/stand/bootxx/bios.S
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/landisk/stand/bootxx/bootxx_ustarfs/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/landisk/stand/boot/Makefile.boot
diff -u src/sys/arch/landisk/stand/boot/Makefile.boot:1.2 src/sys/arch/landisk/stand/boot/Makefile.boot:1.3
--- src/sys/arch/landisk/stand/boot/Makefile.boot:1.2 Tue Apr 21 15:17:58 2009
+++ src/sys/arch/landisk/stand/boot/Makefile.boot Wed Apr 22 17:13:36 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.boot,v 1.2 2009/04/21 15:17:58 tsutsui Exp $
+# $NetBSD: Makefile.boot,v 1.3 2009/04/22 17:13:36 tsutsui Exp $
PROG?= boot
@@ -20,6 +20,7 @@
CPPFLAGS= -DSUPPORT_FFSv1
CPPFLAGS+= -DSUPPORT_FFSv2
CPPFLAGS+= -DSUPPORT_DOSFS
+CPPFLAGS+= -DSUPPORT_USTARFS
CPPFLAGS+= -DDBMONITOR
#CPPFLAGS+= -DDEBUG
Index: src/sys/arch/landisk/stand/boot/conf.c
diff -u src/sys/arch/landisk/stand/boot/conf.c:1.2 src/sys/arch/landisk/stand/boot/conf.c:1.3
--- src/sys/arch/landisk/stand/boot/conf.c:1.2 Tue Apr 21 15:17:58 2009
+++ src/sys/arch/landisk/stand/boot/conf.c Wed Apr 22 17:13:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.2 2009/04/21 15:17:58 tsutsui Exp $ */
+/* $NetBSD: conf.c,v 1.3 2009/04/22 17:13:36 tsutsui Exp $ */
/*
* Copyright (c) 1996
@@ -38,6 +38,7 @@
#include <lib/libsa/ufs.h>
#include <lib/libsa/dosfs.h>
+#include <lib/libsa/ustarfs.h>
#include "biosdisk.h"
@@ -57,5 +58,8 @@
#ifdef SUPPORT_DOSFS
FS_OPS(dosfs),
#endif
+#ifdef SUPPORT_USTARFS
+ FS_OPS(ustarfs),
+#endif
};
int nfsys = sizeof(file_system) / sizeof(file_system[0]);
Index: src/sys/arch/landisk/stand/bootxx/Makefile.bootxx
diff -u src/sys/arch/landisk/stand/bootxx/Makefile.bootxx:1.2 src/sys/arch/landisk/stand/bootxx/Makefile.bootxx:1.3
--- src/sys/arch/landisk/stand/bootxx/Makefile.bootxx:1.2 Fri Apr 3 10:38:13 2009
+++ src/sys/arch/landisk/stand/bootxx/Makefile.bootxx Wed Apr 22 17:13:36 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.bootxx,v 1.2 2009/04/03 10:38:13 tsutsui Exp $
+# $NetBSD: Makefile.bootxx,v 1.3 2009/04/22 17:13:36 tsutsui Exp $
PROG?= bootxx_${FS}
@@ -7,6 +7,10 @@
SRCS= pbr.S label.S bootxx.S boot1.c
+.if ${FS} == ustarfs
+SRCS+= bios.S
+.endif
+
LDFLAGS+= -e start
CFLAGS=
Added files:
Index: src/sys/arch/landisk/stand/bootxx/bios.S
diff -u /dev/null src/sys/arch/landisk/stand/bootxx/bios.S:1.1
--- /dev/null Wed Apr 22 17:13:36 2009
+++ src/sys/arch/landisk/stand/bootxx/bios.S Wed Apr 22 17:13:36 2009
@@ -0,0 +1,62 @@
+/* $NetBSD: bios.S,v 1.1 2009/04/22 17:13:36 tsutsui Exp $ */
+
+/*-
+ * Copyright (c) 2005 NONAKA Kimihiro
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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 <machine/asm.h>
+
+/*
+ * int getchar(void);
+ */
+ENTRY(getchar)
+ mov #0, r4
+ mov #1, r0
+ trapa #0x3f
+ rts
+ nop
+
+/*
+ * void putchar(int c);
+ */
+ENTRY(putchar)
+ mov #31, r0
+ trapa #0x3f
+ rts
+ nop
+
+/*
+ * __dead void _rtt(void);
+ */
+ENTRY(_rtt)
+ mov #1, r4 /* reboot */
+ mov #11, r0
+ trapa #0x3f
+ mov.l .L.start, r0
+ jmp @r0
+ nop
+
+.L.start:
+ .long 0xc0000000
Index: src/sys/arch/landisk/stand/bootxx/bootxx_ustarfs/Makefile
diff -u /dev/null src/sys/arch/landisk/stand/bootxx/bootxx_ustarfs/Makefile:1.1
--- /dev/null Wed Apr 22 17:13:36 2009
+++ src/sys/arch/landisk/stand/bootxx/bootxx_ustarfs/Makefile Wed Apr 22 17:13:36 2009
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile,v 1.1 2009/04/22 17:13:36 tsutsui Exp $
+
+FS=ustarfs
+
+BOOTXX_SECTORS=16
+
+.include "../Makefile.bootxx"