seabios.git
14 years agoNote version 0.4.2.
Kevin O'Connor [Wed, 9 Sep 2009 00:20:04 +0000 (20:20 -0400)]
Note version 0.4.2.

14 years agoRamdisk cleanups.
Kevin O'Connor [Sun, 30 Aug 2009 23:31:22 +0000 (19:31 -0400)]
Ramdisk cleanups.

Use malloc code to allocate space for floppy image instead of
    searching e820 map - this prevents a possible conflict with memory
    allocated by pmm.
Check int 1587 return code.

14 years agoCleanups for malloc code.
Kevin O'Connor [Sun, 30 Aug 2009 23:19:31 +0000 (19:19 -0400)]
Cleanups for malloc code.

Fix bug where zones over 2gig may fail to allocate.
Add memalign_high() and use for acpi facs allocation.
Misc code cleanups.

14 years agoAdd defines for floppy constants.
Kevin O'Connor [Sun, 23 Aug 2009 15:56:55 +0000 (11:56 -0400)]
Add defines for floppy constants.

Add defines for several of the codes used in floppy.c.
Also, actually send the gap length in the floppy commands.
Also, adjust count in floppy_cmd instead of all callers.

14 years agoAdd initial support for PMM allocations of permanent memory.
Kevin O'Connor [Sun, 23 Aug 2009 01:31:58 +0000 (21:31 -0400)]
Add initial support for PMM allocations of permanent memory.

Support PCIv3 PMM requests for permanent memory.
Only support permanent high memory requests for now.

14 years agoMerge cdrom 13xx handlers with main disk 13xx handlers.
Kevin O'Connor [Wed, 19 Aug 2009 02:38:49 +0000 (22:38 -0400)]
Merge cdrom 13xx handlers with main disk 13xx handlers.

Most of the cdrom_13 code did the same thing as disk_13 - so merge
    them together.
Add definitions for 0xe0 (EXTSTART_CD) and 0x80 (EXTSTART_HD).
This changes the behavior for cdroms on 1315 and 1316 calls -
    previously 1315 returned an error and set ah=2, now it sets ah=1
    and doesn't return an error; previously 1316 returned ok, not it
    returns EPARAM.

14 years agoFix bug causing layoutrom.py to break if no rodata sections.
Kevin O'Connor [Wed, 19 Aug 2009 02:26:02 +0000 (22:26 -0400)]
Fix bug causing layoutrom.py to break if no rodata sections.

Handle case where there are no rodata sections.

14 years agoUpdate todo.
Kevin O'Connor [Wed, 19 Aug 2009 02:22:07 +0000 (22:22 -0400)]
Update todo.

14 years agoFurther simplify cbfs functions - don't pass iscomp to callers.
Kevin O'Connor [Wed, 19 Aug 2009 02:21:10 +0000 (22:21 -0400)]
Further simplify cbfs functions - don't pass iscomp to callers.

The cbfs data copy function can determine if the file is compressed on
    its own - it doesn't need the iscomp parameter passed in.

14 years agoWork around qemu quirk - dh not reset on ata drive reset.
Kevin O'Connor [Wed, 19 Aug 2009 02:17:57 +0000 (22:17 -0400)]
Work around qemu quirk - dh not reset on ata drive reset.

14 years agoAdd support for using floppy images in CBFS.
Kevin O'Connor [Mon, 17 Aug 2009 01:59:40 +0000 (21:59 -0400)]
Add support for using floppy images in CBFS.

Add new "ramdisk" type for disk accesses.
Extract out high-mem finding code from pmm into find_high_area().
Fix bug in GDB_BASE and GDT_LIMIT macros (wrong bit shifts).

14 years agoRework coreboot cbfs interface for added flexibility.
Kevin O'Connor [Mon, 17 Aug 2009 00:17:35 +0000 (20:17 -0400)]
Rework coreboot cbfs interface for added flexibility.

Allow callers to track the cbfs_file pointer.
Also, remove obsolete code for brute-force flash scanning.

14 years agoUnify floppy and harddrive command routing.
Kevin O'Connor [Sun, 16 Aug 2009 22:48:38 +0000 (18:48 -0400)]
Unify floppy and harddrive command routing.

Implement low-level floppy commands using the disk_op structure.
The requests can then be filled using the regular disk_13xx functions.

