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

15 years agoSilence the strict-aliasing warnings that older compilers emit.
Kevin O'Connor [Sun, 4 Jan 2009 16:15:36 +0000 (11:15 -0500)]
Silence the strict-aliasing warnings that older compilers emit.

15 years agoDon't define bda as a macro in resume.c - it confuses AVOIDCOMBINE mode.
Kevin O'Connor [Sat, 3 Jan 2009 04:35:23 +0000 (23:35 -0500)]
Don't define bda as a macro in resume.c - it confuses AVOIDCOMBINE mode.

When using AVOIDCOMBINE, macros can have global scope.  This caused
    the bda macro in resume.c to conflict with the bda variable in
    post.c.

15 years agoThe BDA is at segment 0x0040 not 0x0000.
Kevin O'Connor [Fri, 2 Jan 2009 19:19:43 +0000 (14:19 -0500)]
The BDA is at segment 0x0040 not 0x0000.

The interrupt vector table is technically at 0x0000.

15 years agoImprove set_code_fail/floppy_ret/disk_ret code generation.
Kevin O'Connor [Fri, 2 Jan 2009 18:10:58 +0000 (13:10 -0500)]
Improve set_code_fail/floppy_ret/disk_ret code generation.

Encode lineno and return code into one u32 parameter.  This reduces
    the number of functions arguments to 3 - which gcc does a better
    job of scheduling.
Also, consistently place *regs parameter in the first arg.

15 years agoFix bug in basic_access error path.
Kevin O'Connor [Fri, 2 Jan 2009 17:36:46 +0000 (12:36 -0500)]
Fix bug in basic_access error path.

A missing 'return' statement caused the error to not be returned.

15 years agoReduce stack usage of hw irq handlers.
Kevin O'Connor [Fri, 2 Jan 2009 02:00:59 +0000 (21:00 -0500)]
Reduce stack usage of hw irq handlers.

Avoid using call16_int() -- it consumes too much stack space.
    Instead, use a new function (call16_simpint).  This assumes that
    the handler wont corrupt regs - which should be a safe assumption,
    because if they did corrupt regs they wouldn't work on any bios.
Avoid enabling irqs in the hw irq handlers - there are no loops in the
    handlers that could cause any notable latency.

15 years agoSwitch to new stack when calling ATA function in 16bit mode.
Kevin O'Connor [Thu, 1 Jan 2009 23:31:11 +0000 (18:31 -0500)]
Switch to new stack when calling ATA function in 16bit mode.

