Kevin O'Connor [Sat, 16 May 2009 18:55:01 +0000 (14:55 -0400)]
VGA: Minor - use "_g" suffix for global pointers.
Kevin O'Connor [Sat, 16 May 2009 02:22:12 +0000 (22:22 -0400)]
Flush debugging serial output after every line.
Wait for the serial port to be ready after every debug function.
This fixes an issue with serial port detection.
Kevin O'Connor [Thu, 14 May 2009 23:29:37 +0000 (19:29 -0400)]
VGA: Add header guard to vgasrc/vgatables.h
Kevin O'Connor [Thu, 14 May 2009 23:24:49 +0000 (19:24 -0400)]
VGA: Remove unused DEBUG ifdefs.
Kevin O'Connor [Thu, 14 May 2009 23:01:39 +0000 (19:01 -0400)]
Add missing tools/buildrom.py script.
Kevin O'Connor [Thu, 14 May 2009 02:25:24 +0000 (22:25 -0400)]
VGA: memset16_far and memcpy16_far take byte count (not word count).
Kevin O'Connor [Thu, 14 May 2009 02:06:16 +0000 (22:06 -0400)]
VGA - turn DEBUG printfs into dprintf calls.
Kevin O'Connor [Thu, 14 May 2009 00:55:31 +0000 (20:55 -0400)]
Add tools/checksum.py tool.
Kevin O'Connor [Wed, 13 May 2009 02:59:41 +0000 (22:59 -0400)]
Improve serial port detection.
Add port names for serial port registers.
When detecting serial port, ignore top two bits of IIR register.
Kevin O'Connor [Fri, 8 May 2009 02:00:25 +0000 (22:00 -0400)]
Cleanup vga inb/outb port usages.
Use symbolic names for ports.
Use VGAREG_ACTL_WRITE_DATA instead of VGAREG_ACTL_ADDRESS when writing
a value to the register.
Kevin O'Connor [Thu, 7 May 2009 03:40:07 +0000 (23:40 -0400)]
Minor - update vgasrc/vga.c todo list.
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:33:32 +0000 (23:33 -0400)]
Move assembler entry macros in romlayout.S into new file entryfuncs.S.
This allows the entry macros to be used in other assembler code.
Kevin O'Connor [Thu, 7 May 2009 03:25:40 +0000 (23:25 -0400)]
Minor - report found serial and lpt ports.
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 [Thu, 7 May 2009 03:21:13 +0000 (23:21 -0400)]
Minor - verify e820 request is large enough to hold response.
Kevin O'Connor [Thu, 7 May 2009 03:20:03 +0000 (23:20 -0400)]
Minor - add some additional vga definitions of bda.
Kevin O'Connor [Thu, 7 May 2009 03:18:48 +0000 (23:18 -0400)]
Detect ps2 nak response.
For now, just ignore the nak.
Kevin O'Connor [Wed, 6 May 2009 02:52:09 +0000 (22:52 -0400)]
Add support for field width argument to %x (eg, %08x).
Patch from Stefan Reinauer; modified by Kevin O'Connor.
Kevin O'Connor [Wed, 6 May 2009 01:47:20 +0000 (21:47 -0400)]
Don't send ATA error reports when cdrom not ready.
Based on patch from Stefan Reinauer.
Kevin O'Connor [Fri, 1 May 2009 01:50:35 +0000 (21:50 -0400)]
Add ability to run all option roms in CBFS directory "genroms/".
Kevin O'Connor [Thu, 30 Apr 2009 02:00:21 +0000 (22:00 -0400)]
Add config option to set boot menu delay time.
Add CONFIG_BOOTMENU_WAIT option with delay time (in milliseconds).
Kevin O'Connor [Tue, 28 Apr 2009 01:51:13 +0000 (21:51 -0400)]
Add support for compressed option roms.
Kevin O'Connor [Mon, 27 Apr 2009 03:17:49 +0000 (23:17 -0400)]
Add LZMA decompression support to CBFS.
Support payloads compressed with lzma.
Kevin O'Connor [Mon, 27 Apr 2009 01:27:15 +0000 (21:27 -0400)]
Exit CBFS file search early if zero signature found.
This stops the scan from walking all of flash.
Kevin O'Connor [Mon, 27 Apr 2009 01:25:53 +0000 (21:25 -0400)]
Minor - simplify add_e820() function.
Kevin O'Connor [Mon, 27 Apr 2009 01:24:16 +0000 (21:24 -0400)]
Fix auto-restart timeout in tools/readserial.py
The timer should reset after 60 seconds of idle, not after 60
seconds.
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 [Sun, 19 Apr 2009 15:04:59 +0000 (11:04 -0400)]
Add new tool - tools/readserial.py.
This tool can read from a serial port and provide timing information
on each line read. It is useful when analyzing serial output from
SeaBIOS.
Kevin O'Connor [Sat, 18 Apr 2009 21:02:41 +0000 (17:02 -0400)]
Allow booting from any device when under coreboot.
Don't just try floppy/cdrom/harddrive - try any available boot method.
Kevin O'Connor [Sat, 18 Apr 2009 21:01:02 +0000 (17:01 -0400)]
Try to prevent mapping option roms over flash.
Don't map an option rom in last 4MiB of ram or at its max.
Kevin O'Connor [Sat, 18 Apr 2009 20:59:47 +0000 (16:59 -0400)]
Replace memeq/streq functions with memcmp/strcmp.
The standard functions are better known and not harder to implement.
Kevin O'Connor [Sat, 18 Apr 2009 16:23:00 +0000 (12:23 -0400)]
Add support for waiting for drive startup during ATA detect.
Try to wait for !bsy during ATA detect.
Don't wait if the status register appears to be "floating".
Kevin O'Connor [Fri, 17 Apr 2009 00:43:07 +0000 (20:43 -0400)]
Minor - add more debugging output to option rom scanning.
Kevin O'Connor [Mon, 13 Apr 2009 23:44:55 +0000 (19:44 -0400)]
Add option CONFIG_DISABLE_A20 to control disabling A20 on boot.
Almost nothing really wants A20 off today - so add a config option
(and default it off) to control turning A20 off during 16bit
bootup.
Kevin O'Connor [Mon, 13 Apr 2009 23:32:51 +0000 (19:32 -0400)]
Minor - reset data segments in post32 entry point.
Kevin O'Connor [Mon, 13 Apr 2009 23:30:27 +0000 (19:30 -0400)]
Clear irqs in transition32 instead of callers.
This moves the irq clear into transition32.
Also, disable nmi before loading gdt - this prevents a race with an nmi.
Kevin O'Connor [Mon, 13 Apr 2009 23:26:43 +0000 (19:26 -0400)]
Minor - reorganize romlayout.S to better group entry points.
Kevin O'Connor [Mon, 13 Apr 2009 23:19:22 +0000 (19:19 -0400)]
Make sure optionroms have a non-zero size before using them.
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:25:00 +0000 (21:25 -0400)]
Turn off new gcc tree-switch-conversion option in 16bit mode.
This option emits code which accesses global variables - it wont work
in 16bit mode.
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 [Fri, 27 Mar 2009 04:12:00 +0000 (00:12 -0400)]
Use CC consistently in test-gcc.sh script.
Kevin O'Connor [Fri, 27 Mar 2009 04:07:07 +0000 (00:07 -0400)]
Enhance gcc checks.
Use -Os on visible function test - it seems to alter behavior.
Add check for global variables being present.
Kevin O'Connor [Fri, 27 Mar 2009 00:45:36 +0000 (20:45 -0400)]
Expand gcc tests.
Verify -fwhole-program works at make startup.
Warn when gcc marks global functions as local.
Kevin O'Connor [Sat, 21 Mar 2009 17:17:21 +0000 (13:17 -0400)]
Add high coreboot table support to seabios.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Kevin O'Connor [Sat, 7 Mar 2009 05:09:52 +0000 (00:09 -0500)]
Minor - reduce forced inlining directives in src/ata.c.
Now that ata functions use there own stack in 16bit mode, there is
less need to override the compiler inlining. So, revert to
default.
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 [Sun, 1 Mar 2009 17:41:20 +0000 (12:41 -0500)]
Minor - improve formatting of src/acpi.c.
Kevin O'Connor [Sun, 1 Mar 2009 17:31:57 +0000 (12:31 -0500)]
Consistently disable irqs at start of each assembler entry point.
Always disable irqs at start of each entry point.
Be consistent with clearing direction flag after disabling interrupts.
Kevin O'Connor [Sat, 28 Feb 2009 23:19:30 +0000 (18:19 -0500)]
Fix mptable MPCONFIG_SIGNATURE incorrect signature.
Kevin O'Connor [Sat, 28 Feb 2009 17:26:39 +0000 (12:26 -0500)]
Support multiple independent root buses (if known at compile time).
Allow extra root buses to be specified in src/config.h.
This is based on a patch by Myles Watson.
Kevin O'Connor [Sat, 28 Feb 2009 16:46:40 +0000 (11:46 -0500)]
Fix bug in emulator mptable creation - space not reserved.
Looks like a commit error.
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 02:05:59 +0000 (21:05 -0500)]
Minor - cleanup return code of floppy_media_sense.
Kevin O'Connor [Sat, 28 Feb 2009 02:04:09 +0000 (21:04 -0500)]
Copy mptable floater and config tables when on coreboot.
Linux kernels don't like the mp config table being in high memory - so
copy it to low memory during scan.
Kevin O'Connor [Sat, 28 Feb 2009 01:54:51 +0000 (20:54 -0500)]
Build mptable using C 'struct's.
Declare mptable struct definitions.
Build mptable using those structs.
Move mptable definitions to src/mptable.h.
Kevin O'Connor [Sat, 28 Feb 2009 01:19:27 +0000 (20:19 -0500)]
Minor - simplify add_e820() function.
Make code a little simpler.
This also fixes a corner-case where a hole could be incorrectly added
to the map.
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 [Wed, 18 Feb 2009 04:14:25 +0000 (23:14 -0500)]
Add hexdump() output helper function.
Kevin O'Connor [Wed, 18 Feb 2009 03:57:37 +0000 (22:57 -0500)]
Fix typo causing atapi drive type misreport.
All atapi drives were reported as "Device" instead of "CD-Rom/DVD-Rom".
Kevin O'Connor [Wed, 18 Feb 2009 03:36:49 +0000 (22:36 -0500)]
Clear out the BiosTableSpace array on each boot.
This makes sure ctrl-alt-delete doesn't leave left over settings.
Kevin O'Connor [Wed, 18 Feb 2009 01:40:59 +0000 (20:40 -0500)]
Bug fix - cdrom media emulation only moves drives if of the same type.
The bug caused floppies to move when hard drive emulation was in
effect, and vice-versa. This patch fixes it.
Kevin O'Connor [Mon, 16 Feb 2009 15:51:24 +0000 (10:51 -0500)]
Enhance boot menu to allow user to select which CD drive to boot from.
Kevin O'Connor [Mon, 16 Feb 2009 15:14:10 +0000 (10:14 -0500)]
Fix RTC UIP timing.
The "Update In Progress" bit can be set for up to 2.2ms, so wait for
up to 3ms for it to clear.
Kevin O'Connor [Sun, 15 Feb 2009 20:21:10 +0000 (15:21 -0500)]
Minor - change checksum functions to take a (void *).
This reduces the casts in calling code.
Kevin O'Connor [Sun, 15 Feb 2009 18:45:48 +0000 (13:45 -0500)]
Allow ctrl+alt+delete to work when no boot device found.
Don't panic (that turns off irqs), instead spin with irqs enabled.
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 [Thu, 12 Feb 2009 03:22:15 +0000 (22:22 -0500)]
Minor - ata identify commands should use a u16 buffer (not u8).
Kevin O'Connor [Thu, 12 Feb 2009 01:16:49 +0000 (20:16 -0500)]
Don't overflow ATA.channels array on machines with > 4 controllers.
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 22:10:48 +0000 (17:10 -0500)]
Increase default CONFIG_MAX_BIOSTABLE setting.
In an smp simulation, the smbios/mptable need more space than was allocated.
Kevin O'Connor [Sun, 8 Feb 2009 22:07:29 +0000 (17:07 -0500)]
Minor - rename BX_PANIC to panic.
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 18:25:25 +0000 (13:25 -0500)]
Minor - remove permanent_halt function.
The only caller is now in the 0xf0000 segment - so no need for it.
Kevin O'Connor [Sat, 7 Feb 2009 16:25:29 +0000 (11:25 -0500)]
More floppy code cleanups.
Reorganize code slightly to improve readability.
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.
Kevin O'Connor [Sat, 7 Feb 2009 05:04:57 +0000 (00:04 -0500)]
Introduce MBR struct; simplify cdrom emulation code.
Define and use a struct for the master boot record.
Simplify cdrom emulation chs setting code.
Fix an apparent bug in harddrive chs setting - it wasn't properly
masking the spt/cyl fields.
Kevin O'Connor [Sat, 7 Feb 2009 05:03:11 +0000 (00:03 -0500)]
Suppress initialized variable compile warning in ata.c.
Kevin O'Connor [Sat, 7 Feb 2009 03:36:53 +0000 (22:36 -0500)]
Cleanup ATA code; get SATA drives working on real hardware.
Simplify await_ide code.
Only check for drq/err after device reports non-bsy.
Rewrite ata reset code. Use latest spec. Add logic for resets on
slaves without a master.
Set DH register slave bit in send_cmd - so callers don't have to set it.
There is no need for an mdelay(50) after a drive change.
Do check for non-bsy before and after drive changes.
Show error register in debug messages when ERR bit is set.
Don't check for RDY bit in ata_transfer -- ATAPI devices may not set it.
Don't use signatures to detect drive type - instead issue both
IDENTIFY_DEVICE_PACKET and IDENTIFY_DEVICE, and see which succeeds.
Be sure to wait for RDY before issuing IDENTIFY_DEVICE.
Don't reset slave if reset was just done for master.
Kevin O'Connor [Fri, 6 Feb 2009 02:23:39 +0000 (21:23 -0500)]
Don't mask irqs in default hardware irq handler.
The latest PCI spec requires option roms to call default bios
handler. So, the bios must not mask irqs.
Also, make the default hw irq handlers less verbose.
Kevin O'Connor [Fri, 6 Feb 2009 02:16:39 +0000 (21:16 -0500)]
Add pci_to_bdf() helper function.
This function is useful when setting the OPTIONROM_BDF_1/2 defs.
Kevin O'Connor [Fri, 6 Feb 2009 01:32:41 +0000 (20:32 -0500)]
Updates to README file.
Kevin O'Connor [Fri, 6 Feb 2009 00:51:12 +0000 (19:51 -0500)]
Make sure to clear global variables before use.
On reset, the global variables may not be zero - so zero them explicitly.
Kevin O'Connor [Fri, 6 Feb 2009 00:35:11 +0000 (19:35 -0500)]
TODO list updates.
Kevin O'Connor [Fri, 30 Jan 2009 01:35:34 +0000 (20:35 -0500)]
Don't declare a handler for int 0x1c - the default handler is sufficient.
Kevin O'Connor [Sun, 25 Jan 2009 21:11:27 +0000 (16:11 -0500)]
Enhance makefile to autodetect if AVOIDCOMBINE is needed.
Kevin O'Connor [Thu, 22 Jan 2009 00:14:49 +0000 (19:14 -0500)]
Minor - use a struct when working with pcibios 1ab10e param.
Kevin O'Connor [Thu, 22 Jan 2009 00:14:20 +0000 (19:14 -0500)]
Minor enhancement - kbd reset should set 0x1234 in BDA reset flag.
Kevin O'Connor [Thu, 22 Jan 2009 00:13:21 +0000 (19:13 -0500)]
Fix apparent bug in int1348 -- checksum didn't have regs->si offset.
Kevin O'Connor [Tue, 20 Jan 2009 00:56:07 +0000 (19:56 -0500)]
Minor - call16 should not assume %cs==SEG_BIOS.
Should be slightly more compatible with protected mode accesses.
Kevin O'Connor [Tue, 20 Jan 2009 00:25:21 +0000 (19:25 -0500)]
Implement memcpy_far and checksum_far, and replace _fl variants.
The "flat" mode variants work in real mode, but will not work in
protected mode. So, replace with versions that take explicit
segments.
Kevin O'Connor [Mon, 19 Jan 2009 22:58:54 +0000 (17:58 -0500)]
Allow GET/SET_SEG asm to access memory or a register.
This is a minor optimization that can improve gcc code generation.
Kevin O'Connor [Mon, 19 Jan 2009 20:44:44 +0000 (15:44 -0500)]
Rename MAKE_FARPTR (and similar) to MAKE_FLATPTR.
The term "far pointer" is used in many 16bit specs, and it is
different from what MAKE_FARPTR creates. So, use the term "flat
pointer" in the code to distinguish between the two meanings.
Also, use the suffix "_fl" consistently when working with "flat
pointers".