14 years agoUnify some floppy and disk functions.
Kevin O'Connor [Sun, 16 Aug 2009 18:13:36 +0000 (14:13 -0400)]
Unify some floppy and disk functions.

Merge floppy_1301/1308/1315/1316/_ret() functions with their disk equivalents.
Store floppy type in drives structure.

14 years agoChange send_disk_op() to return the bios status code.
Kevin O'Connor [Sun, 16 Aug 2009 17:32:24 +0000 (13:32 -0400)]
Change send_disk_op() to return the bios status code.

14 years agoEnhance boot menu to allow selection of floppy to boot from.
Kevin O'Connor [Sun, 16 Aug 2009 16:21:44 +0000 (12:21 -0400)]
Enhance boot menu to allow selection of floppy to boot from.

The bootmenu can now reorder the first floppy drive.
Note - only the drive mapping is changed - floppy variables in the BDA
    are still set depending on the real floppy index.

14 years agoAdd floppy controllers to "drives" list also.
Kevin O'Connor [Sun, 16 Aug 2009 16:09:44 +0000 (12:09 -0400)]
Add floppy controllers to "drives" list also.

The Drives.drives list now contains floppies, harddrives, and cdroms.
Add mapping table for external/internal drive ids for floppies.
Rename CONFIG_FLOPPY_SUPPORT to CONFIG_FLOPPY (for consistency).
Be consistent with "driveid" and "floppyid" variable names.
Replace switch statements of drive parameters into a global array.
There are some externally visible changes with this patch:
  - Some calls will now return EPARAM instead of ETIMEOUT (or ECHANGED)
  - floppy_1301/1308 are now only available when regs->dl is valid
  - floppy_1308/1315 return EPARAM on invalid drives

14 years agoStore cdrom emulated driveid directly.
Kevin O'Connor [Wed, 12 Aug 2009 02:36:30 +0000 (22:36 -0400)]
Store cdrom emulated driveid directly.

14 years agoUse variable name "driveid" consistently (instead of "device").
Kevin O'Connor [Wed, 12 Aug 2009 02:27:51 +0000 (22:27 -0400)]
Use variable name "driveid" consistently (instead of "device").

14 years agoSeparate ATA code from generic disk code.
Kevin O'Connor [Wed, 12 Aug 2009 01:59:37 +0000 (21:59 -0400)]
Separate ATA code from generic disk code.

Move generic code from ata.c to new file block.c.
Rename atabits.h to ata.h and move ata header definitions from disk.h.
Rename ATA.channels to ATA_channels.
Rename ATA structure to Drives.
Support both CONFIG_DRIVES and CONFIG_ATA options.

14 years agoMinor - remove ATA specific version field from ATA.devices[].
Kevin O'Connor [Wed, 12 Aug 2009 00:58:11 +0000 (20:58 -0400)]
Minor - remove ATA specific version field from ATA.devices[].

14 years agoDensely populate ATA.devices list.
Kevin O'Connor [Wed, 12 Aug 2009 00:43:38 +0000 (20:43 -0400)]
Densely populate ATA.devices list.

Populate ATA.devices in order of drives found; the array index no
    longer correlates with the ATA.channels list.
Add cntl_id to device struct for finding the channel info.

14 years agoMisc ATA cleanups.
Kevin O'Connor [Mon, 10 Aug 2009 04:06:37 +0000 (00:06 -0400)]
Misc ATA cleanups.

Remove some unused defines.
Rename ATA_TYPE_* to DTYPE_* and move from atabits.h to disk.h.
Rename ATA_TRANSLATION_* to TRANSLATION_* and move from atabits.h to disk.h.
Convert bios is-drive-ready call to use send_disk_op().
Only add atapi devices to the cdmap if they are cd/dvd roms.
Remove 'device' from struct ata_devices_s.

14 years agoAdd helper macros for defining GDT descriptors.
Kevin O'Connor [Mon, 10 Aug 2009 04:03:04 +0000 (00:03 -0400)]
Add helper macros for defining GDT descriptors.

14 years agoRoute disk_op commands by drive type - not by command.
Kevin O'Connor [Sun, 9 Aug 2009 23:17:11 +0000 (19:17 -0400)]
Route disk_op commands by drive type - not by command.

Don't confuse op->command with low-level ata cmd->command.
Modify __send_disk_op to route commands by drive type.
Add commands for verify and seek operations.
Do ata resets via disk_op also.

