Replace CONFIG_THREAD_OPTIONROMS with a runtime config setting.

Replace the CONFIG_THREAD_OPTIONROMS option with the CBFS (or fw_cfg)
file "etc/threads".  This allows for the "threads during optionrom"
capability to be enabled/disabled without requiring SeaBIOS to be
recompiled.  A value of "2" in this file will enable threads to run
during option rom execution.

This change also allows for all threads to be disabled via the same
runtime config file.  Setting the file to a value of "0" will cause
SeaBIOS to perform all hardware initialization serially.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
acpi: Move acpi parsing logic from acpi.c to biostables.c / paravirt.c.

After this change, src/fw/acpi.c only contains the legacy code for
generating ACPI tables.  This change only contains code movement - no
logic is changed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
smbios: Move smbios parsing logic from smbios.c to biostables.c.

After this change, src/fw/smbios.c only contains the legacy code for
generating SMBIOS tables.  This change only contains code movement -
no logic is changed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move PirAddr definition from pirtable.c to biostables.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use biostables.c for copying bios tables even when generating them.

Use the biostables.c copy_pir(), copy_smbios(), copy_acpi_rsdp(), and
copy_mptable() code even when using the legacy bios table generation
code.  This unifies the final bios table deployment code between qemu,
coreboot, and csm.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Document no new changes to pirtable.c, mptable.c, acpi.c, and smbios.c.

Add a note to the code that generates the pir, mptable, smbios, and
smbios tables that no new changes are expected.  Going forward, it is
expected that if any changes are needed to these bios tables that
SeaBIOS will get the tables passed in from upstream.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
apm: Remove old Bochs mechanism for shutdown/suspend/standby.

Remove the old mechanism that used port 0x8900 to send apm signals.
Recent versions of QEMU no longer support this port.  Bochs and QEMU
only ever supported shutdown anyway, and shutdown is already available
via an ACPI mechanism.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Minor - remove unused includes from pci.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Add option to control use of standard VGA IO ports.

Add option CONFIG_VGA_STDVGA_PORTS.  When this option is disabled, the
main BIOS code will not attempt to access any of the legacy VGA IO
ports.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Split vgafb_scroll() into separate move and clear functions.

Rewrite the low-level scroll code so that it is implemented using two
basic operations: move text and clear text.  This simplifies the
low-level code as it no longer needs to handle up scrolling vs down
scrolling.  Determining the direction of the scroll is now done in the
higher level (vgabios.c) code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Rewrite vgafb.c graphics operations to set of 4 standard operators.

The vgabios graphics manipulations can all be implemented on top of 4
basic primitives: read 8 pixels, write 8 pixels, move pixels, and
clear pixels.  Implement these four operators for all the graphics
modes and rewrite the graphics functions in vgafb.c to use them.  This
simplifies the graphics code as the high level logic no longer needs
to be implemented for each graphical framebuffer type.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Introduce text_address().

Factor out code that calculates the text mode address of a given
character.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Add support for manipulating framebuffers in high memory.

Add code for manipulating "direct" style linear RGB framebuffers that
may be in high memory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Set the color attribute when calling vgabios print character.

Set the color attribute in case the SeaBIOS console code is used while
the vgabios is in a graphics mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: PMM scan was incorrectly depending on a zero %ds segment.

Make sure the PMM scanning code uses the GET_FARVAR macro.  (The
existing code only worked because SeaBIOS happens to call the vgabios
in bigreal mode with %ds == %ss = 0.)  Also, the scan doesn't require
bigreal mode - use accesses relative to the SEG_BIOS segment so that
the scan can work in regular real mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
coreboot: Make coreboot table searching available to other code.

Make the coreboot table searching code available to code outside
coreboot.c, and make it runnable from 16bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Initial support for coreboot native vga vgabios.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>