seabios.git
15 years agoAvoid casting EBDA variables ipl.description and pir_loc.
Kevin O'Connor [Sat, 8 Nov 2008 18:35:32 +0000 (13:35 -0500)]
Avoid casting EBDA variables ipl.description and pir_loc.

Define them using their native types (pointers).
Also, fix an apparent bug in mptable coreboot processing - it
    incorrectly overwrote the pir_loc variable.

15 years agoUpdate e820 map in place instead of copying it.
Kevin O'Connor [Sat, 8 Nov 2008 18:05:27 +0000 (13:05 -0500)]
Update e820 map in place instead of copying it.

Allocate the e820 map space in the 0xf0000 segment and do all updates
    in place.  This reduces the need to access external memory during
    post.
Also, move e820 pointer and count from ebda to variables in 0xf0000.

15 years agoRework READx_SEG/WRITEx_SEG macro type detection.
Kevin O'Connor [Sat, 8 Nov 2008 18:02:46 +0000 (13:02 -0500)]
Rework READx_SEG/WRITEx_SEG macro type detection.

Detect types by size instead of by comparison to different integer types.
This allows pointers and other types to be directly accessed.
Note that this does slightly pessimize 64bit accesses.

15 years agoSupport .bss variables in 16bit code (ones that the 32bit code can set).
Kevin O'Connor [Sat, 8 Nov 2008 15:36:16 +0000 (10:36 -0500)]
Support .bss variables in 16bit code (ones that the 32bit code can set).

15 years agoAdd dprintf() status writes during startup of bios table inits.
Kevin O'Connor [Sat, 8 Nov 2008 15:35:26 +0000 (10:35 -0500)]
Add dprintf() status writes during startup of bios table inits.

15 years agoPlace .bss section in 0xf0000 segment.
Kevin O'Connor [Sat, 8 Nov 2008 03:15:31 +0000 (22:15 -0500)]
Place .bss section in 0xf0000 segment.

Storing the .bss separately from .data is confusing - so unite them.

15 years agoBe sure to define defaults for NM,STRIP,OBJCOPY in Makefile.
Kevin O'Connor [Sat, 8 Nov 2008 02:42:00 +0000 (21:42 -0500)]
Be sure to define defaults for NM,STRIP,OBJCOPY in Makefile.

15 years agoFix cross compilation issues of seabios
Kevin O'Connor [Thu, 6 Nov 2008 23:57:10 +0000 (18:57 -0500)]
Fix cross compilation issues of seabios

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
15 years agoSeparate out and enhance option rom scanning code.
Kevin O'Connor [Sun, 2 Nov 2008 00:32:27 +0000 (20:32 -0400)]
Separate out and enhance option rom scanning code.

Move option rom code from post.c to optionroms.c.
Add struct definitions for option roms.
Fix an apparent bug in the check for pnp extension headers.

15 years agoMisc minor cleanups.
Kevin O'Connor [Sun, 26 Oct 2008 16:01:21 +0000 (12:01 -0400)]
Misc minor cleanups.

15 years agoUpdates to TODO list.
Kevin O'Connor [Sun, 26 Oct 2008 03:10:27 +0000 (23:10 -0400)]
Updates to TODO list.

15 years agoTurn on cache as first step of post.
Kevin O'Connor [Sun, 26 Oct 2008 03:06:23 +0000 (23:06 -0400)]
Turn on cache as first step of post.

This is needed on kvm.

15 years agoAdd support for more than 4Gig of ram.
Kevin O'Connor [Sun, 26 Oct 2008 03:05:42 +0000 (23:05 -0400)]
Add support for more than 4Gig of ram.

This is based on code in kvm.

15 years agoSynch ACPI DSDT with latest bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 19:50:30 +0000 (15:50 -0400)]
Synch ACPI DSDT with latest bochs bios.

15 years agoAdd new QEMU code to access UUID.
Kevin O'Connor [Sat, 25 Oct 2008 19:43:46 +0000 (15:43 -0400)]
Add new QEMU code to access UUID.

This is based on a patch committed to bochs bios.

15 years agoSet smbios cache handles - patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 19:23:53 +0000 (15:23 -0400)]
Set smbios cache handles - patch from bochs bios.

15 years agoSupport pci init of both PIIX3 and PIIX4 - patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 19:23:23 +0000 (15:23 -0400)]
Support pci init of both PIIX3 and PIIX4 - patch from bochs bios.

