Commit Graph

57 Commits

Author SHA1 Message Date
Kevin O'Connor 6a62e0cb0d scripts: Remove python23compat.py
It's simpler to use b"" designations around binary strings than to use
the as_bytes() function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-19 09:45:04 -05:00
Kevin O'Connor 9ad4399b0e readserial: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-19 09:44:30 -05:00
Gerd Hoffmann 7292e4a0a8 Increase BUILD_MIN_BIOSTABLE for large roms
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>
2021-06-04 08:05:08 +02:00
Kevin O'Connor 699a4e5d69 ldnoexec: Add script to remove ET_EXEC flag from intermediate build objects
Add a script to remove the ET_EXEC flag from the 16bit and "32bit
segmented" intermediate objects.  This avoids build failures with some
linkers that will not allow linking these objects again.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-24 11:01:47 -04:00
Kevin O'Connor a3c93bd81d build: Use git describe --always
Add --always flag to "git describe" command to get a build identifier
even if one checks out the repo with a depth parameter that prunes out
the last tagged version.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-27 11:27:59 -05:00
Kevin O'Connor 996a8a9504 checkstack: Handle conditional checks at start of functions
Recent versions of gcc will sometimes place conditional checks in the
code prior to setting up the function's stack frame.  Handle this case
correctly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-10 15:01:03 -04:00
Kevin O'Connor 3910de0dee build: fix .text section address alignment
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>
2016-02-19 21:34:16 -05:00
Roger Pau Monne 3b8c5378df build: fix typo in buildversion.py
Fixes the following build error:

  Building ld scripts
Traceback (most recent call last):
  File "./scripts/buildversion.py", line 134, in <module>
    main()
  File "./scripts/buildversion.py", line 114, in main
    cleanbuild, toolstr = tool_versions(options.tools)
  File "./scripts/buildversion.py", line 90, in tool_versions
    vers[isbinutils] = "mixed"
NameError: global name 'vers' is not defined
Makefile:160: recipe for target 'out/romlayout16.lds' failed

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
2015-12-28 11:55:14 -05:00
Kevin O'Connor 964c77462b acpi: Remove build check for iasl
The iasl program is no longer used on a default build.  Do not require
it to be installed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19 08:48:34 -05:00
Kevin O'Connor 7fdd2fda3f acpi_extract: Make the generated .hex files more human readable
Add a comment to the top of the generated file indicating that is is
an automatically generated file.  Compress output so that up to eight
hex values are placed on a single line.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19 08:48:34 -05:00
Kevin O'Connor 1e7d2edab4 acpi_extract: Move main code to new function main()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19 08:48:34 -05:00
Kevin O'Connor fa7545ab2d buildversion: Add debugging messages
Add ability to output debug messages from the buildversion.py build
script.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-11 10:31:24 -05:00
Kevin O'Connor 8c12694b8a buildversion: Avoid subprocess.check_output() as that requires python2.7
Don't require python2.7 in buildversion.py.  Also, ignore only those
exceptions that are known to be possible.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-09 17:55:40 -05:00
Kevin O'Connor 98a100c24f build: Allow official tarball builds to be considered "clean"
If building from an official tarball and EXTRAVERSION info is
provided, then consider the build to be "clean" (don't include
hostname/build timestamp).  This is done on the expectation that
EXTRAVERSION will have enough information to allow developers to find
the builder and build environment should a defect be reported, and
therefore the hostname/timestamp is not necessary.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-23 11:11:09 -04:00
Kevin O'Connor 234210135f build: Be more permissive in buildversion.py tool version scan
There is some variation in version strings between various tool chain
builds.  Make the version tool scan more permissive to attempt to
handle these variations.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-22 09:43:31 -04:00
Kevin O'Connor a1b4dd09d7 build: Generate "reproducible" version strings on "clean" builds
If the build environment looks "clean" then don't add the build
hostname or build time to the version string.  This makes the default
build string reproducible across builds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15 10:55:14 -04:00
Kevin O'Connor efd70a5006 build: Report gcc and binutils versions in debug log
Attempt to extract the gcc and binutils versions.  Report that
information in the debug log.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15 10:55:10 -04:00
Kevin O'Connor a6c877401b build: Rework version generation; don't allow make version override
Convert the script to generate the build version from a shell script
to a python script.