This reduces stack usage (old dos programs don't provide much space).

15 years agoTune gcc stack growth parameter.
Kevin O'Connor [Thu, 1 Jan 2009 22:54:16 +0000 (17:54 -0500)]
Tune gcc stack growth parameter.

Use 4 instead of 8 -- latest gcc isn't doing tail-recursion
    optimizations on disk functions due to stack growth.

15 years agoUse new 'struct disk_op_s' to issue ata requests.
Kevin O'Connor [Wed, 31 Dec 2008 05:31:03 +0000 (00:31 -0500)]
Use new 'struct disk_op_s' to issue ata requests.

Using the struct at all callers reduces the parameter assignments.
Replace ata_op_s with new disk_op_s and update all users.
Unify basic/extended_access methods to use new send_disk_op() func.
Remove cdrom_read_emu -- integrate logic into callers.
Remove ata.h -- move all defs to disk.h

15 years agoReturn CDEMU parameters to ebda segment (instead of using globals).
Kevin O'Connor [Wed, 31 Dec 2008 05:09:28 +0000 (00:09 -0500)]
Return CDEMU parameters to ebda segment (instead of using globals).

The cdemu is setup in the boot stage after globals are made
    read-only.  So, globals can't be used.
Also, move hdcount from a global to BDA (it should be in BDA).
Don't attempt to set blksize/sector count in atapi_is_ready() - it's
    not useful.

15 years agoIntroduce GET/SET_EBDA2() macros - they take a cached ebda seg.
Kevin O'Connor [Tue, 30 Dec 2008 02:16:31 +0000 (21:16 -0500)]
Introduce GET/SET_EBDA2() macros - they take a cached ebda seg.

For those places that repeatedly read/write to the ebda, caching the
    ebda segment improves code generation.

15 years agoAdd more linker protections around variables accessed from 16bit mode.
Kevin O'Connor [Tue, 30 Dec 2008 01:42:40 +0000 (20:42 -0500)]
Add more linker protections around variables accessed from 16bit mode.

Rename VAR16 to VAR16_32 -- that macro supports accesses from both
    16bit and 32bit mode.
Introduce a new macro VAR16 that must be present on all global
    variables accessed from 16bit mode.

15 years agoMove IPL definitions from ebda to global variables.
Kevin O'Connor [Mon, 29 Dec 2008 04:43:20 +0000 (23:43 -0500)]
Move IPL definitions from ebda to global variables.

The boot sequence variable remains in ebda.
Move boot specific definitions to a new header (boot.h)

15 years agoMove most of ATA and CDEMU from ebda to global variables.
Kevin O'Connor [Mon, 29 Dec 2008 04:18:57 +0000 (23:18 -0500)]
Move most of ATA and CDEMU from ebda to global variables.

The dpte, cdrom locks, and disk sector count remain in the ebda.
Also, enhance SET_GLOBAL macro to avoid unused variable warnings.

15 years agoMove ram size definitions from ebda to global variables.
Kevin O'Connor [Mon, 29 Dec 2008 03:03:17 +0000 (22:03 -0500)]
Move ram size definitions from ebda to global variables.

15 years agoMove pir table offset from ebda to a global variable.
Kevin O'Connor [Mon, 29 Dec 2008 02:50:29 +0000 (21:50 -0500)]
Move pir table offset from ebda to a global variable.

Also, make sure the pir table is defined with the 16bit code.

15 years agoAdd linker magic to ensure 16bit variables aren't repeated in 32bit code.
Kevin O'Connor [Mon, 29 Dec 2008 02:37:27 +0000 (21:37 -0500)]
Add linker magic to ensure 16bit variables aren't repeated in 32bit code.

Add VAR16 macro to enable a variable to be available in both 32bit and
    16bit code.  This reduces the occurrences of "#if MODE16".
Also add ASM16 macro to reduce occurrences of "#if MODE16".

15 years agoSupport a relocatable ebda segment.
Kevin O'Connor [Sat, 27 Dec 2008 04:50:17 +0000 (23:50 -0500)]
Support a relocatable ebda segment.

Some option roms will try to relocate the ebda.
Also fix an apparent typo in the assignment of ivecs[0x46].

15 years agoEnhance via vga hooks (based on patch from Rudolf Marek)
Kevin O'Connor [Fri, 26 Dec 2008 18:01:23 +0000 (13:01 -0500)]
Enhance via vga hooks (based on patch from Rudolf Marek)

The VIA Unichrome and OpenChrome drivers need the memory size of
framebuffer and also the memory speed.  Attept to autodetect those
values in int 0x15/5f18 handler.

15 years agoInitial PnP bios call support.
Kevin O'Connor [Sun, 21 Dec 2008 22:51:36 +0000 (17:51 -0500)]
Initial PnP bios call support.

This commit provides just enough PnP support for gPXE to not hook int19.

15 years agoFix bug in dequeue_key() refactor.
Kevin O'Connor [Sun, 21 Dec 2008 22:38:37 +0000 (17:38 -0500)]
Fix bug in dequeue_key() refactor.

Clearing of Z_FL occurs on the !incr path.

15 years agoSupport multiple BCVs in a single option rom.
Kevin O'Connor [Sun, 21 Dec 2008 04:32:16 +0000 (23:32 -0500)]
Support multiple BCVs in a single option rom.

15 years agoRework default hwirq handler so there is no confusion on which pic to eoi.
Kevin O'Connor [Sat, 20 Dec 2008 18:10:00 +0000 (13:10 -0500)]
Rework default hwirq handler so there is no confusion on which pic to eoi.

Introduce two default handlers (hwpic1 and hwpic2) and register them
    accordingly.  This ensures the proper pic always gets an eoi.
Also, use DEBUG_ISR_hwpic1/2 to determine debugging level.

15 years agoMake sure to manually export s3_resume() for old buggy gcc versions.
Kevin O'Connor [Fri, 19 Dec 2008 21:48:20 +0000 (16:48 -0500)]
Make sure to manually export s3_resume() for old buggy gcc versions.

15 years agoAdd initial S3 resume support.
Kevin O'Connor [Fri, 19 Dec 2008 02:57:33 +0000 (21:57 -0500)]
Add initial S3 resume support.

Update ACPI DSDT tables with S3 info.
Change acpi table signatures to use integers.
Save location of rsdp table (so that S3 resume can easily find it later).

15 years agoMake sure %ss==%ds in resume handler call.
Kevin O'Connor [Fri, 19 Dec 2008 02:56:41 +0000 (21:56 -0500)]
Make sure %ss==%ds in resume handler call.

Also, rearrange the layout in the fixed area to make more room in post area.

15 years agoUse rtc for keyboard delay instaed of tsc.
Kevin O'Connor [Wed, 17 Dec 2008 04:51:35 +0000 (23:51 -0500)]
Use rtc for keyboard delay instaed of tsc.

The rtc is likely more accurate on emulators.
Also, this allows interrupts to trigger normally while waiting the 2.5
    seconds.

15 years agoDon't turn off apic after smp detect; use cmos for smp count on emulators.
Kevin O'Connor [Wed, 17 Dec 2008 04:50:52 +0000 (23:50 -0500)]
Don't turn off apic after smp detect; use cmos for smp count on emulators.

Don't restor the APIC_SVR value - doing so confuses kvm.
When running on an emulator, get the smp count from cmos (timing on an
    emulator - especially when simulating large cpu counts - is too
    unreliable to do a count based on timers.)

15 years agoRefactor dequeue_key() in keyboard code.
Kevin O'Connor [Wed, 17 Dec 2008 04:47:37 +0000 (23:47 -0500)]
Refactor dequeue_key() in keyboard code.

All 4 callers of dequeue_key are very similar - move the redundant
    logic into dequeue_key() itself.

15 years agoDefine and consistently use BUILD_APIC_ADDR and BUILD_IOAPIC_ADDR.
Kevin O'Connor [Sun, 14 Dec 2008 15:11:45 +0000 (10:11 -0500)]
Define and consistently use BUILD_APIC_ADDR and BUILD_IOAPIC_ADDR.

15 years agoCleanup of fixed space addresses.
Kevin O'Connor [Sat, 13 Dec 2008 23:33:05 +0000 (18:33 -0500)]
Cleanup of fixed space addresses.

The BIOS_CONFIG_TABLE must be aligned to 1 (or gcc may change it).
Consistently use __aligned(x) wrapper throughout C code.
Register the official fixed address handlers - even if it is only a
    jump to the real handler.
Declare .type of data objects - it improves disassembler output.
Put labels at all fixed addresses - it improves disassembler output.
entry_hwirq should be calling 'cli' - use regular entry macro.
int1D is a data table, not code - so don't put an iretw there.

15 years agoImplement GET/SET_GLOBAL(...) instead of using GET/SET_VAR(CS, ...)
Kevin O'Connor [Sat, 13 Dec 2008 16:10:37 +0000 (11:10 -0500)]
Implement GET/SET_GLOBAL(...) instead of using GET/SET_VAR(CS, ...)

15 years agoImplement time based checks even when looping on an ioport.
Kevin O'Connor [Sat, 13 Dec 2008 15:45:50 +0000 (10:45 -0500)]
Implement time based checks even when looping on an ioport.

Implement real timeout code in ATA.
Implement real timeout code for RTC updating check.

15 years agoMinor - don't call smm_init() from init_bios_tables()
Kevin O'Connor [Thu, 11 Dec 2008 02:01:00 +0000 (21:01 -0500)]
Minor - don't call smm_init() from init_bios_tables()

smm is a system feature, not a memory table.

15 years agoVarious minor comment updates.
Kevin O'Connor [Thu, 11 Dec 2008 01:53:35 +0000 (20:53 -0500)]
Various minor comment updates.

15 years agoFix boot when CONFIG_CDROM_BOOT is disabled.
Kevin O'Connor [Thu, 11 Dec 2008 01:52:09 +0000 (20:52 -0500)]
Fix boot when CONFIG_CDROM_BOOT is disabled.

15 years agoImprove support for old 16bit resume handlers.
Kevin O'Connor [Thu, 11 Dec 2008 01:40:13 +0000 (20:40 -0500)]
Improve support for old 16bit resume handlers.

Detect a non-standard CMOS shutdown code during post and run a
    separate resume handler.
Set aside space in the EBDA for the resume handler stack.
Add support for several of the code supported in bochs bios.

15 years agoDon't overwrite memory on smm init.
Kevin O'Connor [Sun, 7 Dec 2008 04:11:56 +0000 (23:11 -0500)]
Don't overwrite memory on smm init.

Save/restore memory changed during smm init - this is based on a patch
    committed to bochs bios.
Also, clean up ioport and base memory address definitions for smm.

15 years agoExecute smp detect code in place instead of copying it.
Kevin O'Connor [Sun, 7 Dec 2008 00:37:56 +0000 (19:37 -0500)]
Execute smp detect code in place instead of copying it.

Compile the smp detect handler with the rest of the 16bit code.
Implement a simple ljmpw trampoline so the main code can run in place.
Restore memory afterwards to prevent memory corruption.

15 years agoMakefile cleanups.
Kevin O'Connor [Sat, 6 Dec 2008 23:56:19 +0000 (18:56 -0500)]
Makefile cleanups.

Don't assemble romlayout16.S with debugging on - gcc gets confused
    when multiple files with debugging are included.
Be more consistent in status messages.
Use ccode instead of blob/romlayout32 -- it's more accurate.

15 years agoCall option roms in "big real mode".
Kevin O'Connor [Sat, 6 Dec 2008 18:03:52 +0000 (13:03 -0500)]
Call option roms in "big real mode".

15 years agoAdd additional PCI option rom checks.
Kevin O'Connor [Sat, 6 Dec 2008 16:57:45 +0000 (11:57 -0500)]
Add additional PCI option rom checks.

PCI_ROM_ADDRESS is only valid for PCI_HEADER_TYPE_NORMAL devices.
Don't attempt to run a rom with address less than 16MiB.
Don't run roms for IDE code when native IDE support is available.
Also, move hardcode option rom defs to config.h.
Also, add some minor code cleanups.

15 years agoDon't allow start_bdf with new auto max bus detection code.
Kevin O'Connor [Fri, 5 Dec 2008 00:39:10 +0000 (19:39 -0500)]
Don't allow start_bdf with new auto max bus detection code.

It's not valid to set a "start bdf" when search for a device now,
    because we wont be able to properly detect the maximum bus unless
    we start at the beginning.
Change callers that need to resume a search to use foreachpci() macro.
Update all callers so that they don't pass in the now unused start_bdf.

15 years agoOnly support IDE devices with pci class of PCI_CLASS_STORAGE_IDE.
Kevin O'Connor [Fri, 5 Dec 2008 00:22:49 +0000 (19:22 -0500)]
Only support IDE devices with pci class of PCI_CLASS_STORAGE_IDE.

Devices of class PCI_CLASS_STORAGE_OTHER may work with some devices,
    but they are just as likely to cause a crash with other devices.

15 years agoEnance support for PCI option roms.
Kevin O'Connor [Sun, 30 Nov 2008 01:39:06 +0000 (20:39 -0500)]
Enance support for PCI option roms.

Scan for the PCI option rom structure on each PCI card.
Support multiple images in an option rom.
Don't map to area just above memory - assume card is already
    programmed with a valid address.

15 years agoOnly touch PCI functions > 0 on multi-function devices; rescan max pci each time.
Kevin O'Connor [Sun, 30 Nov 2008 01:31:49 +0000 (20:31 -0500)]
Only touch PCI functions > 0 on multi-function devices; rescan max pci each time.

Some single-function devices will respond to all sub-functions - and
    this confuses things.  So, when scanning the PCI bus make sure to
    only touch function 0 on single-function devices.
Since the bus scanning code is necessarily complex now, we might as
    well implement max bus detection inline with all pci scans.  So,
    there is no need to scan for the max bus at startup.

15 years agoDetect keyboard ctrl-alt-delete and try to reset machine.
Kevin O'Connor [Sat, 29 Nov 2008 18:22:29 +0000 (13:22 -0500)]
Detect keyboard ctrl-alt-delete and try to reset machine.

15 years agoFix bug on keyboard LED set.
Kevin O'Connor [Sat, 29 Nov 2008 17:41:48 +0000 (12:41 -0500)]
Fix bug on keyboard LED set.

The ps2_command() function had a cut-and-paste error.
Also, add some additional debugging functions to ps2 port code.

15 years agoDon't reset .bss on reboots.
Kevin O'Connor [Sat, 29 Nov 2008 16:19:19 +0000 (11:19 -0500)]
Don't reset .bss on reboots.

Since .data isn't reset on a reboot, it's confusing to reset .bss.
Fixup all places that assumed .bss variables were reset.

15 years agoImplement tsc based delay timers, and use them throughout code.
Kevin O'Connor [Fri, 28 Nov 2008 21:40:06 +0000 (16:40 -0500)]
Implement tsc based delay timers, and use them throughout code.

Calibrate the timestamp-counter using the PIT timer2 mechanism.
Implement ndelay/udelay/mdelay using tsc.
Remove obsolete sleeping mechanisms.

15 years agoFix bug - bios writes must be enabled before max PCI bus detected.
Kevin O'Connor [Fri, 28 Nov 2008 16:56:37 +0000 (11:56 -0500)]
Fix bug - bios writes must be enabled before max PCI bus detected.

The max pci bus is stored in the bios segment, so it must be writable.
So, use a default max size (1 pci bus) for the initial write enable
    device scan and then do the full max bus check after write is
    enabled.

15 years agoEnable a default hw irq handler.
Kevin O'Connor [Wed, 26 Nov 2008 22:02:43 +0000 (17:02 -0500)]
Enable a default hw irq handler.

Also, only route hw irqs to their handlers when they are enabled.
    (This ensures that if a subsystem is disabled that the default
    hwirq handler will be used.)
Add helper macros to declare the extern asm handlers.
Always enable the RTC hwirq at startup (as opposed to when it is first
    used).
Fix bug in default handler - wrong bit was used for checking the
    cascaded irq.

15 years agoAdd tool for generating assembler offset definition file.
Kevin O'Connor [Sun, 16 Nov 2008 23:14:33 +0000 (18:14 -0500)]
Add tool for generating assembler offset definition file.

Replace __call16 hardcoded offsets with auto generated struct offsets.
Also, load/save %ds register in __call16().

15 years agoDefine bit definitions for cr0 register.
Kevin O'Connor [Sun, 16 Nov 2008 14:59:32 +0000 (09:59 -0500)]
Define bit definitions for cr0 register.

Define and consistently use names for the bits in the cr0 register.

15 years agoCleanup a20 code.
Kevin O'Connor [Sun, 16 Nov 2008 14:17:02 +0000 (09:17 -0500)]
Cleanup a20 code.

Fix two apparent bugs - set_a20() returned new status instead of old
    status and handle_152402() checked wrong bit.
Add bit definition for the a20 enable bit: A20_ENABLE_BIT
Allow ioport.h #defines to be used in romlayout.S.

15 years agoShow PCI info when reporting ATA controllers.
Kevin O'Connor [Sun, 16 Nov 2008 02:15:24 +0000 (21:15 -0500)]
Show PCI info when reporting ATA controllers.

15 years agoIncrease debugging output in option rom processing.
Kevin O'Connor [Thu, 13 Nov 2008 01:10:13 +0000 (20:10 -0500)]
Increase debugging output in option rom processing.

15 years agoDisable a20 on 16bit calls.
Kevin O'Connor [Wed, 12 Nov 2008 03:03:55 +0000 (22:03 -0500)]
Disable a20 on 16bit calls.

The a20 gate is enabled when invoking 32bit mode.  Turn it off before
    returning to 16bit mode.

15 years agoMove POST stack from 0xfffe to 0x7c00.
Kevin O'Connor [Wed, 12 Nov 2008 02:34:37 +0000 (21:34 -0500)]
Move POST stack from 0xfffe to 0x7c00.

The BIOS Boot Specification recommends 0x7c00 - 0xffff for option rom
    temp storage, so don't use that space as a stack.
Also, default CONFIG_VGAHOOKS off as it isn't generally useful.
Finally, update TODO list.

15 years agoMake sure to exit from cdrom_boot() if a cdrom is not found.
Kevin O'Connor [Sun, 9 Nov 2008 22:35:05 +0000 (17:35 -0500)]
Make sure to exit from cdrom_boot() if a cdrom is not found.

15 years agoOverhaul PCI config functions.
Kevin O'Connor [Sun, 9 Nov 2008 20:33:47 +0000 (15:33 -0500)]
Overhaul PCI config functions.

Remove PCIDevice struct and replace with a "u16" with BDF -
    Bus/Device/Function.  This simplifies the code in several places.
Also, scan for and store the maximum PCI bus found during startup.
    The previous config option CONFIG_PCI_BUS_COUNT is no longer
    needed and has been removed.

15 years agoOverhaul option rom processing.
Kevin O'Connor [Sun, 9 Nov 2008 02:36:35 +0000 (21:36 -0500)]
Overhaul option rom processing.

Add initial support for scanning PCI devices for option roms.
Implement two pass option rom scan - init first then scan for bev/bcv.
Support calling BCV vectors that are found.

15 years agoMove 32bit segment defines from romlayout.S to config.h.
Kevin O'Connor [Sun, 9 Nov 2008 00:07:49 +0000 (19:07 -0500)]
Move 32bit segment defines from romlayout.S to config.h.

This moves the 32bit segment names next to the real-mode segment names.
Also, renames them to be more consistent.

15 years agoSynch pci ids and registers with Linux kernel source.
Kevin O'Connor [Sat, 8 Nov 2008 20:53:36 +0000 (15:53 -0500)]
Synch pci ids and registers with Linux kernel source.

Add pci_regs.h and pci_ids.h from kernel repo.
Modify code to use the above includes and to use the kernel definitions.

15 years agoAvoid casting EBDA variables ipl.description and pir_loc.
Kevin O'Connor [Sat, 8 Nov 2008 18:35:32 +0000 (13:35 -0500)]
Avoid casting EBDA variables ipl.description and pir_loc.

Define them using their native types (pointers).
Also, fix an apparent bug in mptable coreboot processing - it
    incorrectly overwrote the pir_loc variable.

15 years agoUpdate e820 map in place instead of copying it.
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.

15 years agoRework READx_SEG/WRITEx_SEG macro type detection.
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.

15 years agoSupport .bss variables in 16bit code (ones that the 32bit code can set).
Kevin O'Connor [Sat, 8 Nov 2008 15:36:16 +0000 (10:36 -0500)]
Support .bss variables in 16bit code (ones that the 32bit code can set).

15 years agoAdd dprintf() status writes during startup of bios table inits.
Kevin O'Connor [Sat, 8 Nov 2008 15:35:26 +0000 (10:35 -0500)]
Add dprintf() status writes during startup of bios table inits.

15 years agoPlace .bss section in 0xf0000 segment.
Kevin O'Connor [Sat, 8 Nov 2008 03:15:31 +0000 (22:15 -0500)]
Place .bss section in 0xf0000 segment.

Storing the .bss separately from .data is confusing - so unite them.

15 years agoBe sure to define defaults for NM,STRIP,OBJCOPY in Makefile.
Kevin O'Connor [Sat, 8 Nov 2008 02:42:00 +0000 (21:42 -0500)]
Be sure to define defaults for NM,STRIP,OBJCOPY in Makefile.

15 years agoFix cross compilation issues of seabios
Kevin O'Connor [Thu, 6 Nov 2008 23:57:10 +0000 (18:57 -0500)]
Fix cross compilation issues of seabios

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
15 years agoSeparate out and enhance option rom scanning code.
Kevin O'Connor [Sun, 2 Nov 2008 00:32:27 +0000 (20:32 -0400)]
Separate out and enhance option rom scanning code.

Move option rom code from post.c to optionroms.c.
Add struct definitions for option roms.
Fix an apparent bug in the check for pnp extension headers.

15 years agoMisc minor cleanups.
Kevin O'Connor [Sun, 26 Oct 2008 16:01:21 +0000 (12:01 -0400)]
Misc minor cleanups.

15 years agoUpdates to TODO list.
Kevin O'Connor [Sun, 26 Oct 2008 03:10:27 +0000 (23:10 -0400)]
Updates to TODO list.

15 years agoTurn on cache as first step of post.
Kevin O'Connor [Sun, 26 Oct 2008 03:06:23 +0000 (23:06 -0400)]
Turn on cache as first step of post.

This is needed on kvm.

15 years agoAdd support for more than 4Gig of ram.
Kevin O'Connor [Sun, 26 Oct 2008 03:05:42 +0000 (23:05 -0400)]
Add support for more than 4Gig of ram.

This is based on code in kvm.

15 years agoSynch ACPI DSDT with latest bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 19:50:30 +0000 (15:50 -0400)]
Synch ACPI DSDT with latest bochs bios.