14 years agoRemove unused cdemu ATA code.
Kevin O'Connor [Sun, 9 Aug 2009 22:06:40 +0000 (18:06 -0400)]
Remove unused cdemu ATA code.

Remove the low-level ATA code for short reads on cdroms now that cd
    emulation is done at higher-level.
Also, remove sector_count from ebda - ata code updates op->count now.

14 years agoImplement cdrom disk emulation at high-level instead of in low-level ATA.
Kevin O'Connor [Sun, 9 Aug 2009 21:25:19 +0000 (17:25 -0400)]
Implement cdrom disk emulation at high-level instead of in low-level ATA.

Add a 2K buffer to the ebda to allow for cdrom 512 byte vs 2048 byte
    sector emulation.
For unaliagned cdemu reads, just make multiple cdrom reads instead of
    using ata specific code for short reads.
Also, define cdemu virtual sectors using struct chs_s, and update
    legacy_lba() func to take pointer to a chs_s struct.

14 years agoUpdate tools/checkstack.py - new compilers set %ebp in preamble.
Kevin O'Connor [Sun, 9 Aug 2009 17:10:47 +0000 (13:10 -0400)]
Update tools/checkstack.py - new compilers set %ebp in preamble.

A 'movl   %esp,%ebp' can occur in the preamble - note for proper stack
    usage checking.

14 years agoSeparate cdemu disk accesses from regular disk accesses.
Kevin O'Connor [Sun, 9 Aug 2009 17:08:21 +0000 (13:08 -0400)]
Separate cdemu disk accesses from regular disk accesses.

Breakup basic_access() into basic_access, cdemu_access, and legacy_lba.
Also, check for verify and seek calls in __send_disk_op instead of all
    callers.
Also, send_disk_op returns sector count in dop.count instead of via ebda.

14 years agoUse regular CD reading to load initial CDROM boot image.
Kevin O'Connor [Sun, 9 Aug 2009 15:32:00 +0000 (11:32 -0400)]
Use regular CD reading to load initial CDROM boot image.

Use cdrom_read() instead of cdrom_read_512() for loading the initial
    image.  The initial image will always start on a 2K block, and it
    should be okay to load extra sectors if the sector count doesn't
    end on a 2K boundary.

14 years agoAdd option CONFIG_SCREEN_AND_DEBUG to control printf and debugging.
Kevin O'Connor [Sun, 2 Aug 2009 17:18:27 +0000 (13:18 -0400)]
Add option CONFIG_SCREEN_AND_DEBUG to control printf and debugging.

New option controls whether or not printf content is also written to
    the debug ports.

14 years agoFix some PMM corner-cases.
Kevin O'Connor [Sun, 2 Aug 2009 16:33:58 +0000 (12:33 -0400)]
Fix some PMM corner-cases.

Make sure not to divide by zero when calculating usage percent in
    debug messages.
Make sure high memory zones are aligned; make sure zone is big enough
    even after loss due to alignment.
Be sure to reset ZoneTmpHigh and PMMAllocs on failure paths.
Fix corner case in pmm_free() where an allocation might not get freed
    due to ordering of pmmalloc_s structs.

14 years agoAdd Post Memory Manager (PMM) support.
Kevin O'Connor [Sat, 1 Aug 2009 15:45:37 +0000 (11:45 -0400)]
Add Post Memory Manager (PMM) support.

Complete the initial implementation of PMM.
Default new PMM code to be enabled.
Move malloc code from memmap.c to pmm.c.
Define new malloc zones for PMM (ZoneTmpLow and ZoneTmpHigh).
Change default READ/WRITE_SEG macros to use 32bit pointers (the 16bit
    PMM code use "big real" mode and requires 32bit accesses).
Allow pmm allocations to occur during bcv executions also.
Add low-memory clearing before boot.
Also, align the default f-seg memory.

14 years agoUpdate TODO items.
Kevin O'Connor [Fri, 31 Jul 2009 00:17:33 +0000 (20:17 -0400)]
Update TODO items.

14 years agoAdd auto-generated version info to each build.
Kevin O'Connor [Thu, 30 Jul 2009 00:41:39 +0000 (20:41 -0400)]
Add auto-generated version info to each build.

Add versioning info to initial debug and screen banner output.

14 years agoMinor - breakup mptable allocation into two calls.
Kevin O'Connor [Wed, 29 Jul 2009 23:44:42 +0000 (19:44 -0400)]
Minor - breakup mptable allocation into two calls.

