aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2012-03-24test-gcc: do not truncate stderrIan Campbell1-10/+10
Using "> /dev/fd/2" causes stderr to get truncated, which is mangles the log file if the user happens to have redirected it there. Use ">&2" instead which redirects to the already open stderr and doesn't truncate it. Reported-by: Tim Deegan <tim@xen.org> Tested-by: Tim Deegan <tim@xen.org> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-24Use "git describe" in the build generated version description.Kevin O'Connor1-0/+27
Move the build version generation to a script in tools/ and enhance the system to call "git describe" when it appears the user has a git repo. Also, allow the version to be extracted from a ".version" file for use in official tar releases. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-03-06vgabios: Initial support for fixing up assembler to workaround x86emu.Kevin O'Connor1-0/+39
Perform post-processing of the vgabios assembler to remove certain instructions that gcc generates and x86emu can't handle. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-20Use "#!/bin/sh" instead of ":" in tools/gen-offsets.sh.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-13vgabios: Some tweaks to optimize stack space.Kevin O'Connor1-1/+1
Gcc seems to handle passing structs by value if they are 4 bytes in size instead of 3 bytes. So, add a pad byte to struct carattr and struct cursorpos. Reorganize set_cursor_pos(), verify_scroll(), and handle_1013() so there are less live variables. Don't inline the VBE functions into the main handler code. Code calling VBE functions are newer and are more likely to provide adequate stack space - inlining can cause more stack usage for older functions (which may be stack constrained). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-08Permit .rodata.__PRETTY_FUNCTION__. sections in roms.Kevin O'Connor1-4/+8
Some versions of gcc appear to define these sections even though they aren't used in the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-20buildrom.py: Handle image size in PCI headerJulian Pidancet1-0/+5
This patch makes buildrom.py check if a PCI is present in the ROM, and fills in the image size field. Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2011-10-30acpi: extract aml from .lstMichael S. Tsirkin1-11/+22
Add ACPI_EXTRACT_ALL_CODE directive, to support extracting AML code from listing into a named array. Use that instead including C file generated by iasl, this makes it possible to include multiple AML tables without resorting to preprocessor tricks. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-10-12acpi: generate and parse mixed asl/aml listingMichael S. Tsirkin2-0/+322
Use iasl -l flag to produce a mixed listing, where a source line is followed by matching AML. Add a tool tools/acpi_extract.py to process this listing. The tool looks for ACPI_EXTRACT tags in the ASL source and outputs matching AML offsets in an array. To make these directives pass through ASL without affecting AML, and to make it possible to match AML to source exactly, add a preprocessing stage, which prepares input for iasl, and puts each ACPI_EXTRACT tag within a comment, on a line by itself. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-10Rename the apm, pcibios, and elf entry points.Kevin O'Connor1-1/+1
Use a more consistent naming that matches entry_xxx to handle_xxx where possible. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-09Extend tools/readserial.py to support serial port timing calibration.Kevin O'Connor1-12/+61
Some serial ports have slightly different timing. These timing variations result in less accurate boot time reporting. So, add a calibration mechanism to the tool so that one can determine how much time a specific machine's serial port uses. Also, extend the main part of the tool to allow the user to specify an exact timing parameter.
2011-07-05Add utility "tools/encodeint.py" for CBFS config file creation.Kevin O'Connor1-0/+21
2011-05-21Check for broken LD that ships with Ubuntu 11.04.Kevin O'Connor1-1/+34
Add a build test to ensure that LD can properly align sections.
2011-01-29Change kconfig to emit disabled symbols in autoconf.h.Kevin O'Connor1-1/+10
Always emit CONFIG_X definitions in autoconf.h - set them to 0 when they are disabled.
2011-01-29Build changes for Linux kconfig code to work in seabios dir structure.Kevin O'Connor4-25/+32
2011-01-26Initial commit of Kconfig build tool.Kevin O'Connor40-0/+22689
This is a pure copy of the tool from the Linux v2.6.38-rc2 scripts/kconfig/ directory.
2010-12-24Enhance layoutrom.py to work around a binutils quirk.Kevin O'Connor1-1/+10
Some binutils (report of 2.20.1) don't create dummy symbols for each section - work around that.
2010-12-05Require a "_cfuncXX_" symbol prefix for inter-mode c function references.Kevin O'Connor1-11/+28
The compiler can get confused when referencing a C function in a different mode. (It reasonably assumes that the C function in the current mode is desired.) To avoid this compiler confusion, introduce symbol prefixes (_cfunc16_, _cfunc32flat_, _cfunc32seg_) that must be used on C function symbols that are referenced from other compilation modes. This makes it less likely compiler confusion will occur. It will also makes it easier to implement and use vtable like operation structures.
2010-10-17Report meaningful error if pyserial not present in tools/readserial.pyKevin O'Connor1-1/+9
2010-09-26Show size of non-relocatable runtime code during build.Kevin O'Connor1-2/+5
2010-09-25Allow rom to grow to 256K.Kevin O'Connor1-0/+2
Enable rom size to be over 128K. Apparently, only the first 128K of the rom are mirrored to the 0xc0000-0xfffff area under qemu, so make sure to copy the rom (via make_bios_writable) in the non-init part of the startup code. This ensure the copy code is itself available.
2010-09-15Enhance build to emit relocation information.Kevin O'Connor1-3/+60
Add support for determining which relocations need to be adjusted to relocate the "32bit flat init" code. Place those relocations in the output object.
2010-09-15Separate out init code from the rest of the 32bit flat code.Kevin O'Connor1-3/+50
Enhance tools/layoutrom.py code so that it can detect which sections are used from the "32bit flat" runtime code. All other "32bit flat" sections can then be assured to be initialization code only. This is in preparation for relocating the 32bit initialization code.
2010-09-15Modify tools/layoutrom.py to use classes instead of tuples.Kevin O'Connor2-178/+189
Using classes and updating the values in the classes makes the code easier to understand.
2010-09-13Use str.startswith() in python scripts.Kevin O'Connor2-13/+12
Use the builtin startswith() string method instead of implementing it manually.
2010-08-28Enhance tools/readserial.py to support reading from a pipe.Kevin O'Connor1-12/+31
Add option parsing support to tool. Enable option (-f) to read from a pipe - which is useful when redirecting qemu's debugging log to a pipe with: -chardev pipe,id=seabios,path=seabioslog -device isa-debugcon,iobase=0x402,chardev=seabios
2010-08-28Make tools/transdump.py more resilient to unknown input.Kevin O'Connor1-2/+2
2010-07-30Add tools/trandump.py tool for converting hexdump() output.Kevin O'Connor1-0/+50
Add tool for converting the output from hexdump() back into its original binary form. This can be useful for use with tools such as hexdump and objdump.
2010-05-01Handle unknown function addresses in tools/checkstack.py.Kevin O'Connor1-17/+16
Handle cases where objdump shows an call to an unknown address. Also, simplify implemention of orderfuncs() - use funcion addreses instead of function names as keys.
2010-05-01Simplify build by manually resolving external symbols in layoutrom.py.Kevin O'Connor3-201/+231
Enhance tools/layoutrom.py to explicitly set those symbols that resolve to a different code chunk (eg, 16, 32seg, 32flat). This eliminates the need to link the code chunks multiple times. This patch reduces the dependency on binutils behavior and makes the build simpler to understand.
2010-03-09Improvements to tools/checkstack.py.Kevin O'Connor1-34/+113
Add explicit tracking of functions that switch stacks. Add new tracking of "yield" points -- areas in the code that appear to hand control to third-party code which may use arbitrary stack space. Try to arrange the output so that functions that call each other are near each other.
2010-01-03Detect latest FC12 gcc -combine breakage.Kevin O'Connor1-0/+1
Now, assigning a value to a global is needed to triger ICE.
2010-01-01Force a link error if a function is used from the wrong code chunk.Kevin O'Connor1-12/+15
Force functions intended for other code segments to be discarded during link - this will cause a link error if it used. Clean up rom layout code to ensure discarded sections are not used.
2009-12-30Add support for 32bit PCI BIOS entry.Kevin O'Connor2-47/+93
Create a new code blob (code32seg) with support for 32bit functions that need to utilize explicit segment accesses. This code blob uses global variables relative to %gs and with a dynamic code offset (determined by get_global_offset()). Add BIOS32 structure and code. Add code for 32bit PCI BIOS code.
2009-12-19Fix potential build failure due to text16 section being too large.Kevin O'Connor2-17/+21
A relative PC jump can't exceed 32K, but .text16 can be bigger than 32K. Separate out .text16 into data sections (.data16) and code (.text16). Place text and fixed sections together at end of f-segment. This reduces 16bit text size to ~28K which fixes build errors for now.
2009-12-12Enhance readserial.py to try to account for host time offsets.Kevin O'Connor1-8/+12
Try to account for time related to the host sending blocks of data to the script.
2009-12-05Fix timing in readserial.py - use 10 bits per byte.Kevin O'Connor1-1/+4
There is also a start bit, so 8N1 serial should use 10 bits to a byte.
2009-12-05Enhance readserial.py to note when resetting timer.Kevin O'Connor1-2/+4
2009-11-20Test for broken gcc -combine on FC12.Kevin O'Connor1-4/+27
The Fedora Core 12 distro throws an internal compiler error due to a bug in gcc. Look for this case and avoid using -combine if found.
2009-09-20Allow rom to grow beyond 64K.Kevin O'Connor2-49/+131
If rom is over 64K then use part of e-segment for 32bit code. Push 32bit code as high as it can go in the f-segment. Do version building before layoutrom.py - this way layoutrom knows full size of rom. Make layoutrom.py build the full ld script - remove now unused ld scripts that just imported the output of layoutrom.py. Also, use "objdump" instead of "nm" - reduce toolchain requirements. Enhance tools/checkrom.py so that it can pad bios.bin to size qemu is happy with. Also, add dependencies to build rules for local tools - if tool changes automatically rerun it. Make sure option roms don't overwrite the 32bit code (should the 32bit code be in the e-segment). Make sure shadow code works even if part of the code is in the e-segment.
2009-08-18Fix bug causing layoutrom.py to break if no rodata sections.Kevin O'Connor1-1/+1
Handle case where there are no rodata sections.
2009-08-09Update tools/checkstack.py - new compilers set %ebp in preamble.Kevin O'Connor1-0/+3
A 'movl %esp,%ebp' can occur in the preamble - note for proper stack usage checking.
2009-06-30Add descriptions to the gcc tests in tools/test-gcc.sh.Kevin O'Connor1-3/+14
2009-06-26Enhance gcc test for visible variables with -fwhole-program.Kevin O'Connor1-0/+1
Add 'extern' decl before variable test - some older compilers wont mark a variable visible if an extern decl precedes it.
2009-06-15Minor - clarify disabling "-combine" warning.Kevin O'Connor1-2/+1
2009-06-15Avoid -fwhole-program on broken gcc instead of stopping build.Kevin O'Connor1-23/+8
Enhance build to detect and avoid gcc with broken -fwhole-program Also, remove workaround for older gcc that mess up global exports.
2009-06-10Add support for gcc v3.x compilers.Kevin O'Connor1-4/+3
Suppress __attribute__((externally_visible)) when no -fwhole-program Add switch hack for compilers without -fno-jump-tables Define memcpy() function (for compilers without -minline-all-stringops). Define call16_simpint as a macro (a param needs to be inlined). Make sure s3_resume is only defined in 32bit mode.
2009-06-10Do garbage collection of unused sections.Kevin O'Connor1-23/+145
Implement -ffunction-sections and -fdata-sections in both 32bit and 16bit code. Make sure all sections have unique names (even asm and discarded sections). Enhance tools/layoutrom.py script to find all sections reachable from exported 16bit code - prune all other sections. Mark sections with "export" if they can be visible outside of code - these sections wont be dropped when pruning unused sections.
2009-06-10checkstack.py should not match pushaw on stack usage check.Kevin O'Connor1-1/+1
Tighten regex so that pushaw doesn't confuse parser.
2009-05-27Keep relocated 16bit code so checkstack can use it.Kevin O'Connor1-1/+1
Make was stripping the relocated 16bit code - keep the unstripped 16bit code so that checkstack can parse it.