15 years agoAdd new QEMU code to access UUID.
Kevin O'Connor [Sat, 25 Oct 2008 19:43:46 +0000 (15:43 -0400)]
Add new QEMU code to access UUID.

This is based on a patch committed to bochs bios.

15 years agoSet smbios cache handles - patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 19:23:53 +0000 (15:23 -0400)]
Set smbios cache handles - patch from bochs bios.

15 years agoSupport pci init of both PIIX3 and PIIX4 - patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 19:23:23 +0000 (15:23 -0400)]
Support pci init of both PIIX3 and PIIX4 - patch from bochs bios.

15 years agoFix smbios bios_characteristics -- patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 18:43:11 +0000 (14:43 -0400)]
Fix smbios bios_characteristics -- patch from bochs bios.

15 years agoFix VMware backdoor command 0Ah - patch from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 18:39:56 +0000 (14:39 -0400)]
Fix VMware backdoor command 0Ah - patch from bochs bios.

Also, use macro PACKED instead of __attribute__((__packed__)) in
    smbios code.

15 years agoUpdate F11/F12 scan codes from bochs bios.
Kevin O'Connor [Sat, 25 Oct 2008 18:38:31 +0000 (14:38 -0400)]
Update F11/F12 scan codes from bochs bios.

This merges a patch that was committed to bochs bios.