14 years agomptable and madt irq override
Kevin O'Connor [Wed, 29 Jul 2009 23:20:03 +0000 (19:20 -0400)]
mptable and madt irq override

Implement irq override support for timer interrupts. This matches what
QEMU+BOCHS has been doing for the latest 8 months, and is also what
real hardware does.

Windows expects this according to Beth Kon.

Based on patch by Jes Sorensen <jes@sgi.com>

14 years agoFix coreboot bios table copying by delaying to after memory scan.
Kevin O'Connor [Wed, 29 Jul 2009 00:46:03 +0000 (20:46 -0400)]
Fix coreboot bios table copying by delaying to after memory scan.

Delay coreboot bios table scan after memory scan and malloc setup is
    complete.
Also, fix sign underflow in malloc memory available check.
Add check to ensure high bios area is big enough for zone.
Add more debug info to malloc setup/finalize.

14 years agoAdd PMM stubs.
Kevin O'Connor [Sun, 26 Jul 2009 23:33:13 +0000 (19:33 -0400)]
Add PMM stubs.

Add initial code for Post Memory Manager - it's just the stubs for now.
Also, fix PnP entry point not clearing irqs and direction flags.

14 years agoAdd support for enabling ram in 0xc0000-0xf0000 area.
Kevin O'Connor [Sun, 26 Jul 2009 23:16:09 +0000 (19:16 -0400)]
Add support for enabling ram in 0xc0000-0xf0000 area.

Enhance shadow ram support to enable read/write of option rom area.
This enables support for option roms that modify themselves.
Support copying the roms before enabling shadowing, to work around the
    qemu implementation of ram shadowing.
Rename next_rom to RomEnd and export it.
Support locking ram being used for optionroms before booting.
Don't bother and'ing/or'ing 0x59 register - it's usage is well defined.

14 years agoUpdate TODO items.
Kevin O'Connor [Sat, 25 Jul 2009 17:54:52 +0000 (13:54 -0400)]
Update TODO items.

14 years agoAdd malloc_high/fseg() and rework bios table creation to use them.
Kevin O'Connor [Sat, 25 Jul 2009 17:48:27 +0000 (13:48 -0400)]
Add malloc_high/fseg() and rework bios table creation to use them.

Add malloc like functions for memory management instead of open-coding
    memory reservation in all callers.
Add ability for unused high ram to be returned for general purpose use.
Break up acpi table creation into multiple functions.
Also, move smbios tables into high ram (instead of f-segment).

14 years agoWhen enabling write access to 0xf0000, just copy from 0xffff0000.
Kevin O'Connor [Sat, 25 Jul 2009 01:49:26 +0000 (21:49 -0400)]
When enabling write access to 0xf0000, just copy from 0xffff0000.

Instead of copying the bios to temp space and then copying back to
    0xf0000, just copy from the permanent location at 0xffff0000.
This should make startup slightly faster.

14 years agoOnly run the vga option rom of an enabled vga device.
Kevin O'Connor [Sun, 19 Jul 2009 23:05:30 +0000 (19:05 -0400)]
Only run the vga option rom of an enabled vga device.

Find the vga device with legacy range decoding enabled.  This should
    allow multiple vga cards in the same machine to work properly.

14 years agoExpand int155f "vgahook" detection.
Kevin O'Connor [Sun, 19 Jul 2009 22:52:46 +0000 (18:52 -0400)]
Expand int155f "vgahook" detection.

Verify VGA card vendor is via before supporting via 155f calls.
Add support for future code depending on coreboot board id.
Add code for via VX855 memory size and speed detection.

14 years agoUpdate todo list.
Kevin O'Connor [Tue, 14 Jul 2009 00:35:38 +0000 (20:35 -0400)]
Update todo list.

14 years agoMinor - clarify intermediate object file names.
Kevin O'Connor [Tue, 14 Jul 2009 00:31:35 +0000 (20:31 -0400)]
Minor - clarify intermediate object file names.

Rename romlayout16.o to code16.o.
Rename ccode32.o to code32.o.

14 years agoCleanup serial and lpt timers.
Kevin O'Connor [Tue, 14 Jul 2009 00:29:07 +0000 (20:29 -0400)]
Cleanup serial and lpt timers.

