From 0b298f8be44c7ee2f532e823a16cba9397ddf551 Mon Sep 17 00:00:00 2001 From: Gene Cumm Date: Sun, 6 Mar 2011 17:17:01 -0500 Subject: [PATCH] diag/: Add Makefile,README here and mbr/ --- diag/Makefile | 4 ++++ diag/README | 4 ++++ diag/mbr/Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ diag/mbr/README | 15 +++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 diag/Makefile create mode 100644 diag/README create mode 100644 diag/mbr/Makefile create mode 100644 diag/mbr/README diff --git a/diag/Makefile b/diag/Makefile new file mode 100644 index 0000000..4604454 --- /dev/null +++ b/diag/Makefile @@ -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 index 0000000..35dd1e0 --- /dev/null +++ b/diag/README @@ -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 index 0000000..b13ed80 --- /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 0000000..390f51d --- /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 -- 2.7.4