seabios.git
15 years agoVGA: Minor - use "_g" suffix for global pointers.
Kevin O'Connor [Sat, 16 May 2009 18:55:01 +0000 (14:55 -0400)]
VGA: Minor - use "_g" suffix for global pointers.

15 years agoFlush debugging serial output after every line.
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.

15 years agoVGA: Add header guard to vgasrc/vgatables.h
Kevin O'Connor [Thu, 14 May 2009 23:29:37 +0000 (19:29 -0400)]
VGA: Add header guard to vgasrc/vgatables.h

15 years agoVGA: Remove unused DEBUG ifdefs.
Kevin O'Connor [Thu, 14 May 2009 23:24:49 +0000 (19:24 -0400)]
VGA: Remove unused DEBUG ifdefs.

15 years agoAdd missing tools/buildrom.py script.
Kevin O'Connor [Thu, 14 May 2009 23:01:39 +0000 (19:01 -0400)]
Add missing tools/buildrom.py script.

15 years agoVGA: memset16_far and memcpy16_far take byte count (not word count).
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).

15 years agoVGA - turn DEBUG printfs into dprintf calls.
Kevin O'Connor [Thu, 14 May 2009 02:06:16 +0000 (22:06 -0400)]
VGA - turn DEBUG printfs into dprintf calls.

15 years agoAdd tools/checksum.py tool.
Kevin O'Connor [Thu, 14 May 2009 00:55:31 +0000 (20:55 -0400)]
Add tools/checksum.py tool.

15 years agoImprove serial port detection.
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.

15 years agoCleanup vga inb/outb port usages.
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.

15 years agoMinor - update vgasrc/vga.c todo list.
Kevin O'Connor [Thu, 7 May 2009 03:40:07 +0000 (23:40 -0400)]
Minor - update vgasrc/vga.c todo list.

15 years agoAdd initial port of the "open source vga bios" project.
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.

15 years agoMove assembler entry macros in romlayout.S into new file entryfuncs.S.
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.

15 years agoMinor - report found serial and lpt ports.
Kevin O'Connor [Thu, 7 May 2009 03:25:40 +0000 (23:25 -0400)]
Minor - report found serial and lpt ports.

15 years agoMinor - formatting enhancements; add memset_far funcs.
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.

15 years agoMinor - verify e820 request is large enough to hold response.
Kevin O'Connor [Thu, 7 May 2009 03:21:13 +0000 (23:21 -0400)]
Minor - verify e820 request is large enough to hold response.

15 years agoMinor - add some additional vga definitions of bda.
Kevin O'Connor [Thu, 7 May 2009 03:20:03 +0000 (23:20 -0400)]
Minor - add some additional vga definitions of bda.

15 years agoDetect ps2 nak response.
Kevin O'Connor [Thu, 7 May 2009 03:18:48 +0000 (23:18 -0400)]
Detect ps2 nak response.

For now, just ignore the nak.

15 years agoAdd support for field width argument to %x (eg, %08x).
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.

15 years agoDon't send ATA error reports when cdrom not ready.
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.

15 years agoAdd ability to run all option roms in CBFS directory "genroms/".
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/".

15 years agoAdd config option to set boot menu delay time.
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).

15 years agoAdd support for compressed option roms.
Kevin O'Connor [Tue, 28 Apr 2009 01:51:13 +0000 (21:51 -0400)]
Add support for compressed option roms.

15 years agoAdd LZMA decompression support to CBFS.
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.

15 years agoExit CBFS file search early if zero signature found.
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.

15 years agoMinor - simplify add_e820() function.
Kevin O'Connor [Mon, 27 Apr 2009 01:25:53 +0000 (21:25 -0400)]
Minor - simplify add_e820() function.

15 years agoFix auto-restart timeout in tools/readserial.py
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.

15 years agoFixup previous memcpy optimization.
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.

15 years agoEnhance test-gcc.sh.
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.

15 years agoOptimize memcpy.
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.

15 years agoAdd new tool - tools/readserial.py.
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.

15 years agoAllow booting from any device when under coreboot.
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.

15 years agoTry to prevent mapping option roms over flash.
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.

15 years agoReplace memeq/streq functions with memcmp/strcmp.
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.

15 years agoAdd support for waiting for drive startup during ATA detect.
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".

15 years agoMinor - add more debugging output to option rom scanning.
Kevin O'Connor [Fri, 17 Apr 2009 00:43:07 +0000 (20:43 -0400)]
Minor - add more debugging output to option rom scanning.

15 years agoAdd option CONFIG_DISABLE_A20 to control disabling A20 on boot.
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.

15 years agoMinor - reset data segments in post32 entry point.
Kevin O'Connor [Mon, 13 Apr 2009 23:32:51 +0000 (19:32 -0400)]
Minor - reset data segments in post32 entry point.

15 years agoClear irqs in transition32 instead of callers.
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.

15 years agoMinor - reorganize romlayout.S to better group entry points.
Kevin O'Connor [Mon, 13 Apr 2009 23:26:43 +0000 (19:26 -0400)]
Minor - reorganize romlayout.S to better group entry points.

15 years agoMake sure optionroms have a non-zero size before using them.
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.

15 years agoInitial support for running CBFS payloads.
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.

15 years agoInitial support for finding option roms in coreboot flash layout.
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.

15 years agoTurn off new gcc tree-switch-conversion option in 16bit mode.
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.

15 years agoRework linker scripts so they work on new version of ld.
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.

15 years agoUse CC consistently in test-gcc.sh script.
Kevin O'Connor [Fri, 27 Mar 2009 04:12:00 +0000 (00:12 -0400)]
Use CC consistently in test-gcc.sh script.