15 years agoSupply vga register names for BDA.
Kevin O'Connor [Sat, 25 Oct 2008 18:37:29 +0000 (14:37 -0400)]
Supply vga register names for BDA.

This completes most of the names for the BDA struct (struct bios_data_area_s).

15 years agoUse defines for PCI ids.
Kevin O'Connor [Sat, 25 Oct 2008 18:35:59 +0000 (14:35 -0400)]
Use defines for PCI ids.

This is based on a patch that was committed to bochs bios.

15 years agoUse PCI bus scan to find all ATA controllers. Several IDE fixes.
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.

15 years agoRename pci_find_class() to pci_find_classprog(), and add new functions.
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.

15 years agoPrint out percentage of space used for bios tables during boot.
Kevin O'Connor [Sat, 30 Aug 2008 01:21:09 +0000 (21:21 -0400)]
Print out percentage of space used for bios tables during boot.

15 years agoFix bug in dprintf - isdigit had sign overflow problem.
Kevin O'Connor [Sat, 30 Aug 2008 01:20:32 +0000 (21:20 -0400)]
Fix bug in dprintf - isdigit had sign overflow problem.

15 years agoCreate a dummy smbios table in coreboot environments.
Kevin O'Connor [Sat, 30 Aug 2008 01:19:53 +0000 (21:19 -0400)]
Create a dummy smbios table in coreboot environments.

