aboutsummaryrefslogtreecommitdiff
path: root/scripts/layoutrom.py
AgeCommit message (Collapse)AuthorFilesLines
2021-06-04Increase BUILD_MIN_BIOSTABLE for large romsGerd Hoffmann1-0/+4
BUILD_MIN_BIOSTABLE reserves space in the f-segment. Some data structures -- for example disk drives known to seabios -- must be stored there, so the space available here limits the number of devices seabios is able to manage. This patch sets BUILD_MIN_BIOSTABLE to 8k for bios images being 256k or larger in size. 32bit code is moved off in that case, so we have more room in the f-segment then. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-02-19build: fix .text section address alignmentKevin O'Connor1-4/+10
Some linkers verify that sections have a start address that is aligned with the minimum alignment of that section. Add extra padding to the ".text" section to ensure it is always aligned with the maximum alignment of any section placed in ".text". Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reported by: Ed Maste <emaste@FreeBSD.org>
2015-06-01Add multiboot support.Vladimir Serbinenko1-0/+8
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>
2014-10-11build: Support declaring 32bit C functions that must reside in the f-segmentKevin O'Connor1-5/+11
Add support for a FUNCFSEG macro that will force a "32bit flat" C function to be located in the f-segment. This is useful for 32bit code with inline assembler that thunks to 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Minor - fix comments referring to old tools/ directory.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Get fixed address variables from 32bit compile pass (not 16bit)Kevin O'Connor1-4/+6
Update the layoutrom.py build script so that fixed address sections can come from the 32bit compiled C code. Update the C code so that all VAR16FIXED variables instead use the new VARFSEGFIXED which is defined in 32bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Only export needed fields in LayoutInfo in layoutrom.py.Kevin O'Connor1-63/+67
A number of fields were exported from the layout info that weren't used. Don't bother exporting them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Use fileid instead of category to write sections in layoutrom.py.Kevin O'Connor1-21/+28
The 'category' really determines the memory location while the 'fileid' determines which link stage the section is in. So, use 'fileid' when writing the linker scripts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Keep segmented sections separate until final link step.Kevin O'Connor1-32/+20
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Rework getRelocs() to use a hash instead of categories in layoutrom.pyKevin O'Connor1-19/+13
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Refactor findInit() function.Kevin O'Connor1-28/+18
Push findInit() into main() and unify the category setting code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Use customized entry point for each type of build.Kevin O'Connor1-12/+15
Set an appropriate elf entry point (entry_elf, entry_csm, reset_vector) for each type of build (coreboot, csm, qemu). Use that entry point when determining which sections to keep. Also, remove the '.export.' mechanism to keep a section in the final binary - it is no longer used. This allows the build to slightly reduce the overall size as entry_elf is no longer needed on non-coreboot builds and entry_csm is no longer needed on non-csm builds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Refactor layoutrom.py gc() function.Kevin O'Connor1-25/+15
Eliminate the per-section 'keep' variable - the list of sections that will be emitted is sufficient to track that state. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Extract section visiting logic in layoutrom.py.Kevin O'Connor1-57/+60
Extract out the logic that visits all reachable sections into new function findReachable(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11build: Remove unused function getSectionsStart() from layoutrom.py.Kevin O'Connor1-5/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-01-20build: Be careful with unicode and byte strings for python3 compatibility.Johannes Krampf1-7/+7
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20build: Avoid sort() on unordered classes for python3 compatibility.Johannes Krampf1-3/+4
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20build: Be explicit that we want integers when dividing for python3 compat.Johannes Krampf1-2/+2
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20build: Make print statements in scripts python3 compatible.Johannes Krampf1-16/+16
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2013-12-07Separate out sec32init sections even when not doing code relocation.Kevin O'Connor1-19/+34
The current code does not boot on QEMU with 256K roms when code relocation is disabled, because QEMU only maps the last 128K of the rom to low memory. The seabios make_bios_writable() call copies the full rom to low memory. This patch separates out the init sections even if code relocations are disabled. This effectively ensures that make_bios_writable() code is in the last 128K of the rom. This also introduces a new build symbol (final_readonly_start) which stores the address of where the final runtime read-only memory begins. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-08-17Rename tools/ directory to scripts/ directory.Kevin O'Connor1-0/+693
It's common for other projects (eg, QEMU, Linux) to put build scripts into a "scripts/" directory. There's no reason for SeaBIOS to be different, so rename the "tools/" directory to "scripts/". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>