Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Several checksum functions were scattered through source - use just one.
|
|
|
|
Determining which device to boot from should not depend on CONFIG_CDROM_BOOT
Instead, always use the cmos 0x38/0x3d for determining boot order.
|
|
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.
|
|
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'.
|
|
|
|
Support '%p' format in bprintf.
Display pointer of register in debug output (useful for calculating
start stack).
|
|
With -fwhole-program it is not necessary to put inline functions into
headers. So, move the internal defs and code to ata.c.
|
|
The extended read methods must be disabled.
Resynch with original bochs bios list of available functions.
|
|
Calls to disk_ret with an error code already log - don't log twice.
|
|
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.
|
|
Rename MAKE_32_PTR to MAKE_FARPTR.
Rename PTR_TO_SEG to FARPTR_TO_SEG.
Rename PTR_TO_OFFSET to FARPTR_TO_OFFSET.
|
|
regs->ah was getting clobbered in call to disk_ret().
|
|
This allows one to support just booting from cdroms that don't require
floppy/harddisk emulation.
|
|
Compilation on Ubuntu fails without this.
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
|
|
Using set_success permits easier debug hooks in the future.
|
|
This fixes reboots.
|
|
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.
|
|
Remove some redundant code from Makefile.
Improve a couple of comments.
|
|
Order of stack was not correct.
New implementation still needs to be tested.
|
|
Split the function into several smaller functions.
|
|
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.
|
|
Now kbd.c is compiled by both 16bit and 32bit code.
|
|
- 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>
|
|
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).
|
|
Move irq_enable into all callers - only disk.c had irqs disabled anyway.
|
|
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.
|
|
|
|
|
|
Clearing the area makes analyzing memory dumps a little easier.
|
|
The C code won't clobber these registers, so backing them up isn't needed.
Removing them saves a few bytes on the stack.
|
|
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.
|
|
This patch makes bregs structure declared with PACKED macro (biosvar.h)
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
|
|
|
|
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.
|
|
Buffer size was in wrong argument position.
Clarify code by using sizeof().
|
|
|
|
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.
|
|
The functions are very similar.
|
|
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.
|
|
The asm was setting regs->cx to zero - use a temp variable to avoid that.
|
|
|
|
Wrap comparison must be done with 16bit values.
Must use 16bit form of lgdt instruction.
|
|
Make sure we properly try next device on failures.
|
|
Unify the return code in ata.trsfsectors (don't use trsfbytes).
Also includes minor code clean ups.
|
|
|
|
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.
|
|
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.
|
|
It seems to improve code generation.
|