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.
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.
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.
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.
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.
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().
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.
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.
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.
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.
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.
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.
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".
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.