Remove the ability to override the version at build time via "make
VERSION=xyz".  Replace it with ability to add extra version
information at build time via "make EXTRAVERSION=xyz".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15 10:55:03 -04:00
Stefan Weil 6bcacf7d19 Fix typos found by codespell
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-09 13:34:28 -04:00
Kevin O'Connor 624e812764 build: Support "make VERSION=xyz" to override the default build version
Add a build option to explicitly set the version information compiled
into the seabios and seavgabios binaries.  This may assist in
reproducible builds or to better link builds to distribution packages.
If the new "VERSION=" parameter is not provided then the default build
version remains unchanged.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-06-03 19:22:38 -04:00
Vladimir Serbinenko 1b911d7aed 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>
2015-06-01 12:11:36 -04:00
Kevin O'Connor 945313cc84 checkstack: Minor - continue if not a regular asm line
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-04-17 12:33:58 -04:00
Kevin O'Connor 0b2165d191 vgabios: Emulate "leal" instruction
Emulate the "leal" instruction so that the vgabios can run on older
versions of x86emu.  (This removes the previous "leal" trap.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-04-11 14:36:59 -04:00
Andreas Färber b458122482 checkrom: Fix typo in error message
increate -> increase

Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-20 20:35:22 -04:00
Kevin O'Connor 1317617687 checkstack: Prefer passing "function" class instead of function address
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-03-19 13:01:56 -04:00
Kevin O'Connor d304b59efe checkstack: Simplify yield calculations
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-03-19 13:01:56 -04:00
Kevin O'Connor b5d6c1e6e6 checkstack: Replace function information tuple with class
Replace the six-tuple storing information on each parsed function with
a class.  This makes the code more readable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-03-19 13:01:52 -04:00
Kevin O'Connor c9d97d52c1 checkstack: Handle callw instruction
Minor update to the checkstack.py tool.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-01-19 12:41:33 -05:00
Kevin O'Connor 999567f6f4 readserial: Enhance pipe support
Automatically close and open the pipe if it closes.  Also, better
document that the -f option is for pipes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-01-01 13:51:22 -05:00
Gerd Hoffmann b7f4a76a92 add scripts/tarball.sh
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-11-25 08:19:25 +01:00
Kevin O'Connor eb88bf7db5 build: Support declaring 32bit C functions that must reside in the f-segment
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-10-11 13:41:53 -04:00
Kevin O'Connor a2959d67c0 build: Update kconfig to version in Linux 3.16.
Update kconfig (from Linux v3.13) to the latest version (Linux v3.16).

This copies kconfig from Linux with only the changes necessary to work
with the SeaBIOS build (the equivalent of the earlier SeaBIOS 0da7bfdf
commit) and the changes necessary to always emit symbols (SeaBIOS
b623e7c5 commit).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-08-25 11:36:19 -04:00
Kevin O'Connor ffc0687128 build: Minor - fix comments referring to old tools/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11 16:22:56 -04:00
Kevin O'Connor ab482e0d6c build: Get fixed address variables from 32bit compile pass (not 16bit)
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-11 16:22:51 -04:00
Kevin O'Connor 38729bc374 build: Only export needed fields in LayoutInfo in layoutrom.py.
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-11 14:55:57 -04:00
Kevin O'Connor 8216a47f8d build: Use fileid instead of category to write sections in layoutrom.py.
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-11 14:55:57 -04:00
Kevin O'Connor e574997809 build: Keep segmented sections separate until final link step.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11 14:55:57 -04:00
Kevin O'Connor b40016f9e7 build: Rework getRelocs() to use a hash instead of categories in layoutrom.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11 14:55:56 -04:00
Kevin O'Connor bf70fbff23 build: Refactor findInit() function.
Push findInit() into main() and unify the category setting code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11 14:55:56 -04:00
Kevin O'Connor ee95253403 build: Use customized entry point for each type of build.
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-11 14:55:56 -04:00
Kevin O'Connor c228d70473 build: Refactor layoutrom.py gc() function.
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-11 14:55:56 -04:00
Kevin O'Connor cc132ab555 build: Extract section visiting logic in layoutrom.py.
Extract out the logic that visits all reachable sections into new
function findReachable().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11 14:55:56 -04:00
Kevin O'Connor 2634270407 build: Remove unused function getSectionsStart() from layoutrom.py.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-11 14:55:56 -04:00
Kevin O'Connor e51488c5f8 python3 fixes for vgabios and csm builds.
Avoid using chr() as this produces unicode strings on python3.  Make
sure to only use ord() on slices as the python3 bytearray type returns
an integer on a non-slice array access.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-27 10:38:50 -04:00
Kevin O'Connor 25107a3261 scripts: Allow encodeint.py to take integers in hex notation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-01-22 17:30:30 -05:00
Kevin O'Connor 3d73eaa582 build: Update kconfig to version in Linux 3.13.
Update kconfig (from Linux v3.11-rc6) to the latest version (Linux
v3.13).

This copyies kconfig from Linux with only the changes necessary to
work with the SeaBIOS build (the equivalent of the earlier SeaBIOS
0da7bfdf commit) and the changes necessary to always emit symbols
(SeaBIOS b623e7c5 commit).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-01-22 17:30:30 -05:00
Johannes Krampf 19f789bdfd build: Be careful with unicode and byte strings for python3 compatibility.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20 12:42:44 -05:00
Johannes Krampf 0a82fc743c build: Avoid sort() on unordered classes for python3 compatibility.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20 12:42:43 -05:00
Johannes Krampf 9d7d044d69 build: Be explicit that we want integers when dividing for python3 compat.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20 12:42:43 -05:00
Johannes Krampf 064fd069ef build: Make print statements in scripts python3 compatible.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
2014-01-20 12:42:43 -05:00