Separate out the 18.2Hz timer check into its own code.
Cleanup serial return codes.
Use a real timers for lpt port.
Replace lpt "nop" call with udelay(5).
Move irq_enable() into calls that need it.

14 years agoDelay fdpt pointer setting in ebda to drive map stage.
Kevin O'Connor [Sun, 12 Jul 2009 13:29:46 +0000 (09:29 -0400)]
Delay fdpt pointer setting in ebda to drive map stage.

Can't set the fdpt pointers during init as the ebda might get moved.

14 years agoAdd u64 cast to READ64_SEG() macro to fix vga compiling.
Kevin O'Connor [Sun, 12 Jul 2009 13:12:32 +0000 (09:12 -0400)]
Add u64 cast to READ64_SEG() macro to fix vga compiling.

Cast is needed when pulling pointers or other non-int types.

14 years agoUse "p->sum -= checksum()" style for setting checksums.
Kevin O'Connor [Sat, 4 Jul 2009 17:46:33 +0000 (13:46 -0400)]
Use "p->sum -= checksum()" style for setting checksums.

Some code cleared the original checksum and then calculated a new one,
    others manipulated the checksum range to not include the old
    checksum.  However, this was error prone - use the "-=" syntax
    consistently to reduce possible errors.

14 years agoAdd option for running vga rom during s3 resume.
Kevin O'Connor [Sat, 4 Jul 2009 08:10:32 +0000 (04:10 -0400)]
Add option for running vga rom during s3 resume.

Add support for running the vga rom when the option
    CONFIG_S3_RESUME_VGA_INIT is set (default is off).

14 years agoOptionrom code cleanup.
Kevin O'Connor [Sat, 4 Jul 2009 08:04:36 +0000 (04:04 -0400)]
Optionrom code cleanup.

Nearly all calers of callrom() use OPTION_ROM_INITVECTOR - make it
    default.
Prefer (void*) to explicit casts.
Rename init_optionrom to init_pcirom; rename verifysize_optionrom to
    init_optionrom.
Add 'isvga' parameter to init_optionrom/init_pcirom; unify vga call
    path to use these functions.
Extract cbfs directory scanning into new function run_cbfs_roms().
Allow roms in "vgaroms/" to run even if no pci vga device exists.
Comment improvements.

14 years agoRework READ64_SEG macro to prevent spurious warning on gcc 4.4.
Kevin O'Connor [Wed, 1 Jul 2009 01:45:56 +0000 (21:45 -0400)]
Rework READ64_SEG macro to prevent spurious warning on gcc 4.4.

Gcc is reporting a spurious unused variable warning - work around it.

14 years agoAdd descriptions to the gcc tests in tools/test-gcc.sh.
Kevin O'Connor [Wed, 1 Jul 2009 01:13:44 +0000 (21:13 -0400)]
Add descriptions to the gcc tests in tools/test-gcc.sh.

14 years agoEnhance gcc test for visible variables with -fwhole-program.
Kevin O'Connor [Fri, 26 Jun 2009 22:55:50 +0000 (18:55 -0400)]
Enhance gcc test for visible variables with -fwhole-program.

Add 'extern' decl before variable test - some older compilers wont
    mark a variable visible if an extern decl precedes it.

14 years agoDon't use "objcopy --extract-symbol" - old binutils don't have that option.
Kevin O'Connor [Tue, 23 Jun 2009 00:05:56 +0000 (20:05 -0400)]
Don't use "objcopy --extract-symbol" - old binutils don't have that option.

14 years agoMinor - remove VAR16_32 from extern declaration in header.
Kevin O'Connor [Tue, 23 Jun 2009 00:04:56 +0000 (20:04 -0400)]
Minor - remove VAR16_32 from extern declaration in header.

14 years agoRemove 0x09 as a normal post code (forward port from bochs).
Kevin O'Connor [Sun, 21 Jun 2009 13:57:33 +0000 (09:57 -0400)]
Remove 0x09 as a normal post code (forward port from bochs).

14 years agoForward port bochs pci changes.
Kevin O'Connor [Sun, 21 Jun 2009 13:35:10 +0000 (09:35 -0400)]
Forward port bochs pci changes.

No need for vga io region override.
Don't need kvm to force pci interrupt line on acpi device to 9.
Set the PCI base address to 0xc0000000.

14 years agoForward port bochs smp changes; rename smpdetect.c to smp.c.
Kevin O'Connor [Sun, 21 Jun 2009 13:10:28 +0000 (09:10 -0400)]
Forward port bochs smp changes; rename smpdetect.c to smp.c.

