Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Helge Deller <deller@gmx.de>
|
|
Signed-off-by: Helge Deller <deller@gmx.de>
|
|
Boot directly from ATA drive without going through the process_op_32()
function. Additionally PA-RISC can read/write chunks from disk which
are bigger than 64kb, so don't abort when this is tried.
Signed-off-by: Helge Deller <deller@gmx.de>
|
|
Use the get_bda_ptr() accessor function instead of hardcoding with
MAKE_FLATPTR().
Signed-off-by: Helge Deller <deller@gmx.de>
|
|
Boot devices which use overriden LCHS values are:
* ata
* ahci
* scsi
* esp
* lsi
* megasas
* mpt
* pvscsi
* virtio
* virtio-blk
We use these values in get_translation() and setup_translation() by
introducing a new translation type: "TRANSLATION_HOST".
We treat this translation as TRANSLATION_NONE in fill_ata_edd(),
although this does not really matter since now the translation between
physical and logical geometry does not exist.
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com>
Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com>
Message-Id: <20190626123816.8907-6-shmuel.eiderman@oracle.com>
|
|
This reverts commit 9caa19be0e534c687081fbdfcd301406e728c98c.
|
|
Boot devices which use overriden LCHS values are:
* ata
* ahci
* scsi
* esp
* lsi
* megasas
* mpt
* pvscsi
* virtio
* virtio-blk
We use these values in get_translation() and setup_translation() by
introducing a new translation type: "TRANSLATION_MACHINE".
We treat this translation as TRANSLATION_NONE in fill_ata_edd(),
although this does not really matter since now the translation between
physical and logical geometry does not exist.
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com>
Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com>
Message-Id: <20190612093704.47175-6-shmuel.eiderman@oracle.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Now that the drive_s struct does not need to be in the f-segment,
rename references to drive_gf in the generic drive code to drive_fl.
This is just variable renames - no code changes.
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Allow the 'struct drive_s' drive description structure to be in either
the "low" memory segment or the f-segment.
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This patch enables SeaBIOS to boot from NVMe. Finding namespaces and
basic I/O works. Testing has been done in qemu and so far it works with
Grub, syslinux, and the FreeBSD loader. You need a recent Qemu (>=
2.7.0), because older versions have buggy NVMe support.
The NVMe code is currently only enabled on Qemu due to lack of testing
on real hardware.
Signed-off-by: Julian Stecklina <jsteckli@amazon.de>
|
|
If CONFIG_ENTRY_EXTRASTACK is set (enabled by default) then the 16bit
disk interface code is already running on the extra stack and it is
not necessary to support stack switching on each disk request.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The send_disk_op() function is only called from the 16bit handlers
found in disk.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also known as Fusion MPT disk; this controller model is supported
by VirtualBox and VMware, and QEMU support patches have been
posted.
Signed-off-by: Don Slutz <Don.Slutz@Gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the list of drive setup calls from post.c to a new function in
block.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The sector count is a 64bit number that is often reported as a 32bit
number (due to limitations in dprintf). Consistently use "%u"
reporting to avoid confusing negative numbers.
Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The C code only uses _cfuncX_ prefixes for parameters to the call32(),
stack_hop_back(), and call32_params() functions. It's simpler to use
macro wrappers around those functions which provide the required
prefix.
This also changes the parameter order of stack_hop() and
stack_hop_back() to use the more natural (func, params) ordering.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Have callers of fill_generic_edd() calculate the edd iface_path
field. Have callers determine if the bus type is PCI vs ISA.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
When specifying drives in the bootorder file, the "drive@x" parameter
should be relative to the given PCI device and not relative to the
total number of ATA controllers in the machine. This patch separates
the tracking of "chanid" (channel number relative to a given PCI
devices) from the "ataid" (channel number relative to the total number
of ATA channels).
Reported-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename disk driver dispatch functions to a consistent naming style.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Most disk drivers only implement a couple of the available bios
commands. Unify the common fallback handling code into a new function
default_process_op() to reduce boiler-plate code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Introduce process_op_32(), process_op_16(), and process_op_both() and
split the disk driver command dispatch by its runtime mode
requirements. This makes it more clear which modes each driver runs
in. It also reduces the call32() boiler-plate code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
virtio version 1.0 registers can (and actually do in the qemu
implementation) live in mmio space. So we must run the blk and
scsi virtio drivers in 32bit mode, otherwise we can't access them.
This also allows to drop a bunch of GET_LOWFLAT calls from the virtio
code in the following patches.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
The standard BIOS disk read/write request interface should never get a
request for more than 64K of data. Explicitly check for overly large
requests and reject them. This way, the low-level drivers do not need
to check for or attempt to handle very large requests.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This adds basic read/write support for SD cards emulated by QEMU.
This code is not expected to work on real hardware, because the
current controller and card initialization is not robust.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This also changes DTYPE_VIRTIO_SCSI drives to report that they are
using a "SCSI" bus instead of an "ATA" bus - it was obviously
incorrect before.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't look for DTYPE_ATA_ATAPI to determine if a removable media (such
as a cdrom) is present, instead look for a -1 in the sector count.
This improves the results for cdroms on controllers other than ATA
ATAPI.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Since the XHCI driver needs to jump into 32bit mode anyway, it is
simpler to just run all of the code in 32bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Instead of jumping into 32bit mode to access the PCI config space, run
the entire driver in 32bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that the op->count field is cleared in a global location on simple
errors, remove various local clears done in individual drivers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The total number of blocks transferred is part of the return status of
the BIOS API. This is normally the total number of blocks requested.
However, in an error it is possible for this count to be less. Add a
global check to ensure that on an error event the block count is
updated - if it hasn't been updated, assume that no blocks have been
transferred successfully (the common case).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The "drive" structure is always malloc'ed and therefore always starts
off described as a 32-bit "flat" pointer. Instead of switching
to/from 16bit pointers, make all the code use the 32bit pointer. This
eliminates the confusing 16/32 bit pointer switches.
This patch also removes the "_g" suffixes on local variables in
functions that are always called in 32bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Testing was done on windows images (win 2008/2012) taken from esx with vmware
tools installed and boot disk configured to use pvscsi.
Also I've used linux (ubuntu 12.04) where pvscsi drivers are installed by
default and booted it using qemu cmd similar to this:
./x86_64-softmmu/qemu-system-x86_64 -snapshot -device pvscsi,id=pvscsi0 \
-device scsi-disk,bus=pvscsi0.0,drive=drive0 \
-drive id=drive0,if=none,file=ubuntu-12.04.qcow2 \
-bios roms/seabios/out/bios.bin
Signed-off-by: Evgeny Budilovsky <evgeny.budilovsky@ravellosystems.com>
|
|
The ahci driver needs to jump into 32bit mode in order to access
portions of the ahci controllers PCI config space. Instead of jumping
into 32bit mode just to toggle the ahci registers, jump into 32bit
mode for all of the driver interactions. This shrinks the size of the
overall code and can lead to further cleanups.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename the fields of 'struct chs_s' so that it can be used both to
describe a drive and to describe a particular sector on a drive.
Update floppy.c:lba2chs() to return a 'struct chs_s' instead of
passing the results via pointers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Group the Real Time Clock code into hw/rtc.[ch].
Also, use rtc_read/write/mask function naming (instead of
inb/outb_cmos) to be more consistent with other register accessors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, sort the order of include files in the c files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|