15 years agoFix smbios bios_characteristics -- patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 18:43:11 +0000 (14:43 -0400)]
Fix smbios bios_characteristics -- patch from bochs bios.

15 years agoFix VMware backdoor command 0Ah - patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 18:39:56 +0000 (14:39 -0400)]
Fix VMware backdoor command 0Ah - patch from bochs bios.

Also, use macro PACKED instead of __attribute__((__packed__)) in
    smbios code.

15 years agoUpdate F11/F12 scan codes from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 18:38:31 +0000 (14:38 -0400)]
Update F11/F12 scan codes from bochs bios.

This merges a patch that was committed to bochs bios.

15 years agoSupply vga register names for BDA.
Kevin O'Connor [Sat, 25 Oct 2008 18:37:29 +0000 (14:37 -0400)]
Supply vga register names for BDA.

This completes most of the names for the BDA struct (struct bios_data_area_s).

15 years agoUse defines for PCI ids.
Kevin O'Connor [Sat, 25 Oct 2008 18:35:59 +0000 (14:35 -0400)]
Use defines for PCI ids.

This is based on a patch that was committed to bochs bios.

15 years agoUse PCI bus scan to find all ATA controllers. Several IDE fixes.
Kevin O'Connor [Sun, 31 Aug 2008 15:16:33 +0000 (11:16 -0400)]
Use PCI bus scan to find all ATA controllers.  Several IDE fixes.

Find all ATA controllers via a pci bus - don't poke random IO ports.
Force IDE drives to 512 byte sector size; word 5 in identify command
    isn't defined on recent drives.
Add debugging info for extended_access and int 1348 calls.
int 1348 enhancements - general cleanup, report drives as PCI, correct
    iface_path/device_path settings, checksums should be a 2's
    complement, call disk_ret() on all return paths, always use dpte
    revision 0x11, don't set size above 30 bytes.

15 years agoRename pci_find_class() to pci_find_classprog(), and add new functions.
Kevin O'Connor [Sun, 31 Aug 2008 15:06:27 +0000 (11:06 -0400)]
Rename pci_find_class() to pci_find_classprog(), and add new functions.

New pci_find_class() searches by just class, not class and prog-if.
Add some new pci config space definitions.
Add inline functions for converting to/from bus/dev/fn to bdf to PCIDevice.

15 years agoPrint out percentage of space used for bios tables during boot.
Kevin O'Connor [Sat, 30 Aug 2008 01:21:09 +0000 (21:21 -0400)]
Print out percentage of space used for bios tables during boot.

15 years agoFix bug in dprintf - isdigit had sign overflow problem.
Kevin O'Connor [Sat, 30 Aug 2008 01:20:32 +0000 (21:20 -0400)]
Fix bug in dprintf - isdigit had sign overflow problem.

15 years agoCreate a dummy smbios table in coreboot environments.
Kevin O'Connor [Sat, 30 Aug 2008 01:19:53 +0000 (21:19 -0400)]
Create a dummy smbios table in coreboot environments.

15 years agoRename memcpy() to memcpy_far() and add regular memcpy() code.
Kevin O'Connor [Sat, 30 Aug 2008 01:14:36 +0000 (21:14 -0400)]
Rename memcpy() to memcpy_far() and add regular memcpy() code.

15 years agoUse ALIGN() macro in place of open-coded aligns.
Kevin O'Connor [Sat, 30 Aug 2008 01:12:03 +0000 (21:12 -0400)]
Use ALIGN() macro in place of open-coded aligns.

15 years agoSet bx/dx to 0xffff on option rom call.
Kevin O'Connor [Sun, 17 Aug 2008 16:12:31 +0000 (12:12 -0400)]
Set bx/dx to 0xffff on option rom call.

Also improve comments in option rom call slightly.

15 years agoDisable floppy access when coreboot enabled.
Kevin O'Connor [Sun, 17 Aug 2008 15:30:07 +0000 (11:30 -0400)]
Disable floppy access when coreboot enabled.

Floppy code on real hardware is suspect, but some OSes might require
   the calls to be present.  So, force the floppy count to zero for
   now.

15 years agoMisc minor improvements.
Kevin O'Connor [Sun, 17 Aug 2008 15:26:42 +0000 (11:26 -0400)]
Misc minor improvements.