Rename smpdetect.c to smp.c - the code does more than just cpu detection.
Don't probe cpu count on demand - schedule it during post.
Add logic to run wrmsr on all cpus.
Don't make mtrr setup specific to kvm - do it on all machines that
    have mtrr and msrs.
Detect cpu signature/features automatically in mptable.
Also, make sure acpi structures are packed.

14 years agoSupport running non-pci specific vga option roms from CBFS.
Kevin O'Connor [Thu, 18 Jun 2009 00:35:41 +0000 (20:35 -0400)]
Support running non-pci specific vga option roms from CBFS.

Load option roms from the "vgaroms/" CBFS directory during VGA scan.

14 years agoAvoid makefile "else ifeq" syntax - old versions don't support it.
Kevin O'Connor [Thu, 18 Jun 2009 00:33:41 +0000 (20:33 -0400)]
Avoid makefile "else ifeq" syntax - old versions don't support it.

14 years agoMake sure memcpy() works in 16bit mode also.
Kevin O'Connor [Tue, 16 Jun 2009 03:35:30 +0000 (23:35 -0400)]
Make sure memcpy() works in 16bit mode also.

Make sure %es is set before doing a "rep movs" call.

14 years agoFix compile of smpdetect - last commit missed an include.
Kevin O'Connor [Tue, 16 Jun 2009 03:16:15 +0000 (23:16 -0400)]
Fix compile of smpdetect - last commit missed an include.

14 years agoUnify mode16/32 compiler checks.
Kevin O'Connor [Tue, 16 Jun 2009 03:03:05 +0000 (23:03 -0400)]
Unify mode16/32 compiler checks.

Add ASSERT16/ASSERT32 macros to farptr.h.
Use those macros in place of open-coded checks.
Add "noreturn" attribute to functions to reduce compiler warnings.
Add ASSERT32 to smp_probe() to eliminate 16bit assembler warnings.

14 years agoMinor - clarify disabling "-combine" warning.
Kevin O'Connor [Tue, 16 Jun 2009 02:45:00 +0000 (22:45 -0400)]
Minor - clarify disabling "-combine" warning.

14 years agoAvoid -fwhole-program on broken gcc instead of stopping build.
Kevin O'Connor [Tue, 16 Jun 2009 02:27:01 +0000 (22:27 -0400)]
Avoid -fwhole-program on broken gcc instead of stopping build.

Enhance build to detect and avoid gcc with broken -fwhole-program
Also, remove workaround for older gcc that mess up global exports.

14 years agoAdd support for gcc v3.x compilers.
Kevin O'Connor [Thu, 11 Jun 2009 02:44:06 +0000 (22:44 -0400)]
Add support for gcc v3.x compilers.

Suppress __attribute__((externally_visible)) when no -fwhole-program
Add switch hack for compilers without -fno-jump-tables
Define memcpy() function (for compilers without -minline-all-stringops).
Define call16_simpint as a macro (a param needs to be inlined).
Make sure s3_resume is only defined in 32bit mode.

14 years agoDo garbage collection of unused sections.
Kevin O'Connor [Thu, 11 Jun 2009 01:56:01 +0000 (21:56 -0400)]
Do garbage collection of unused sections.

Implement -ffunction-sections and -fdata-sections in both 32bit and
    16bit code.
Make sure all sections have unique names (even asm and discarded
    sections).
Enhance tools/layoutrom.py script to find all sections reachable from
    exported 16bit code - prune all other sections.
Mark sections with "export" if they can be visible outside of code -
    these sections wont be dropped when pruning unused sections.

14 years agocheckstack.py should not match pushaw on stack usage check.
Kevin O'Connor [Thu, 11 Jun 2009 01:40:26 +0000 (21:40 -0400)]
checkstack.py should not match pushaw on stack usage check.

Tighten regex so that pushaw doesn't confuse parser.

14 years agoTry to check for IDE drive 0 responding to drive 1 commands.
Kevin O'Connor [Thu, 11 Jun 2009 00:33:57 +0000 (20:33 -0400)]
Try to check for IDE drive 0 responding to drive 1 commands.

If the IDE primary drive is responding to secondary drive, it's hard
    to detect if the secondary drive is really present - skip test.

