bits-574 released with these changes:

  • New Python functionality:

    • Add a usb module, with support for EHCI handoff and showing host controllers
    • Add a pci module, which currently supports probing for devices by classcode.
    • The bits module now has functions to read and write memory, as bytes, words, or dwords.
    • Preliminary support for reading from stdin from Python; sufficient to allow reading individual characters to implement prompts.
    • New bits.set_mwait function, to set the MWAIT state used internally by BITS to idle CPUs when not in use.
    • New bits.bclk function, returning the CPU bclk, which indicates the speed of the APIC timer.
    • bits.cpuid now returns a namedtuple, allowing access to the return value via named fields (.eax, .ebx, .ecx, .edx) as well as positionally. Use this to clean up various other code.
    • In grubcmds, add support for registering GRUB commands together with an argparse argument parser. This extracts the help text and synopsis, to make GRUB's "help" command work.
  • Initialize Python and register Python GRUB commands before running other GRUB scripts. This allows us to implement commands in Python that other GRUB scripts need.

  • Port many GRUB commands from C to Python. Shared state used by both C and Python commands now lives in GRUB environment variables; once all commands have migrated to Python, the environment variables will go away.

    • brandstring
    • cpu
    • cpu_sleep
    • cpuid32 (now computes and displays the common bits and common mask for each register, highlighting the differences between CPUs)
    • pci_read and pci_write
    • pcie_read and pcie_write
    • rdmsr (now computes and displays the common bits and common mask, highlighting the differences between CPUs)
    • set_mwait
    • timer
    • wrmsr
  • Delete some unused GRUB commands:

    • test_msr_available
    • test_pci_consistency
    • test_pcie
    • testsuite (internal implementation detail)
  • Add more Python modules from the standard library:

    • argparse
    • gettext
    • locale
    • textwrap
    • timeit
  • Make C and Python testsuites share passed/failed counts via environment variables. This allows incremental migration of test_* commands from C to Python.

  • Redirect output from Python to a log before running other Python initialization, to capture any errors that might occur.

  • Add some preliminary parsing for the ACPI MCFG table. In the future, BITS will provide tests for MCFG, and will use it to obtain the PCIe base address.

  • Updates to runppm:

    • Add new error code from PPM RCM v12.1 for reporting locked registers/interfaces.
    • Only print verbose information when the PPM RCM exits unsuccessfully. When successful, shut up about it.
    • On Sandy Bridge family, don't try to use PPM reference code without a compiled copy of the PPM RCM available. The built-in PPM code only has full support for Nehalem family, and eventually the built-in code will go away entirely in favor of the standalone reference code. We don't want to maintain the same reference code in two places.
  • Fix warnings from GCC's new -Wunused-but-set-variable option in the RCM code, and backport upstream GRUB fixes for those warnings in the GRUB codebase. These warnings broke the BITS build with GCC 4.6 and newer.

  • Update README.txt for changes to the top-level BITS menu options.

  • Update README.Developers.txt with some guidelines for Python code.

  • Build system fixes:

    • Fix name of source archive for fdlibm to use .tar.gz, not just .gz
    • Check for Python, fdlibm, and ACPICA before trying to build, rather than mysteriously failing later in the build process.
  • Bugfixes:

    • Fix the docstring of bits.wrmsr to document the return value correctly.
    • Fix ACPI common prefix printing to not print {} at the end of one-CPU lists