summaryrefslogtreecommitdiff
path: root/diag/mbr
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2011-03-06 17:17:01 -0500
committerGene Cumm <gene.cumm@gmail.com>2011-03-09 21:07:03 -0500
commit0b298f8be44c7ee2f532e823a16cba9397ddf551 (patch)
treee9268009590c5deb1f2b84c52962b3dd5cdae1ee /diag/mbr
parentbc7b9f773a6336ec5428df928e9682479efc4622 (diff)
downloadsyslinux-0b298f8be44c7ee2f532e823a16cba9397ddf551.tar.gz
diag/: Add Makefile,README here and mbr/
Diffstat (limited to 'diag/mbr')
-rw-r--r--diag/mbr/Makefile45
-rw-r--r--diag/mbr/README15
2 files changed, 60 insertions, 0 deletions
diff --git a/diag/mbr/Makefile b/diag/mbr/Makefile
new file mode 100644
index 00000000..b13ed806
--- /dev/null
+++ b/diag/mbr/Makefile
@@ -0,0 +1,45 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
+## Copyright 2009 Intel Corporation; author: H. Peter Anvin
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# Makefile for MBR
+#
+
+topdir = ../..
+mbrdir = $(topdir)/mbr
+include $(topdir)/MCONFIG.embedded
+
+all: handoff.bin
+
+%.o: %.S
+ $(CC) $(MAKEDEPS) $(SFLAGS) -Wa,-a=$*.lst -c -o $@ $<
+
+.PRECIOUS: %.elf
+%.elf: %.o $(mbrdir)/mbr.ld
+ $(LD) $(LDFLAGS) -T $(mbrdir)/mbr.ld -e _start -o $@ $<
+
+%.bin: %.elf $(mbrdir)/checksize.pl
+ $(OBJCOPY) -O binary $< $@
+ $(CHMOD) -x $@
+
+mbr_bin.c: mbr.bin
+
+tidy dist:
+ rm -f *.o *.elf *.lst .*.d
+
+clean: tidy
+
+spotless: clean
+ rm -f *.bin
+
+-include .*.d
diff --git a/diag/mbr/README b/diag/mbr/README
new file mode 100644
index 00000000..390f51d0
--- /dev/null
+++ b/diag/mbr/README
@@ -0,0 +1,15 @@
+Diagnostic MBR/VBR files
+
+handoff.bin Show the data that the BIOS/MBR hands off to an MBR/VBR.
+
+
+ +++ USAGE +++
+
+Writing out an MBR is straight forward (it is assumed below that /dev/hda is the target raw device and /dev/hda1 is the target partition):
+
+ dd bs=440 conv=notrunc count=1 if=mbr.bin of=/dev/hda
+
+Writing a VBR to match Syslinux requires more work as it must have a jump and be offset into the partition:
+
+ echo -en "\0353\0130\0220" |dd conv=notrunc bs=1 count=3 of=/dev/hda1
+ dd conv=notrunc bs=2 count=210 seek=45 if=mbr.bin of=/dev/hda1