Update TODO list.
Improve comments in boot.c.
Use debug port 0x0402 instead of 0x0403 (bochs prefers the latter).
Fix formatting of debug messages in kbd.c.
Use proper return check for kbd and mouse init.

15 years agoAdd stubs for VIA vga bios callbacks to system bios.
Kevin O'Connor [Sun, 17 Aug 2008 15:11:07 +0000 (11:11 -0400)]
Add stubs for VIA vga bios callbacks to system bios.

The VIA vga bios likes wants to call int 15/5f of main bios.  So, add
    stubs to make it happy.

15 years agoReturn max bus number in int 1a/b101 call.
Kevin O'Connor [Sun, 17 Aug 2008 15:08:46 +0000 (11:08 -0400)]
Return max bus number in int 1a/b101 call.

Add new option CONFIG_PCI_BUS_COUNT to set max bus count.
Use that option consistently in handle_1ab101() and pci.c.
Also, clean up comments of handle_1ab101().

15 years agoRemove CONFIG_QEMU option - breakout into other options.
Kevin O'Connor [Sun, 17 Aug 2008 15:03:24 +0000 (11:03 -0400)]
Remove CONFIG_QEMU option - breakout into other options.

Define all the required app names in config.h directly.
Control UUID detection via new option - CONFIG_UUID_BACKDOOR.
Don't enable mptable on uniprocessor machines (check use to only be
    done for qemu, but it is needed everywhere).
Also add new option CONFIG_SMBIOS.

15 years agoImprove smp detection code.
Kevin O'Connor [Sun, 17 Aug 2008 14:50:57 +0000 (10:50 -0400)]
Improve smp detection code.

