Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diag/: Add Makefile,README here and mbr/
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SUBDIRS = mbr | ||
|
||
all tidy dist clean spotless install: | ||
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |