summaryrefslogtreecommitdiff
path: root/sys/arch/socppc
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-02-15 13:43:25 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-02-15 13:43:25 +0000
commit14f4f9628dd78633323432a5a9c720e42699e212 (patch)
tree4ff9bd76872d017c5337dd0d24bd364d95dcc440 /sys/arch/socppc
parentb42c92a1c79f2b6fd29b1915620574b75c69567f (diff)
MBR for rb600 installation miniroot image.
Diffstat (limited to 'sys/arch/socppc')
-rw-r--r--sys/arch/socppc/stand/mbr/Makefile31
-rw-r--r--sys/arch/socppc/stand/mbr/mbr.S34
2 files changed, 65 insertions, 0 deletions
diff --git a/sys/arch/socppc/stand/mbr/Makefile b/sys/arch/socppc/stand/mbr/Makefile
new file mode 100644
index 00000000000..7d6e19be453
--- /dev/null
+++ b/sys/arch/socppc/stand/mbr/Makefile
@@ -0,0 +1,31 @@
+# $OpenBSD: Makefile,v 1.1 2010/02/15 13:43:24 kettenis Exp $
+
+.include <bsd.own.mk>
+
+NOMAN=
+#MAN= mbr.8
+
+.if ${MACHINE} == "socppc"
+PROG= mbr.mini
+SRCS= mbr.S
+AFLAGS+=-I${.OBJDIR} -I${.CURDIR}/../../.. #-Wa,a
+LDFLAGS+=-N -e start -Ttext 0
+OBJCOPY?=objcopy
+
+INSTALL_STRIP=
+S= ${.CURDIR}/../../../..
+
+${PROG}: $(OBJS) $(DPADD)
+ $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LDADD)
+ @size $(PROG)
+ @if [ -x ${.OBJDIR}/${PROG} ]; then \
+ ${OBJCOPY} -O binary ${PROG} ${.OBJDIR}/.tmp;\
+ mv -f ${.OBJDIR}/.tmp ${.OBJDIR}/${PROG}; \
+ ls -l ${.OBJDIR}/${PROG}; \
+ fi
+
+.else
+NOPROG=
+.endif
+
+.include <bsd.prog.mk>
diff --git a/sys/arch/socppc/stand/mbr/mbr.S b/sys/arch/socppc/stand/mbr/mbr.S
new file mode 100644
index 00000000000..4da867aab49
--- /dev/null
+++ b/sys/arch/socppc/stand/mbr/mbr.S
@@ -0,0 +1,34 @@
+#include <machine/asm.h>
+
+ENTRY(start)
+ nop
+
+/* space for mbr_dsn */
+ . = _C_LABEL(start) + 0x1b4
+ .long 0
+
+/* mbr_bootsel_magic */
+ . = _C_LABEL(start) + 0x1b8
+ .word 0
+
+/*
+ * MBR partition table
+ */
+ . = _C_LABEL(start) + 0x1be
+_pbr_part0:
+ .byte 0x80, 1, 1, 0, 0x27, 9, 8, 0
+ .byte 0x3f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
+_pbr_part1:
+ .byte 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0
+_pbr_part2:
+ .byte 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0
+_pbr_part3:
+ .byte 0, 9, 9, 0, 0xa6, 15, 63, 7
+ .byte 0x3f, 0x02, 0x00, 0x00, 0x41, 0x1d, 0x00, 0x00
+
+ . = _C_LABEL(start) + 0x1fe
+magic:
+ .word 0x55aa
+mbr_end: