seabios.git
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".

15 years agoMinor - streamline SET_GLOBAL macro - reduce #if usage.
Kevin O'Connor [Mon, 19 Jan 2009 20:33:49 +0000 (15:33 -0500)]
Minor - streamline SET_GLOBAL macro - reduce #if usage.

15 years agoMinor - always set %esp immediately after setting %ss.
Kevin O'Connor [Mon, 19 Jan 2009 18:29:36 +0000 (13:29 -0500)]
Minor - always set %esp immediately after setting %ss.

Setting %ss/%esp in sequence is guaranteed to be atomic.  So, always
    set them in this order to ensure irqs and nmis see a consistent
    stack.

15 years agoMinor - improve space used reporting in tools/layoutrom.py.
Kevin O'Connor [Mon, 19 Jan 2009 18:00:42 +0000 (13:00 -0500)]
Minor - improve space used reporting in tools/layoutrom.py.

The used space calculation was slightly wrong in cases of non-zero
    section alignment.  Redo calculation using a more straight-forward
    approach.

15 years agoFix apparent bug in 16bit resume code.
Kevin O'Connor [Mon, 19 Jan 2009 17:53:54 +0000 (12:53 -0500)]
Fix apparent bug in 16bit resume code.

The BDA offsets were adding in 0x400 twice.
Also, use lss insn instead of manually setting %ss and %sp.
Also, don't force segment value into %eax.

15 years agoFix apparent bug in pci bios handle_1ab10e function.
Kevin O'Connor [Mon, 19 Jan 2009 17:53:10 +0000 (12:53 -0500)]
Fix apparent bug in pci bios handle_1ab10e function.

The PIR entry copy was copying the header instead of the slots.

15 years agoCleanup ps2 port reset handling.
Kevin O'Connor [Sun, 18 Jan 2009 17:54:51 +0000 (12:54 -0500)]
Cleanup ps2 port reset handling.

Separate out reset code - it has special timeouts throughout.

15 years agoCleanup keyboard reset handling.
Kevin O'Connor [Sun, 18 Jan 2009 04:30:01 +0000 (23:30 -0500)]
Cleanup keyboard reset handling.

Use custom timeouts when issuing a reset.
Handle 1-byte returns from reset in ps2 code.
Do full keyboard reset even in coreboot mode.
Send set scan mode command during reset.

15 years agoAdd extra test for CONFIG_ATA in src/disk.c.
Kevin O'Connor [Sun, 18 Jan 2009 02:54:16 +0000 (21:54 -0500)]
Add extra test for CONFIG_ATA in src/disk.c.

All the paths to send_disk_op apparently confuses gcc into always
    emitting __send_disk_op even when it can't be called.  Add an
    extra exlicit check to help gcc out.

15 years agoAdd CONFIG_S3_RESUME to control support for S3 resume.
Kevin O'Connor [Sun, 18 Jan 2009 02:52:52 +0000 (21:52 -0500)]
Add CONFIG_S3_RESUME to control support for S3 resume.

15 years agoDon't assume __call16_from32 and __call16 are linear in romlayout.S.
Kevin O'Connor [Sun, 18 Jan 2009 01:57:11 +0000 (20:57 -0500)]
Don't assume __call16_from32 and __call16 are linear in romlayout.S.

The rom layouts can be dynamic, so don't try to "fall through" to the
    next function.

15 years agoFix minor bug in ps2port.c - can't check for -1 with unsigned return type.
Kevin O'Connor [Sun, 18 Jan 2009 01:17:47 +0000 (20:17 -0500)]
Fix minor bug in ps2port.c - can't check for -1 with unsigned return type.

15 years agoReserve space for buffers in f-segment; don't allocate from freespace.
Kevin O'Connor [Sun, 18 Jan 2009 01:07:09 +0000 (20:07 -0500)]
Reserve space for buffers in f-segment; don't allocate from freespace.

Define the e820list as a regular array.
Define a buffer for run-time built bios tables.
Reserving the space in advance should help prevent run-time errors
    when space becomes tight.

