Kevin O'Connor [Sun, 17 May 2009 22:11:33 +0000 (18:11 -0400)]
VGA: Extract code from vga.c into new files vgaio.c and vgafb.c.
Move hardware IO accessor functions to vgaio.c.
Move framebuffer and font manipulation code to vgafb.c.
Also, have biosfn_write_teletype use biosfn_write_char_attr/only.
Also, breakout set_scan_lines() functionality from biosfn_load_text_X.
Kevin O'Connor [Sun, 17 May 2009 03:31:27 +0000 (23:31 -0400)]
Define unified entry points for irq handlers.
The irq entry points now push the handler address and jump to a
function that does parameter setup. This reduces the code size
because the entry setup isn't repeated for every handler.
Kevin O'Connor [Thu, 7 May 2009 03:35:59 +0000 (23:35 -0400)]
Add initial port of the "open source vga bios" project.
This is an initial import of the code from:
http://www.nongnu.org/vgabios/
The code has been ported from bcc to gcc and gas.
This is an initial import - many functions have not been ported; many
bugs are present.
Kevin O'Connor [Thu, 7 May 2009 03:23:01 +0000 (23:23 -0400)]
Minor - formatting enhancements; add memset_far funcs.
Use consistent types in mtrr.c.
Remove extra ';' from lds files.
Report found serial and lpt ports.
Remove extra newlines from inline asm.
Add memset_far and memset16_far functions.
Kevin O'Connor [Mon, 20 Apr 2009 03:18:54 +0000 (23:18 -0400)]
Fixup previous memcpy optimization.
Different gcc versions handle __builtin_memcpy differently.
Add -minline-all-string to force inlining of memcpy on old gcc.
Always use __builtin_memcpy for all memcpy calls.
Use memcpy4() for the option rom case where 4-byte accesses is important.
Kevin O'Connor [Mon, 20 Apr 2009 01:30:48 +0000 (21:30 -0400)]
Enhance test-gcc.sh.
Don't use "exit -1" as that is an error on some platforms.
Use "-nostdlib" when linking - that is faster and works even when full
development environment isn't available.
Kevin O'Connor [Mon, 20 Apr 2009 00:05:50 +0000 (20:05 -0400)]
Optimize memcpy.
Use __builtin_memcpy on small strings (gcc can inline these well).
Use 4-byte copies when applicable - this is important when copying
option roms from slow PCI space.
Kevin O'Connor [Mon, 13 Apr 2009 18:14:51 +0000 (14:14 -0400)]
Initial support for running CBFS payloads.
Add boot menu option for CBFS payloads.
Rework "override" system so that it is done per BEV.
Add file prefix scanning code to CBFS.
Add CBFS payload launching support.
Kevin O'Connor [Sun, 12 Apr 2009 03:31:29 +0000 (23:31 -0400)]
Initial support for finding option roms in coreboot flash layout.
Add code to search for roms in the "coreboot file system".
Change hardcode option rom detection to use vendor/deviceid instead of
bus/device/fn.
Move streq() function to generic place so cbfs functions can use it.
Kevin O'Connor [Thu, 9 Apr 2009 01:10:08 +0000 (21:10 -0400)]
Rework linker scripts so they work on new version of ld.
Declare output sections with explicit start address - don't rely on LD
using '.' for the start of the section. Make addresses that are
absolute by using the ABSOLUTE() function.
Discard .eh_frame - new gcc has this on by default.
Also, don't use '-d' - instead use FORCE_COMMON_ALLOCATION.
Kevin O'Connor [Sat, 7 Mar 2009 05:07:24 +0000 (00:07 -0500)]
Register int02 handler (nmi); disable NMI by default.
Rename handle_nmi to handle_02 to be more consistent with other handlers.
Actually register handle_02.
Don't panic in nmi handler - just log by default.
Set the disable nmi bit when accessing the cmos index register.
Kevin O'Connor [Sat, 28 Feb 2009 02:23:01 +0000 (21:23 -0500)]
Don't 'autodetect' ATA PIO32 mode - use compile def instead.
The PIO32 detection appears to use a hack built for emulators. It
wont work on real hardware.
Implement with a compile time define instead.
This also improves the quality of the compiled code.
Kevin O'Connor [Sat, 28 Feb 2009 01:14:05 +0000 (20:14 -0500)]
Save/restore %ebp in __call16 instead of in caller (call16).
The Ubuntu gcc compiler apparently miscompiles code when %ebp is in an
assembler clobber list.
Also, don't clobber %eax in transition32 - a minor cleanup.
Kevin O'Connor [Sun, 15 Feb 2009 18:02:56 +0000 (13:02 -0500)]
Clock cleanups.
Reset the RTC registers at boot time.
Add definitions for the RTC register bits and use consistently.
Don't use CMOS_CENTURY value on coreboot.
Minor - when waiting on the TSC wait until counter is greater than
desired value (not greater than or equal).
Kevin O'Connor [Fri, 13 Feb 2009 01:47:59 +0000 (20:47 -0500)]
Enhance cdrom capacity/media sensing timers.
Don't just loop 50/300 times for 5/30 seconds - use real timers.
Reorganize code - move read capacity to its own function.
Fix apparent bug - atapi_get_sense() returns zero on success.
Kevin O'Connor [Thu, 12 Feb 2009 03:46:29 +0000 (22:46 -0500)]
Add common ata identify sequence; improve debugging.
Use a single path to set variables from the identify commands.
Report contents of word0 and word2 in debug level 3.
Only show drive mappings at debug level 3.
Kevin O'Connor [Mon, 9 Feb 2009 00:43:47 +0000 (19:43 -0500)]
Add support for selecting harddrive order in boot menu.
Save ATA harddrive model name so that it can be shown from menu.
Minor - use "ata0-1" not "ata0 slave".
Fill fdpt info based on BIOS drive id - not the controller id.
Add BCV support to IPL code.
Use "BCV" system to set harddrive order (for both ata and option roms).
Also, don't show floppy/cdrom in boot menu if no drives found.
Kevin O'Connor [Sun, 8 Feb 2009 21:57:22 +0000 (16:57 -0500)]
Simplify boot code.
Make sure every IPL entry has a description.
Remove output printing helpers - have each caller output what they want.
Add strtcpy function to ensure descriptions don't go over 32 characters.
Breakup code to launch each IPL entry to its own function.
Kevin O'Connor [Sun, 8 Feb 2009 20:44:08 +0000 (15:44 -0500)]
Reorganize boot code.
Simplify keyboard handling in post_menu.c, and move to util.c.
Move remaining functions in post_menu.c to boot.c; remove post_menu.c.
Also, remove broken check for F12 when in boot menu.
Move BEV setup code from post.c to boot.c.
Move option rom BEV adding code from optionroms.c to boot.c.
Avoid calling BX_PANIC during boot if there is an alternative.
Kevin O'Connor [Sat, 7 Feb 2009 06:21:00 +0000 (01:21 -0500)]
Minor floppy cleanups.
Determine floppy count/types during setup and store for later use.
Don't panic on controller errors - just return an error code.
In COREBOOT case - don't modify CMOS_FLOPPY_DRIVE_TYPE.