14 years agoVGA: Move direct in/out calls out of vgafb.c.
Kevin O'Connor [Mon, 1 Jun 2009 02:42:04 +0000 (22:42 -0400)]
VGA: Move direct in/out calls out of vgafb.c.

Implement wrapper calls in vgaio.c and use them instead.

14 years agoVGA: Comment and name update.
Kevin O'Connor [Mon, 1 Jun 2009 02:00:20 +0000 (22:00 -0400)]
VGA: Comment and name update.

Remove remaining "biosfn_" prefixes from functions.
Don't use register names as function parameters.
vgafb_read_pixel should return a value (instead of passing in a pointer)

14 years agoVGA: Arrange screen writing functions to minimize stack.
Kevin O'Connor [Mon, 1 Jun 2009 01:15:33 +0000 (21:15 -0400)]
VGA: Arrange screen writing functions to minimize stack.

Pass pointer to cursor position into write_string and write_teletype.
Handle flag processing of write_string in handle_1013.
Implement a tail-recursive scroll_one() function.

14 years agoVGA: Reduce stack usage.
Kevin O'Connor [Mon, 1 Jun 2009 00:46:43 +0000 (20:46 -0400)]
VGA: Reduce stack usage.

Make 'struct carattr' 3 bytes in size - gcc does better with this.
Add 'noinline' directives to some funcs to reduce handle_10 stack usage.

14 years agoVGA: No need to scroll multiple times when writing a tab.
Kevin O'Connor [Mon, 1 Jun 2009 00:43:06 +0000 (20:43 -0400)]
VGA: No need to scroll multiple times when writing a tab.

A tab can only scroll the screen once.
Inline the code from check_scroll into write_teletype.
Also, move row check in write_string to handle_1013.

14 years agoVGA: Further simplify scrolling code.
Kevin O'Connor [Sun, 31 May 2009 19:25:14 +0000 (15:25 -0400)]
VGA: Further simplify scrolling code.

Introduce memcpy_stride and memset_stride functions.
Simplify the moves and fills using src and dest pointers.
Don't nest for loops - just use one loop for copies.

14 years agoVGA: Simplify scrolling implementation.
Kevin O'Connor [Sun, 31 May 2009 05:37:54 +0000 (01:37 -0400)]
VGA: Simplify scrolling implementation.

Check for nblines==0 in calling function.
Eliminate full screen clearing optimization.

14 years agoVGA: Fix bad commit to vgafb.c - missing '}'.
Kevin O'Connor [Sun, 31 May 2009 05:09:30 +0000 (01:09 -0400)]
VGA: Fix bad commit to vgafb.c - missing '}'.

14 years agoVGA: Define clear_screen in terms of memmodel.
Kevin O'Connor [Sun, 31 May 2009 04:53:18 +0000 (00:53 -0400)]
VGA: Define clear_screen in terms of memmodel.

Use vmode_g->memmodel instead of memmodel and svgamode.

14 years agoVGA: Breakup biosfn_scroll.
Kevin O'Connor [Sun, 31 May 2009 04:46:47 +0000 (00:46 -0400)]
VGA: Breakup biosfn_scroll.

Rename biosfn_scroll to vgafb_scroll.
Break function up into per-mode scroll function.
Pass row/col params in a 'struct cursorpos'.
Encode direction as sign in nblines.
Move parameter checking to callers.
Add enhancement to 'attr' for using mode specific default attribute.
Also, make get_cursor_pos local to vga.c.

14 years agoFix typo in irqentryarg declaration.
Kevin O'Connor [Sat, 30 May 2009 07:40:22 +0000 (03:40 -0400)]
Fix typo in irqentryarg declaration.

14 years agoIn register dump, show %esp - not address of regs.
Kevin O'Connor [Thu, 28 May 2009 02:27:10 +0000 (22:27 -0400)]
In register dump, show %esp - not address of regs.

The address of the callers stack can be inferred from the address of
    'regs' - do the math in the dump function.

14 years agoKeep relocated 16bit code so checkstack can use it.
Kevin O'Connor [Thu, 28 May 2009 02:23:33 +0000 (22:23 -0400)]
Keep relocated 16bit code so checkstack can use it.

Make was stripping the relocated 16bit code - keep the unstripped
    16bit code so that checkstack can parse it.

14 years agoVGA: Move cursor setting out of biosfn_write_teletype.
Kevin O'Connor [Tue, 26 May 2009 04:47:32 +0000 (00:47 -0400)]
VGA: Move cursor setting out of biosfn_write_teletype.

