diag/: Add Makefile,README here and mbr/
authorGene Cumm <gene.cumm@gmail.com>
Sun, 6 Mar 2011 22:17:01 +0000 (17:17 -0500)
committerGene Cumm <gene.cumm@gmail.com>
Thu, 10 Mar 2011 02:07:03 +0000 (21:07 -0500)
diag/Makefile [new file with mode: 0644]
diag/README [new file with mode: 0644]
diag/mbr/Makefile [new file with mode: 0644]
diag/mbr/README [new file with mode: 0644]

diff --git a/diag/Makefile b/diag/Makefile
new file mode 100644 (file)
index 0000000..4604454
--- /dev/null
@@ -0,0 +1,4 @@
+SUBDIRS = mbr
+
+all tidy dist clean spotless install:
+       set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
diff --git a/diag/README b/diag/README
new file mode 100644 (file)
index 0000000..35dd1e0
--- /dev/null
@@ -0,0 +1,4 @@
+Diagnostic tools and images to assist with troubleshooting Syslinux-related issues.  See README in each directory for more details.
+
+geodsp/                Display geometry/LBA translation as the BIOS detects it.
+mbr/           Diagnostic MBRs
diff --git a/diag/mbr/Makefile b/diag/mbr/Makefile
new file mode 100644 (file)
index 0000000..b13ed80
--- /dev/null
@@ -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 (file)
index 0000000..390f51d
--- /dev/null
@@ -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