aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2008-03-30Update README file with more information on using the bios.rel-0.2.0Kevin O'Connor1-23/+129
2008-03-29Unify checksum functions.Kevin O'Connor5-59/+25
Several checksum functions were scattered through source - use just one.
2008-03-29Fix bugs in GET/SET_FARPTR macros.Kevin O'Connor1-5/+7
2008-03-29Cleanup boot order determination.Kevin O'Connor2-21/+9
Determining which device to boot from should not depend on CONFIG_CDROM_BOOT Instead, always use the cmos 0x38/0x3d for determining boot order.
2008-03-29Merge IPL segment into EBDA segment.Kevin O'Connor3-68/+57
It does not appear that IPL info needs to be at exactly 0x9ff00. Have IPL struct be part of ebda structure - it prevents unintended overlaps. Also, ATA structs don't need to be packed.
2008-03-29Refactor ata code.Kevin O'Connor3-305/+240
Have await_ide return status code (so callers don't need to reread status). Introduce pause_await_ide for cases where we need to wait an ata cycle. Implement 400ns wait according to ata specs. Consistently used 'driveid' instead of 'biosid', 'devid', 'device'. Unify cdrom and hd transfer code into single function - ata_transfer. Use less inlining. Remove unused ebda variable 'trsfbytes'.
2008-03-29Reorder basic_access() to reduce stack usage.Kevin O'Connor1-12/+12
2008-03-29Minor debugging improvements.Kevin O'Connor1-3/+3
Support '%p' format in bprintf. Display pointer of register in debug output (useful for calculating start stack).
2008-03-23Move internal defs from ata.h to ata.c.Kevin O'Connor2-50/+50
With -fwhole-program it is not necessary to put inline functions into headers. So, move the internal defs and code to ata.c.
2008-03-22Limit cdrom emulation available functions.Kevin O'Connor1-2/+17
The extended read methods must be disabled. Resynch with original bochs bios list of available functions.
2008-03-22Remove redundant debug statements from disk.c.Kevin O'Connor1-2/+0
Calls to disk_ret with an error code already log - don't log twice.
2008-03-22Cleanup cdrom emulation.Kevin O'Connor5-112/+100
Remove 'header' param for ata_cmd_packet - the only code that uses it is cdrom emulation. So, bury this detail in ata.c. Introduce new helpers cdrom_read_emu and cdrom_read_512 for working with emulated cdrom drives. Unify basic_access() and emu_access() - now basic_access() can read from cdrom drives.
2008-03-22Use "FARPTR" consistently in macros.Kevin O'Connor5-31/+31
Rename MAKE_32_PTR to MAKE_FARPTR. Rename PTR_TO_SEG to FARPTR_TO_SEG. Rename PTR_TO_OFFSET to FARPTR_TO_OFFSET.
2008-03-22Fix disk_1301 handler.Kevin O'Connor1-3/+6
regs->ah was getting clobbered in call to disk_ret().
2008-03-22Breakout cdrom emulation support into CONFIG_CDROM_EMU.Kevin O'Connor4-26/+37
This allows one to support just booting from cdroms that don't require floppy/harddisk emulation.
2008-03-21Guard header file pci.hKevin O'Connor1-0/+5
Compilation on Ubuntu fails without this. Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
2008-03-21Minor change - use set_success() instead of set_cf in pcibios.c.Kevin O'Connor1-1/+1
Using set_success permits easier debug hooks in the future.
2008-03-16Make sure we zero bss before calling rombios32 code.Kevin O'Connor2-1/+5
This fixes reboots.
2008-03-16Basic support for PCI BIOS.Kevin O'Connor8-51/+381
This patch adds real-mode pci bios callbacks. It also adds support for a hardcoded $PIR table. The pci config functions are moved from rombios32.c to pci.c. Note that protected mode pci-bios calls were not added.
2008-03-15Minor cleanups.Kevin O'Connor4-6/+3
Remove some redundant code from Makefile. Improve a couple of comments.
2008-03-13Fix bug in apm32protected_entry.Kevin O'Connor1-9/+15
Order of stack was not correct. New implementation still needs to be tested.
2008-03-13Split up ata_detect() function.Kevin O'Connor1-238/+240
Split the function into several smaller functions.
2008-03-13Use LBA disk access methods always; don't use CHS methods.Kevin O'Connor3-44/+11
Using CHS is dependent on the drive type, not the request type. So, old code was not correct. It is simpler to just always use LBA.
2008-03-12Move keyboard setup to kbd.c.Kevin O'Connor4-148/+167
Now kbd.c is compiled by both 16bit and 32bit code.
2008-03-12Update interger types in rombios32 code.Kevin O'Connor2-280/+273
- Make rombios32.c to use the interger types already defined in types.h - Add u64 typedef Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
2008-03-12Move ata_detect call to 32bit code.Kevin O'Connor3-15/+9
It's more natural to call the detect code from post. It does require some of the ATA support code be compiled in twice (once in 32bit mode and once in 16 bit), however that only leads to a small increase in total C code (~250 bytes).
2008-03-12Move irq_enable/disable out of ata.cKevin O'Connor2-7/+10
Move irq_enable into all callers - only disk.c had irqs disabled anyway.
2008-03-12Use 32bit absolute pointers for buffers in ATA code.Kevin O'Connor5-98/+121
Using 32bit pointers makes the code a little simpler. It also allows the code to be used from 32 bit mode. It does require all callers to encode the segment/offset into an absolute address. The ins/outs functions also need to know how to convert from 32bit back to segment/offset addresses. The change also includes a minor cleanup of the macros in farptr.h.
2008-03-11Add FIELD_SIZEOF macro to types.hKevin O'Connor1-0/+1
2008-03-11Use SET_BDA and GET_BDA to modify and retrieve BDA fields (post.c)Kevin O'Connor1-57/+61
2008-03-11Clear area changed during shadow enable.Kevin O'Connor1-0/+3
Clearing the area makes analyzing memory dumps a little easier.
2008-03-11Don't pass in ebp/esp to irq handlers.Kevin O'Connor4-87/+100
The C code won't clobber these registers, so backing them up isn't needed. Removing them saves a few bytes on the stack.
2008-03-11Don't save/restore flags and ebp on external calls - saves on stack space.Kevin O'Connor6-14/+14
It isn't necessary to save ebp - just mark it as clobbered. The only important flag to save/restore is irqs - manually fixup all callers.
2008-03-11use PACKED for bregs declarationKevin O'Connor1-1/+1
This patch makes bregs structure declared with PACKED macro (biosvar.h) Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
2008-03-11Ignore out/ directory.Kevin O'Connor1-0/+1
2008-03-11Reorganize ata code; reduce stack usage.Kevin O'Connor4-355/+405
This fixes an issue with freedos lbacache - the bios was overrunning the stack on disk requests. The code has been simplified by extracting common code. Some handlers moved to inline code to reduce overall stack usage.
2008-03-11Fix bug in atapi_get_sense.Kevin O'Connor1-2/+2
Buffer size was in wrong argument position. Clarify code by using sizeof().
2008-03-11Halt machine on call to BX_PANIC.Kevin O'Connor1-2/+6
2008-03-11Force functions marked as inline to always be inlined.Kevin O'Connor2-1/+4
Inline alters stack usage, so don't let gcc uninline. Also, gcc seems to include multiple copies of uninlined functions when using -combine. With inlining forced on, the no null check optimization causes problems, so disable it.
2008-03-11Unify ata_cmd_data_in/out functions.Kevin O'Connor3-191/+65
The functions are very similar.
2008-03-11Reduce stack usage for ISRs; minor fixes.Kevin O'Connor12-67/+116
Don't back up all registers on isr handlers - they don't read/modify them. This saves stack space. extended_bios_data_area_s must be packed to match ebda spec. Enable irqs on int 08 - follows old bochs bios code. Fix bug in int 76 -- should clear disk_interrupt_flag not floppy_harddisk_info. Make sure we alert in disk_ret on failure case. int 18/19 entry points need to setup cld/%ds too. asm in handle_1587 clobbers flags - note that in clobber list.
2008-03-09Call to int 1587 shouldn't alter regs->cx.Kevin O'Connor1-1/+2
The asm was setting regs->cx to zero - use a temp variable to avoid that.
2008-03-09Minor debugging improvements.Kevin O'Connor3-4/+8
2008-03-09Fix bug in int 1587.Kevin O'Connor1-5/+6
Wrap comparison must be done with 16bit values. Must use 16bit form of lgdt instruction.
2008-03-09Fix booting logic on failure.Kevin O'Connor1-4/+11
Make sure we properly try next device on failures.
2008-03-09Fix bug in cdrom reads causing incorrect return status.Kevin O'Connor1-24/+19
Unify the return code in ata.trsfsectors (don't use trsfbytes). Also includes minor code clean ups.
2008-03-09Make sure global variables are zerod before exiting bios post.Kevin O'Connor1-0/+4
2008-03-09Simplify e820 map generation.Kevin O'Connor1-43/+27
Clean up by moving code from handle_15e820 to set_e820_range. Set ES explicilty prior to populating the map - the code was relying on nothing changing it.
2008-03-09Replace debug_exit calls with debug info while setting a failure.Kevin O'Connor10-118/+124
Calling debug_exit at the end of a call doesn't help much - several of the registers are already clobbered at this point. It also increases stack usage because it prevents call tail optimization in many places.
2008-03-09Add build option -fomit-frame-pointer.Kevin O'Connor1-1/+1
It seems to improve code generation.