Call set_cursor_pos in callers that need it.

14 years agoVGA: Remove recursion from biosfn_write_teletype().
Kevin O'Connor [Tue, 26 May 2009 04:20:40 +0000 (00:20 -0400)]
VGA: Remove recursion from biosfn_write_teletype().

14 years agoVGA: Simplify vgafb_write/read_char.
Kevin O'Connor [Tue, 26 May 2009 04:05:37 +0000 (00:05 -0400)]
VGA: Simplify vgafb_write/read_char.

Pass cursor position into vgafb_write_char and vgafb_read_char.
Don't pass count into vgafb_write_char.
Break text writing into separate function.

14 years agoVGA: Remove vmode_g->class - store info in vmode_g->memmodel.
Kevin O'Connor [Tue, 26 May 2009 03:37:13 +0000 (23:37 -0400)]
VGA: Remove vmode_g->class - store info in vmode_g->memmodel.

14 years agoVGA: Use struct for car/attr/WITH_ATTR.
Kevin O'Connor [Mon, 25 May 2009 15:44:11 +0000 (11:44 -0400)]
VGA: Use struct for car/attr/WITH_ATTR.

The three parameters are used frequently together - define a struct to
    hold them.
Alos, merge biosfn_write_char_attr/_only into one function.

14 years agoVGA: Combine x/y/page into one parameter.
Kevin O'Connor [Mon, 25 May 2009 15:05:18 +0000 (11:05 -0400)]
VGA: Combine x/y/page into one parameter.

These three values are frequently used together - put them in a struct
    and pass the struct around.

14 years agoVGA: Inline biosfn_set_video_mode() into its only caller.
Kevin O'Connor [Mon, 25 May 2009 13:41:07 +0000 (09:41 -0400)]
VGA: Inline biosfn_set_video_mode() into its only caller.

14 years agoVGA: Replace biosfn_load_text_* with vgafb_load_font().
Kevin O'Connor [Mon, 25 May 2009 13:06:50 +0000 (09:06 -0400)]
VGA: Replace biosfn_load_text_* with vgafb_load_font().

The functions font loading functions are nearly identical - replace
    with one common function.

14 years agoVGA: Factor out hardware accesses from biosfn_set_video_mode.
Kevin O'Connor [Mon, 25 May 2009 04:44:29 +0000 (00:44 -0400)]
VGA: Factor out hardware accesses from biosfn_set_video_mode.

Create vgahw_set_mode() that handles low-level vga setup in vgaio.c.
Move screen clearing to new function in vgafb.c.

14 years agoVGA: Minor - improve indentation of palette structs.
Kevin O'Connor [Mon, 25 May 2009 04:12:18 +0000 (00:12 -0400)]
VGA: Minor - improve indentation of palette structs.

14 years agoVGA: Inline several functions in vga.c.
Kevin O'Connor [Mon, 25 May 2009 04:10:35 +0000 (00:10 -0400)]
VGA: Inline several functions in vga.c.

Move some functions directly into their only caller.
Also, fix bug in handle_101210 - don't set ax.

14 years agoAdd delay when changing drive on ide.
Kevin O'Connor [Sun, 24 May 2009 17:55:01 +0000 (13:55 -0400)]
Add delay when changing drive on ide.

Add ndelay(400) when changing drives.

14 years agoEliminate "_code32_" prefix on 32bit symbols referenced from 16bit code.
Kevin O'Connor [Sat, 23 May 2009 22:21:18 +0000 (18:21 -0400)]
Eliminate "_code32_" prefix on 32bit symbols referenced from 16bit code.

Use linking magic to eliminate the need for the _code32_ prefix.

14 years agoPack 16bit code into last part of f-segment.
Kevin O'Connor [Sat, 23 May 2009 21:49:44 +0000 (17:49 -0400)]
Pack 16bit code into last part of f-segment.

Locate 16bit code into the top of the f-segment.  (Before some of the
    16bit code was located just after the 32bit code.)

14 years agoVGA: Define structs for save/restore state calls.
Kevin O'Connor [Fri, 22 May 2009 03:06:08 +0000 (23:06 -0400)]
VGA: Define structs for save/restore state calls.

Define C structs for the state info.
Move hw specific code to vgahw.c.
Also, make sure to set 0x1c in regs->al on state save/restore calls.