summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2015-05-18 19:07:16 +0200
committerKevin O'Connor <kevin@koconnor.net>2015-06-01 12:11:36 -0400
commit1b911d7aed7b0b2db5738d02a3c6964cdf895944 (patch)
treedaddc95d4319f10f36f29c73485d4d4b3e15f84c /scripts
parent67643955c7467781c28c4da1669775d7564dc74a (diff)
downloadqemu-seabios-1b911d7aed7b0b2db5738d02a3c6964cdf895944.tar.gz
Add multiboot support.
I've been successfully using SeaBIOS as secondary bootloader. In more details I have GRUB2-as-payload in flash together with coreboot. SeaBIOS binary is on the HDD and loaded by GRUB when needed. This has an unfortunate consequence that I have to keep vga oprom in flash even if usually I boot without it. This patches makes bios.bin.elf multiboot executable with files passed as modules. Example: menuentry "SeaBIOS (mb)" --unrestricted { root=ahci0,2 multiboot /bios.bin.elf module /vgabios_x230.rom name=pci8086,0166.rom } the parameter name= specifies under which name SeaBIOS will see it. Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/layoutrom.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
index dd770fe..b976fb0 100755
--- a/scripts/layoutrom.py
+++ b/scripts/layoutrom.py
@@ -161,6 +161,7 @@ def getSectionsPrefix(sections, prefix):
# The sections (and associated information) to be placed in output rom
class LayoutInfo:
sections = None
+ config = None
genreloc = None
sec32init_start = sec32init_end = sec32init_align = None
sec32low_start = sec32low_end = None
@@ -172,6 +173,7 @@ class LayoutInfo:
# Determine final memory addresses for sections
def doLayout(sections, config, genreloc):
li = LayoutInfo()
+ li.config = config
li.sections = sections
li.genreloc = genreloc
# Determine 16bit positions
@@ -399,6 +401,10 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
filesections32flat = getSectionsFileid(li.sections, '32flat')
out = outXRefs([], exportsyms=li.varlowsyms
, forcedelta=li.final_sec32low_start-li.sec32low_start)
+ multiboot_header = ""
+ if li.config.get('CONFIG_MULTIBOOT'):
+ multiboot_header = "LONG(0x1BADB002) LONG(0) LONG(-0x1BADB002)"
+ sec32all_start -= 3 * 4
out += outXRefs(filesections32flat, exportsyms=[li.entrysym]) + """
_reloc_min_align = 0x%x ;
zonefseg_start = 0x%x ;
@@ -415,6 +421,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
.text code32flat_start : {
%s
%s
+%s
code32flat_end = ABSOLUTE(.) ;
} :text
""" % (li.sec32init_align,
@@ -428,6 +435,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
li.sec32init_start,
li.sec32init_end,
sec32all_start,
+ multiboot_header,
relocstr,
outRelSections(li.sections, 'code32flat_start'))
out = COMMONHEADER + out + COMMONTRAILER + """