15 years agoMinor - don't force align the 32 bss.
Kevin O'Connor [Sun, 18 Jan 2009 00:42:31 +0000 (19:42 -0500)]
Minor - don't force align the 32 bss.

The sections already carry their required alignment - the force align
    is a leftover from past code.

15 years agoPut each assembler function into its own section.
Kevin O'Connor [Sun, 18 Jan 2009 00:37:26 +0000 (19:37 -0500)]
Put each assembler function into its own section.

Don't manually place assembler functions into the fixed area - allow
    the layout script to do it.

15 years agoHave layoutrom.py show info on utilization of fixed area.
Kevin O'Connor [Sun, 18 Jan 2009 00:35:10 +0000 (19:35 -0500)]
Have layoutrom.py show info on utilization of fixed area.

Also, try harder to fit sections with alignment greater than 1.

15 years agoMove variables from assembler to C code.
Kevin O'Connor [Sat, 17 Jan 2009 23:49:20 +0000 (18:49 -0500)]
Move variables from assembler to C code.

Define macro VAR16FIXED for declaring a variable at a fixed location.
Introduce new file src/misc.c, and move non int15 calls from system.c
    to it.
Implement all fixed location variables in C code.
Move IDT/GDT defs to misc.c.  Remove unused gdt entry 1.

15 years agoRemove some unused IRQ_TRAMPOLINE definitions.
Kevin O'Connor [Sat, 17 Jan 2009 20:23:19 +0000 (15:23 -0500)]
Remove some unused IRQ_TRAMPOLINE definitions.

15 years agoTry to automatically fit sections into open spaces in the fixed area.
Kevin O'Connor [Sat, 17 Jan 2009 20:17:34 +0000 (15:17 -0500)]
Try to automatically fit sections into open spaces in the fixed area.

Enhance layoutrom.py script to find and locate sections into fixed area.
Have layoutrom.py create output file instead of using redirect from make.
Don't use freespace2 for bios tables in f segment - freespace in fixed
    area is now automatically filled.
Change checkrom script to test final_code16_end instead of _start -
    this improves catching of alignment errors.
Don't align gdt to 8 bytes - it causes whole section to be aligned,
    which causes entry point to be misaligned.
Explicitly reserve space for variables in fixed area so that the space
    for them is not auto-filled.

15 years agoLayout fixed area using linker instead of assembler.
Kevin O'Connor [Sat, 17 Jan 2009 15:41:28 +0000 (10:41 -0500)]
Layout fixed area using linker instead of assembler.

The fixed offset requirements of the 16bit code can be done using
    multiple sections and a linker script.  Using the linker allows
    for more flexibility.
Also, have the 16bit code generate sections for every function and
    variable definition.

15 years agoMisc fixes.
Kevin O'Connor [Sat, 17 Jan 2009 07:30:21 +0000 (02:30 -0500)]
Misc fixes.

The pnp bios string can't be const and VAR16_32.
Show ps2 port status when discarding data.

15 years agoChange license from GPLv3 to LGPLv3.
Kevin O'Connor [Fri, 16 Jan 2009 01:52:58 +0000 (20:52 -0500)]
Change license from GPLv3 to LGPLv3.

Change license of contributions from Kevin O'Connor from GPLv3 to
LGPLv3 (or later).  Since the work as a whole is based on Kevin's
contributions and the "bochs bios" which has a license of LGPL (v2 or
later), this effectively makes the work as a whole available under
LGPLv3 (or later).

15 years agoInitial KVM support.
Kevin O'Connor [Mon, 5 Jan 2009 02:48:22 +0000 (21:48 -0500)]
Initial KVM support.

Add some of the enhancements KVM has to their bochs bios tree.  This
    is only partial support for KVM - some features still do not work
    correctly.

15 years agoMake sure ps2 port command reads are from the desired device.
Kevin O'Connor [Sun, 4 Jan 2009 17:20:02 +0000 (12:20 -0500)]
Make sure ps2 port command reads are from the desired device.

Discard reads from real-time events or from a different device.
Also, improve the kbd/mouse diagnostic messages.