15 years agoRename memcpy() to memcpy_far() and add regular memcpy() code.
Kevin O'Connor [Sat, 30 Aug 2008 01:14:36 +0000 (21:14 -0400)]
Rename memcpy() to memcpy_far() and add regular memcpy() code.

15 years agoUse ALIGN() macro in place of open-coded aligns.
Kevin O'Connor [Sat, 30 Aug 2008 01:12:03 +0000 (21:12 -0400)]
Use ALIGN() macro in place of open-coded aligns.

15 years agoSet bx/dx to 0xffff on option rom call.
Kevin O'Connor [Sun, 17 Aug 2008 16:12:31 +0000 (12:12 -0400)]
Set bx/dx to 0xffff on option rom call.

Also improve comments in option rom call slightly.

15 years agoDisable floppy access when coreboot enabled.
Kevin O'Connor [Sun, 17 Aug 2008 15:30:07 +0000 (11:30 -0400)]
Disable floppy access when coreboot enabled.

Floppy code on real hardware is suspect, but some OSes might require
   the calls to be present.  So, force the floppy count to zero for
   now.

15 years agoMisc minor improvements.
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.

15 years agoAdd stubs for VIA vga bios callbacks to system bios.
Kevin O'Connor [Sun, 17 Aug 2008 15:11:07 +0000 (11:11 -0400)]
Add stubs for VIA vga bios callbacks to system bios.

The VIA vga bios likes wants to call int 15/5f of main bios.  So, add
    stubs to make it happy.