15 years agoEnhance gcc checks.
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.

15 years agoExpand gcc tests.
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.

15 years agoAdd high coreboot table support to seabios.
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>
15 years agoMinor - reduce forced inlining directives in src/ata.c.
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.

15 years agoRegister int02 handler (nmi); disable NMI by 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.

15 years agoMinor - improve formatting of src/acpi.c.
Kevin O'Connor [Sun, 1 Mar 2009 17:41:20 +0000 (12:41 -0500)]
Minor - improve formatting of src/acpi.c.

15 years agoConsistently disable irqs at start of each assembler entry point.
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.

15 years agoFix mptable MPCONFIG_SIGNATURE incorrect signature.
Kevin O'Connor [Sat, 28 Feb 2009 23:19:30 +0000 (18:19 -0500)]
Fix mptable MPCONFIG_SIGNATURE incorrect signature.

15 years agoSupport multiple independent root buses (if known at compile time).
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.

15 years agoFix bug in emulator mptable creation - space not reserved.
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.

15 years agoDon't 'autodetect' ATA PIO32 mode - use compile def instead.
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.

15 years agoMinor - cleanup return code of floppy_media_sense.
Kevin O'Connor [Sat, 28 Feb 2009 02:05:59 +0000 (21:05 -0500)]
Minor - cleanup return code of floppy_media_sense.

15 years agoCopy mptable floater and config tables when on coreboot.
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.

15 years agoBuild mptable using C 'struct's.
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.

15 years agoMinor - simplify add_e820() function.
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.

15 years agoSave/restore %ebp in __call16 instead of in caller (call16).
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.

15 years agoAdd hexdump() output helper function.
Kevin O'Connor [Wed, 18 Feb 2009 04:14:25 +0000 (23:14 -0500)]
Add hexdump() output helper function.

15 years agoFix typo causing atapi drive type misreport.
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".

15 years agoClear out the BiosTableSpace array on each boot.
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.

15 years agoBug fix - cdrom media emulation only moves drives if of the same type.
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.

15 years agoEnhance boot menu to allow user to select which CD drive to boot from.
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.

15 years agoFix RTC UIP timing.
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.

15 years agoMinor - change checksum functions to take a (void *).
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.

15 years agoAllow ctrl+alt+delete to work when no boot device found.
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.

15 years agoClock cleanups.
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).

15 years agoEnhance cdrom capacity/media sensing timers.
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.

15 years agoAdd common ata identify sequence; improve debugging.
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.

15 years agoMinor - ata identify commands should use a u16 buffer (not u8).
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).

15 years agoDon't overflow ATA.channels array on machines with > 4 controllers.
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.

15 years agoAdd support for selecting harddrive order in boot menu.
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.

15 years agoIncrease default CONFIG_MAX_BIOSTABLE setting.
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.

15 years agoMinor - rename BX_PANIC to panic.
Kevin O'Connor [Sun, 8 Feb 2009 22:07:29 +0000 (17:07 -0500)]
Minor - rename BX_PANIC to panic.

15 years agoSimplify boot code.
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.

15 years agoReorganize boot code.
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.

15 years agoMinor - remove permanent_halt function.
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.

15 years agoMore floppy code cleanups.
Kevin O'Connor [Sat, 7 Feb 2009 16:25:29 +0000 (11:25 -0500)]
More floppy code cleanups.

Reorganize code slightly to improve readability.

15 years agoMinor floppy cleanups.
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.

15 years agoIntroduce MBR struct; simplify cdrom emulation code.
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.

15 years agoSuppress initialized variable compile warning in ata.c.
Kevin O'Connor [Sat, 7 Feb 2009 05:03:11 +0000 (00:03 -0500)]
Suppress initialized variable compile warning in ata.c.

15 years agoCleanup ATA code; get SATA drives working on real hardware.
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.

15 years agoDon't mask irqs in default hardware irq handler.
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.

15 years agoAdd pci_to_bdf() helper function.
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.

15 years agoUpdates to README file.
Kevin O'Connor [Fri, 6 Feb 2009 01:32:41 +0000 (20:32 -0500)]
Updates to README file.

15 years agoMake sure to clear global variables before use.
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.

15 years agoTODO list updates.
Kevin O'Connor [Fri, 6 Feb 2009 00:35:11 +0000 (19:35 -0500)]
TODO list updates.

15 years agoDon't declare a handler for int 0x1c - the default handler is sufficient.
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.

15 years agoEnhance makefile to autodetect if AVOIDCOMBINE is needed.
Kevin O'Connor [Sun, 25 Jan 2009 21:11:27 +0000 (16:11 -0500)]
Enhance makefile to autodetect if AVOIDCOMBINE is needed.

15 years agoMinor - use a struct when working with pcibios 1ab10e param.
Kevin O'Connor [Thu, 22 Jan 2009 00:14:49 +0000 (19:14 -0500)]
Minor - use a struct when working with pcibios 1ab10e param.

15 years agoMinor enhancement - kbd reset should set 0x1234 in BDA reset flag.
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.

15 years agoFix apparent bug in int1348 -- checksum didn't have regs->si offset.
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.

15 years agoMinor - call16 should not assume %cs==SEG_BIOS.
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.

15 years agoImplement memcpy_far and checksum_far, and replace _fl variants.
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.

15 years agoAllow GET/SET_SEG asm to access memory or a register.
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.

15 years agoRename MAKE_FARPTR (and similar) to MAKE_FLATPTR.
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".