Use 'lock incw' to ensure proper synchronization between cpus.
Jump to the 0xf0000 segment for the halt (to ensure halt code isn't overwritten).
Improve code comments.

15 years agoDon't allow CFLAGS to be set from commandline.
Kevin O'Connor [Thu, 31 Jul 2008 00:37:13 +0000 (20:37 -0400)]
Don't allow CFLAGS to be set from commandline.

Some build systems try to override CFLAGS, but this project needs it
    to be set explicitly.

15 years agoSupport ps2 port RESET commands that respond with 1 or 2 bytes.
Kevin O'Connor [Tue, 22 Jul 2008 03:42:34 +0000 (23:42 -0400)]
Support ps2 port RESET commands that respond with 1 or 2 bytes.

Some devices only respond with 1 byte - if they timeout reading the
    second byte, don't fail the whole operation - just continue and
    handle the 1 byte.

15 years agoAdd debugging for unknown keyboard (int 16) calls.
Kevin O'Connor [Tue, 22 Jul 2008 03:40:57 +0000 (23:40 -0400)]
Add debugging for unknown keyboard (int 16) calls.

15 years agoShrink size of bx_panic when CONFIG_DEBUG_LEVEL is off.
Kevin O'Connor [Tue, 22 Jul 2008 03:29:33 +0000 (23:29 -0400)]
Shrink size of bx_panic when CONFIG_DEBUG_LEVEL is off.

When CONFIG_DEBUG_LEVEL the debug message wont be shown, so don't
    bother calling bvprintf.

15 years agoAdd config option to disable scanning for option roms.
Kevin O'Connor [Tue, 22 Jul 2008 02:30:38 +0000 (22:30 -0400)]
Add config option to disable scanning for option roms.

15 years agoAdd additional config options to remove parts of code.
Kevin O'Connor [Tue, 22 Jul 2008 02:23:05 +0000 (22:23 -0400)]
Add additional config options to remove parts of code.

Added options CONFIG_BOOT, CONFIG_SERIAL, CONFIG_LPT, CONFIG_KEYBOARD,
    CONFIG_BOOTMENU.
Also extended coverage of existing options to ensure full code got
    removed.

15 years agoRemove vgahooks.c from Makefile.
Kevin O'Connor [Mon, 21 Jul 2008 23:25:21 +0000 (19:25 -0400)]
Remove vgahooks.c from Makefile.

A testing change got accidentally commited.

15 years agoRewrite ps2 port (keyboard/mouse) handling.
Kevin O'Connor [Sun, 20 Jul 2008 14:08:59 +0000 (10:08 -0400)]
Rewrite ps2 port (keyboard/mouse) handling.

Use command sending code for communicating with the ps2 port.

15 years agoMisc fixes and updates.
Kevin O'Connor [Sat, 19 Jul 2008 18:12:32 +0000 (14:12 -0400)]
Misc fixes and updates.

Minor code cleanups.
Fix parenthesis imbalance in keyboard led test.
The printf() call is only used in 32bit mode - make this explicit to
    the compiler - it improves the code generation.
Clear the screen after initializing the vga option rom.

15 years agoAlways define macro MODE16 - that way it can be used in C conditionals.
Kevin O'Connor [Sun, 13 Jul 2008 15:08:36 +0000 (11:08 -0400)]
Always define macro MODE16 - that way it can be used in C conditionals.

When in 32bit mode - just define it to 0.

15 years agoChange checkstack.py tool - key functions by address instead of name.
Kevin O'Connor [Sun, 13 Jul 2008 14:59:11 +0000 (10:59 -0400)]
Change checkstack.py tool - key functions by address instead of name.

Keying by address allows the tool to work even when multiple symbols
    have the same address.

15 years agoShow percent space of C code used in checkrom.py.
Kevin O'Connor [Sat, 12 Jul 2008 18:30:11 +0000 (14:30 -0400)]
Show percent space of C code used in checkrom.py.

15 years agoAdd workaround for older gcc's not fully supporting VISIBLE32.
Kevin O'Connor [Sat, 12 Jul 2008 18:22:14 +0000 (14:22 -0400)]
Add workaround for older gcc's not fully supporting VISIBLE32.

15 years agoAdd option to disable mptable generation.
Kevin O'Connor [Sat, 12 Jul 2008 16:46:07 +0000 (12:46 -0400)]
Add option to disable mptable generation.

15 years agoFix bug in int1308 handling of floppies.
Kevin O'Connor [Thu, 10 Jul 2008 02:45:12 +0000 (22:45 -0400)]
Fix bug in int1308 handling of floppies.

The floppy_1308() function did not properly set the return code.
Also, simplify physical address lookup code in floppy_cmd().

15 years agoFix error in pci_find_class().
Kevin O'Connor [Thu, 10 Jul 2008 02:43:23 +0000 (22:43 -0400)]
Fix error in pci_find_class().

Fix biterror - must shift value read from pci space - otherwise stray
    bits may be set and cause comparison to fail.

15 years agoImprove debugging output.
Kevin O'Connor [Tue, 8 Jul 2008 01:37:10 +0000 (21:37 -0400)]
Improve debugging output.

Return the line number of the debug_fail() / debug_stub() call site on
    each call.
Show the return status on set_code_fail() calls.
Also, the floppy_1305() code should not clear AL.

15 years agoConvert bootup code (int18/int19) to 32bit mode.
Kevin O'Connor [Sun, 6 Jul 2008 14:14:49 +0000 (10:14 -0400)]
Convert bootup code (int18/int19) to 32bit mode.

The boot entry points should not require 16bit mode, so use 32bit mode
    instead.

15 years agoRelinking rom32.o twice seems flaky - make third link stage.
Kevin O'Connor [Sun, 6 Jul 2008 13:56:14 +0000 (09:56 -0400)]
Relinking rom32.o twice seems flaky - make third link stage.

Sigh - ld seems to move things around when relinking files.  So,
    separate out the link stages so that everything is incremental.
Also, improve diagnostics of checkrom.py tool.

15 years agoMove $PnP string from boot.c to romlayout.S.
Kevin O'Connor [Sun, 6 Jul 2008 13:30:47 +0000 (09:30 -0400)]
Move $PnP string from boot.c to romlayout.S.

The string is special, so it's better to define it in assembler.

15 years agoMove elf entry point from post.c to romlayout.S
Kevin O'Connor [Sun, 6 Jul 2008 01:19:10 +0000 (21:19 -0400)]
Move elf entry point from post.c to romlayout.S

Also, it isn't necessary to use .set when adding 0xf0000 to addresses.

15 years agoEnsure proper alignment of subsections.
Kevin O'Connor [Sun, 6 Jul 2008 01:08:56 +0000 (21:08 -0400)]
Ensure proper alignment of subsections.

Also, do a better job of halting build on a failure in checkrom.py

15 years agoUse ld to build final rom; remove custom build utilities.
Kevin O'Connor [Sun, 6 Jul 2008 00:41:53 +0000 (20:41 -0400)]
Use ld to build final rom; remove custom build utilities.

It's possible to build the final rom with a little LD magic - so use
    that instead of the buildrom.py / defsyms.py method.
Also, rename all occurances of ".globl" to the more clear ".global".

15 years agoUse ".set" gas feature to avoid having to hardcode ljmpl asm insn.
Kevin O'Connor [Sat, 5 Jul 2008 16:49:53 +0000 (12:49 -0400)]
Use ".set" gas feature to avoid having to hardcode ljmpl asm insn.

15 years agoDefine 16bit OFFSET_x to be 32bit addresses; introduce CONFIG_BIOS_ADDR.
Kevin O'Connor [Fri, 4 Jul 2008 19:29:23 +0000 (15:29 -0400)]
Define 16bit OFFSET_x to be 32bit addresses; introduce CONFIG_BIOS_ADDR.

The rom16.o object will now have absolute (32bit applicable) addresses.
Replace several 0xf0000 and 0x10000 uses with CONFIG_BIOS_ADDR/SIZE macros.

15 years agoAdd hack to prevent checkstack.py from infinitely recursing (with bad input).
Kevin O'Connor [Fri, 4 Jul 2008 19:15:49 +0000 (15:15 -0400)]
Add hack to prevent checkstack.py from infinitely recursing (with bad input).

15 years agoDeclare kbd_setup() in post.h - next to other kbd.c defines.
Kevin O'Connor [Fri, 4 Jul 2008 17:10:12 +0000 (13:10 -0400)]
Declare kbd_setup() in post.h - next to other kbd.c defines.

15 years agoExtract 'struct bregs' out of biosvar.h; clean up header includes.
Kevin O'Connor [Fri, 4 Jul 2008 17:04:29 +0000 (13:04 -0400)]
Extract 'struct bregs' out of biosvar.h; clean up header includes.

15 years agoBreakup rombios32.c into pciinit.c and smbios.c
Kevin O'Connor [Fri, 4 Jul 2008 10:18:30 +0000 (06:18 -0400)]
Breakup rombios32.c into pciinit.c and smbios.c

15 years agoSeparate out smp detection and mp table generation from rombios32.c
Kevin O'Connor [Fri, 4 Jul 2008 09:47:26 +0000 (05:47 -0400)]
Separate out smp detection and mp table generation from rombios32.c

Also, change smp_probe() to return the cpu count on each call.

15 years agoSeparate SMM code into its own file (smm.c from rombios32.c).
Kevin O'Connor [Fri, 4 Jul 2008 09:05:54 +0000 (05:05 -0400)]
Separate SMM code into its own file (smm.c from rombios32.c).

15 years agoClean up #ifdefs.
Kevin O'Connor [Fri, 4 Jul 2008 08:47:09 +0000 (04:47 -0400)]
Clean up #ifdefs.

Remove option CONFIG_USE_EBDA_TABLES -- it's just broken.
Convert several '#if CONFIG_X' to 'if (CONFIG_X)'.

15 years agoUpdates to TODO items.
Kevin O'Connor [Sat, 28 Jun 2008 16:19:52 +0000 (12:19 -0400)]
Updates to TODO items.

15 years agoSet BIOS checksum at 0xfffff.
Kevin O'Connor [Sat, 28 Jun 2008 16:18:39 +0000 (12:18 -0400)]
Set BIOS checksum at 0xfffff.

15 years agoImprove some debugging output.
Kevin O'Connor [Sat, 28 Jun 2008 16:15:57 +0000 (12:15 -0400)]
Improve some debugging output.

Replace DEBUGF calls with dprintf calls.
Make ata calls consistently use 'int' return codes.
Make each error return code in ata.c use a unique negative number.

15 years agoScan for and relocate mptable when using coreboot.
Kevin O'Connor [Sat, 21 Jun 2008 23:46:43 +0000 (19:46 -0400)]
Scan for and relocate mptable when using coreboot.

15 years agoConvert '\n' to '\r\n' on debug serial output.
Kevin O'Connor [Sat, 21 Jun 2008 16:59:19 +0000 (12:59 -0400)]
Convert '\n' to '\r\n' on debug serial output.

15 years agoAdd code (currently disabled) to mask run away irqs.
Kevin O'Connor [Sat, 21 Jun 2008 16:24:14 +0000 (12:24 -0400)]
Add code (currently disabled) to mask run away irqs.

Add handler that can react to any unknown hardware irq by masking that
    irq.  This can be useful for finding/fixing run away irq issues.
    Don't currently register these hardware irq handlers
Also, sort and improve default debug levels for bios handlers.

15 years agoInit serial port before using it for debug - also reinit after option rom.
Kevin O'Connor [Sat, 21 Jun 2008 16:15:10 +0000 (12:15 -0400)]
Init serial port before using it for debug - also reinit after option rom.

Apparently, some VGA option roms will enable serial irqs - this could
    cause problems with spurious irqs from debug messages.
Also, improve debugging of option roms that fail the checksum check.

15 years agoPCI fixes
Kevin O'Connor [Sat, 21 Jun 2008 15:55:29 +0000 (11:55 -0400)]
PCI fixes

Only set the PIR table signature and checksum in the init function -
    that way, if it is disabled at runtime (eg, due to coreboot) then
    it wont be found by the OS.
Fix parameter swap bug in handle_1ab102.
Add support for more than one bus in pci scanning code (but only have
    1 bus for now).

15 years agoMake 0xa0000 - 0x10000 a "gap" in the e820 map.
Kevin O'Connor [Sat, 21 Jun 2008 15:43:32 +0000 (11:43 -0400)]
Make 0xa0000 - 0x10000 a "gap" in the e820 map.

Declaring memory between 0xa0000 - 0x10000 confuses windows, so don't
    do that.
Add capability to remove mappings in the memory mapping code.

15 years agoMinor enhancement to disk failure reporting.
Kevin O'Connor [Sat, 21 Jun 2008 15:38:21 +0000 (11:38 -0400)]
Minor enhancement to disk failure reporting.

The ata functions return an int not a u8.

15 years agoFixup bios.bin.elf building on other versions of ld.
Kevin O'Connor [Fri, 20 Jun 2008 04:14:19 +0000 (00:14 -0400)]
Fixup bios.bin.elf building on other versions of ld.

Should use -Tdata instead of -Ttext.

15 years agoAdd header guard around pic.h
Kevin O'Connor [Wed, 18 Jun 2008 11:45:38 +0000 (07:45 -0400)]
Add header guard around pic.h

This fixes compiling with AVOIDCOMBINE=1

15 years agoCleanup handling of interrupt controller (PIC).
Kevin O'Connor [Sat, 14 Jun 2008 19:56:16 +0000 (15:56 -0400)]
Cleanup handling of interrupt controller (PIC).

Add new file (pic.h) with helpers for accessing the PIC.
Move irq enabling code to the files that use those interrupts.
Also, don't setup for floppy if floppy support not enabled.

15 years agoSupport config driven debugging of each irq handler.
Kevin O'Connor [Fri, 13 Jun 2008 02:59:43 +0000 (22:59 -0400)]
Support config driven debugging of each irq handler.

This allows one to easily enable verbose output from handlers.

15 years agoWait for RDY bit when resetting ata hard drives.
Kevin O'Connor [Fri, 13 Jun 2008 02:29:30 +0000 (22:29 -0400)]
Wait for RDY bit when resetting ata hard drives.

If the reset doesn't wait for RDY, apparently irqs can get generated
    later in the boot which can confuse the OS.

15 years agoSupport relocating coreboot generated acpi rsdp and pir tables.
Kevin O'Connor [Fri, 13 Jun 2008 02:22:43 +0000 (22:22 -0400)]
Support relocating coreboot generated acpi rsdp and pir tables.

The coreboot code will now scan the areas marked by CB_MEM_TABLE for
    PIR and RSDP tables.  If found, they'll be moved to the 0xf0000
    segment.
Also, the find_cb_memory() function has been made generic.

15 years agoGenerate PIR table at post time.
Kevin O'Connor [Fri, 13 Jun 2008 02:16:35 +0000 (22:16 -0400)]
Generate PIR table at post time.

Move the predefined PIR table (only useful on emulators) to its own
    file - pirtable.c.
Have the pcibios code inspect the pre-built PIR table on 1ab10e
    calls.

15 years agoAdd config option CONFIG_ACPI for turning off ACPI table generation.
Kevin O'Connor [Fri, 13 Jun 2008 02:12:48 +0000 (22:12 -0400)]
Add config option CONFIG_ACPI for turning off ACPI table generation.

15 years agoMove acpi code out of rombios32.c; clean up use of fixed memory addresses.
Kevin O'Connor [Thu, 12 Jun 2008 02:47:01 +0000 (22:47 -0400)]
Move acpi code out of rombios32.c; clean up use of fixed memory addresses.

Move acpi code from rombios32.c to acpi.c.
Move all fixed memory addresses used by the code to config.h and
    consistently use a "BUILD_" prefix on the definitions.
Move some pci defs to pci.h - allows access from acpi.c and rombios32.c.
Introduce ALIGN() macro - remove old align function.

15 years agoMove PIR table definitions to pcibios.h.
Kevin O'Connor [Thu, 12 Jun 2008 02:39:46 +0000 (22:39 -0400)]
Move PIR table definitions to pcibios.h.

Also add a copyright to pci.c.

15 years agoSupport auto-merging e820 maps of same type.
Kevin O'Connor [Thu, 12 Jun 2008 01:23:24 +0000 (21:23 -0400)]
Support auto-merging e820 maps of same type.

Two bordering e820 maps with the same memory type should merge into
    one mapping of the type.

15 years agoEnhance e820 memory map generation - include files missing from last commit.
Kevin O'Connor [Mon, 9 Jun 2008 03:09:42 +0000 (23:09 -0400)]
Enhance e820 memory map generation - include files missing from last commit.

15 years agoEnhance e820 memory map generation.
Kevin O'Connor [Mon, 9 Jun 2008 03:08:12 +0000 (23:08 -0400)]
Enhance e820 memory map generation.

Build e820 maps at post time; just copy the pre-built ones at runtime.
Add support for populating memory and map info from coreboot.

15 years agoMove debugging messages to appropriate functions.
Kevin O'Connor [Sun, 8 Jun 2008 23:18:33 +0000 (19:18 -0400)]
Move debugging messages to appropriate functions.

Move dprintf calls from post() to the function calls that perform the work.

15 years agoSeparate out ram shadow code and permit more code to write to bios.
Kevin O'Connor [Sun, 8 Jun 2008 17:48:06 +0000 (13:48 -0400)]
Separate out ram shadow code and permit more code to write to bios.

Extract shadow code from rombios32.c to its own file - shadow.c.
Reorg post.c so that shadow enable happens early and ram lock happens
    late in boot process.
Also, improve some comments in post.c and reorg code slightly.

15 years agoProperly save/restore %esp high bits.
Kevin O'Connor [Sun, 8 Jun 2008 17:34:43 +0000 (13:34 -0400)]
Properly save/restore %esp high bits.

It turns out that some OSs do call into the bios with junk in the %esp
    high bits.  So, make sure it is properly cleared and then
    saved/restored.
Have the 32bit apm entry point use its own %esp safe entry macro.

15 years agoMisc minor updates.
Kevin O'Connor [Sat, 7 Jun 2008 19:24:19 +0000 (15:24 -0400)]
Misc minor updates.

15 years agoDo proper delays when switching devices.
Kevin O'Connor [Sat, 7 Jun 2008 19:23:11 +0000 (15:23 -0400)]
Do proper delays when switching devices.

Make sure to msleep(50) when switching the drive.
Also, add some debug messages.

15 years agoAPM fixes; don't save/clear/restore %esp high bits.
Kevin O'Connor [Sat, 7 Jun 2008 18:51:14 +0000 (14:51 -0400)]
APM fixes; don't save/clear/restore %esp high bits.

Don't worry about %esp high bits - 16bit protected mode may require
    the bits to be set.  It would be very odd to call into the bios
    with junk in %esp high bits.
Fix 32bit apm entry point.
Don't log apm calls 155306/15530b.

15 years agoIntroduce set_fail_silent() helpers.
Kevin O'Connor [Sat, 7 Jun 2008 18:41:21 +0000 (14:41 -0400)]
Introduce set_fail_silent() helpers.

These functions are equivalent to set_fail() - but don't log an error.

15 years agoSerial debugging code must not access BDA.
Kevin O'Connor [Sat, 7 Jun 2008 14:43:07 +0000 (10:43 -0400)]
Serial debugging code must not access BDA.

Regular serial writing code uses the system timer to timeout failed
    writes - however, serial debugging can't rely on access to the BDA
    segment or the hardware timer.
Therefore, implement a simple debug only serial writing function and
    separate it from the regular serial output code.
Also include change to dump_regs - don't call __dprintf if debugging
    not on.

15 years agoVerify that option roms don't try to move the ebda block.
Kevin O'Connor [Sat, 7 Jun 2008 14:24:48 +0000 (10:24 -0400)]
Verify that option roms don't try to move the ebda block.