bits-1048 released with these changes:

This release introduces a new bits.* Python module namespace for new modules, to keep the module namespace more contained:

  • python: Move bits to bits/__init__.py to allow modules under bits.*

  • python: Split pyfs functions out of bits into their own module, bits.pyfs

  • python: Split pause() into a separate bits.pause module to avoid a circular reference

    bits imported redirect for redirect.nolog(), for use in pause(), and redirect imports bits, creating a circular reference. Split pause() into its own module, bits.pause, to break that cycle.

  • Add new bits.pirtable module to find, parse, and test the PCI Interrupt Routing ($PIR) table

Other changes in this release:

  • Add bits.present, a module for giving a presentation using EFI GOP

  • Add mkpresent, a script to generate slide images for bits.present

  • readline: Add a mechanism to hook function keys and call arbitrary functions

  • build: Support building local files into the .iso

    Useful for local testing; avoids the need to construct and subsequently modify a writable USB disk.

  • mptable: Support finding the MP Table on EFI via configuration table GUID

  • smbios: Support finding the SMBIOS tables on EFI via configuration table GUID

  • efi: Add known UUIDs for various protocols

  • efi: Create named constants for known UUIDs

  • efi: Add function to dump all protocols in use, using LocateHandleBuffer and ProtocolsPerHandle

  • acpi: Handle "local reference" objects

  • acpi: Add test for parsing MPST

  • mptable: Validate header length and checksum after finding an _MP_ signature

    If the length isn't valid or the checksum doesn't match, keep searching.

  • acpi: When displaying the RSDT or XSDT, decode the name of each table

    A list of table pointers is...uninformative.

  • acpi: Add a display_objects() function to show object types

    get_objpaths just retrieves all the object names; display_objects additionally shows the type of each object.

  • ttypager: Add a context manager that sends all output through the pager

    This avoids the need to manually accumulate a string and call ttypager on it, and thus avoids creating duplicate versions of functions, one with the pager and one without.

    Note that all output is deferred until the context manager exits, and the context manager captures all exceptions and displays the traceback through the pager.

  • acpi: Use the new ttypager context manager in display_resources

  • ttypager: Make home and end keys move to beginning and end, respectively

  • platform: Make cpuids and msrs iterable

    Walking them produces the list of all known (non-generic) CPUID and MSR decoded values.

  • platform: Add a dump() function to show all CPUIDs and MSRs for all CPUs

  • platform: Make platform.dump() display using the pager

  • Add an explore menu option to show platform information via platform.dump()

  • platformbase: Improve documentation printed with CPUID and MSR objects

    Show the APIC ID and docstring for CPUIDs and MSRs.

  • platformbase: Add a sanity check to MSRs to prevent instantiating the generic MSR

    The MSR class requires an MSR number, and does not set that MSR number itself. Subclasses that decode specific MSRs must set that MSR number.

  • python: Stop using Python 2.7 {set} notation, for 2.6 syntax compatibility

    BITS is built using Python 2.7, but with this one change, the modules are parseable using the Python 2.6 ast module, useful for running analysis scripts from a host system.

Bugfixes:

  • acpi: Fix structure alignment and padding for ObjectInfo on 64-bit

    ACPI_PNP_DEVICE_ID contains an integer followed by a pointer, so it has padding in the middle on 64-bit. The containing structure has an 8-byte address which needs padding to an 8-byte boundary on 64-bit. Handle both of those instances of padding.

  • acpi.evaluate: Fix error handling when translating an object within a package

    When converting an ACPI object to a Python object, an unknown ACPI object type will set the Python exception and return NULL. However, when that error occurred within a package, the caller would then add that NULL to the package and continue, rather than propagating the error. Fix the package-handling code to reclaim the tuple and propagate the error further up.

  • acpi: Fix unpacking of object info structure

    Invalid strings still have both a length and offset to unpack, even though the length is 0.

  • python: redirect: Drop unused import of acpi

  • testacpi: Fix typo in a test description

  • python/msrs.py: Fix typo in an MSR name