Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some versions of gcc have been found to inline these funcions and then
cause the calling functions to use very large stack usage. Since
these functions are called from 16bit mode, their stack space usage is
very sensitive.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
virtio-scsi is a simple HBA that talks to the host via a single
vring. The implementation looks like a hybrid of usb-msc and
virtio-blk.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Unlike basic_access, extended_access does not check for a zero
sector count. However, this is a problem because for example
it would be interpreted as 256 when processing an ATA request.
Based on patch from: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Avoid ambiguity when virtio-scsi will be introduced.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Some guests (such as Linux) expect BIOS to behave according to T13
EDD3.0 spec. T13 spec is much better then Phoenix since it provides
more information about interface and device paths. This patch adds
support for the spec. If guest provides buffer with enough space for
T13 EDD info return EDD according to T13 spec otherwise use Phoenix
one.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
|
|
The "Drives" struct just held three global variables - declare the
three global variables independently.
|
|
Fill out entire EDD 3.0 structure for virtio disk. Currently only EDD 1.0
part is filled which is missing such important info as device path. Use
SCSI device type since virtio is not defined by EDD spec and virtio disk pci
device uses SCSI class.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
|
|
|
|
Don't limit the number of ATA controllers supported - just dynamically
allocate the structs.
Create an atadrive_s struct that extends the standard 'struct drive_s'
and have the new struct store a pointer to the ata channel info.
Also, prefer storing drive_s pointers as 32bit "flat" pointers -
adjust them as needed in the 16bit code.
|
|
There is no need for custom warnings for many common failures.
Introduce a common warning which is consistent and more visible.
|
|
Omitting "void" leads to a K&R style declaration which was not intended.
|
|
Commit new dsdt with recent changes.
Add some misc comments.
Also, fix uninitialized warning in mptable code.
|
|
Don't use "fail" in the debug output - as this confuses users.
When reporting on an invalid parameter - use the word "invalid".
When reporting on an unimplemented call - state it is unimplemented.
Add separate debug levels for unimplemented vs invalid calls.
Also, increase the debug level of several entry points.
|
|
Add probing for ISA ATA devices when no pci devices found.
Also, add defines for common ATA ports.
Also, make sure irq and pci_bdf are defined for both pci ata controllers.
|
|
Update todo list.
Fix spelling errors in acpi debug messages.
Don't call DISK_STUB() in format - use debug_stub() instead.
|
|
Pass a pointer to the drive_s struct instead of a driveid array offset.
Don't allocate ata drive's until a real drive found.
Introduce getDrive() and allocDrive() functions.
|
|
Add a new backend driver for cd emulation (DTYPE_CDEMU). This backend
driver now does the work of scheduling mis-sized reads.
Add mechanism for obtaining emulated drive geometry.
Extend disk_1308() to support cdrom emulation.
Use regular disk_13*() calls even for cdemu.
Also, unify the X_SECTOR_SIZE definitions.
|
|
Introduce 'struct segoff_s' to more places.
|
|
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.
|
|
Implement low-level floppy commands using the disk_op structure.
The requests can then be filled using the regular disk_13xx functions.
|
|
Merge floppy_1301/1308/1315/1316/_ret() functions with their disk equivalents.
Store floppy type in drives structure.
|
|
|
|
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
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
The bug caused floppies to move when hard drive emulation was in
effect, and vice-versa. This patch fixes it.
|
|
|
|
The "flat" mode variants work in real mode, but will not work in
protected mode. So, replace with versions that take explicit
segments.
|
|
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".
|
|
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.
|
|
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.
|
|
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).
|
|
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.
|
|
A missing 'return' statement caused the error to not be returned.
|
|
This reduces stack usage (old dos programs don't provide much space).
|
|
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
|
|
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.
|
|
For those places that repeatedly read/write to the ebda, caching the
ebda segment improves code generation.
|
|
The dpte, cdrom locks, and disk sector count remain in the ebda.
Also, enhance SET_GLOBAL macro to avoid unused variable warnings.
|
|
Some option roms will try to relocate the ebda.
Also fix an apparent typo in the assignment of ivecs[0x46].
|
|
|