| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Printing the return value of `scsi_is_ready()` is a debug message, so
change the log level from 1 to 5.
Booting from DVD/CD...
Device reports MEDIUM NOT PRESENT
scsi_is_ready returned -1
Boot failed: Could not read from CDROM (code 0003)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
|
|
|
|
|
|
| |
Show the volume label of bootable cdroms.
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>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Support sending scsi style "command data block" commands (cdbcmd)
through the 'struct disk_op_s' command request structure. And change
the blockcmd.c and cdrom.c code to route these commands through the
process_op() code.
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>
|
|
|
|
|
|
|
|
| |
This is the result of an audit of callers of the malloc_XXX() and
memalign_XXX() calls. All callers need to check if these functions
return NULL.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds invocations of functions that measure various parts of the
code and data through various parts of the BIOS code. It follows TCG
specifications on what needs to be measured. It also adds the implementation
of the called functions.
Reference for what needs to be measured can be found in specs found here:
http://www.trustedcomputinggroup.org/resources/pc_client_work_group_specific_implementation_specification_for_conventional_bios
The first measurements are done once the ACPI tables have been initialized.
Once booted into Linux, the current measurements produce the following logs
which can be found in /sys/kernel/security/tpm0/ascii_bios_measurements.
The below log also shows measurements from trusted grub.
1 3fb240d2a04085a4e84f81e4398e070ed5a18163 06 [SMBIOS]
2 cc812353fc277c1fab99e0b721752a1392984566 06 [Option ROM]
2 9dbd87163112e5670378abe4510491259a61f411 05 [Start Option ROM Scan]
2 6f74e357331b8dee11bbad85f27bc66cb873106c 06 [Option ROM]
2 5626eb7ac05c7231e46d7461e7d3839b03ae9fad 06 [Option ROM]
4 c1e25c3f6b0dc78d57296aa2870ca6f782ccf80f 05 [Calling INT 19h]
0 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
1 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
2 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
3 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
4 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
5 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
6 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
7 d9be6524a5f5047db5866813acf3277892a7a30a 04 []
4 8cf2fe6c87d4d0b2998a43da630292e6d85ee8b6 05 [Booting BCV device 80h (HDD)]
4 5dff94459a3e2d13a433ef94afdc306144565bf7 0d [IPL]
5 d1b33afde65ad47502332af957c60f20c84c1edc 0e [IPL Partition Data]
4 487ce764b527ccad17f1d04243d0136fa981e6c4 0d [IPL]
4 91d285e4dead566324c8938a3cc75803f462d9a1 0d [IPL]
4 8ba79ac98bb491524fef29defc724daaf6263d35 0d [IPL]
4 c591c15b82e4ff30e7383a4ff1ef3b41b38521ac 06 []
4 8cdc27ec545eda33fbba1e8b8dae4da5c7206972 04 [Grub Event Separator]
5 8cdc27ec545eda33fbba1e8b8dae4da5c7206972 04 [Grub Event Separator]
5 e8673b9e14b02dc12d8ccfd0176bca7a3de7fc3c 0e [IPL Partition Data]
5 0163e375a0af7525c5dac1a8e74b277359e40d1d 1105 []
8 4be30f67c3d48ab7f04d9c0fd07f06d4c68379be 1205 []
8 54c83965978de9708d026016ecb0e70660e04388 1305 []
5 2431ed60130faeaf3a045f21963f71cacd46a029 04 [OS Event Separator]
8 2431ed60130faeaf3a045f21963f71cacd46a029 04 [OS Event Separator]
8 f3973cae05d6e2055062119d6e6e1e077b7df876 1005 []
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
A cdrom boot image could be over 64K in size, but the low level
drivers may not support very large reads. If a large cdrom image is
found, issue multiple reads so that a read request over 64K is never
issued.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Use the scsi_process_op() function instead of the lower level
cdb_read() function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Store the fields necessary to export the "el-torito" spec information
directly in an internal copy of the "el-torito" struct. This
simplifies the interface and obviates the need for an internal home
grown struct with the same info.
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 "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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Move many C files from the src/ directory to the new src/hw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Rename remaining "build" settings in config.h that used the CONFIG_
prefix to use a BUILD_ prefix.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all users of the alternative variable exports to VARFSEG.
There isn't a significant distinction between the existing types of
exports, so it's simpler to just use one type going forward.
The new VARFSEG declaration is only emitting when in 32bit mode, so
update and move some variables as needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The POST phase has to invoke many initialization functions, and these
functions can have complex inter-dependencies. Try to categorize the
functions into 4 classes:
preinit - functions called very early in POST where function ordering
is very important and the code has limited access to other
interfaces.
init - functions that initialize internal interfaces and standard
external interfaces. This code is generally not dependent on
particular hardware and typically does not communicate directly
with any hardware devices.
setup - functions which access hardware or are dependent on particular
hardware or platform devices.
prepboot - functions that finalize internal interfaces and that
prepare for the boot phase.
This patch attempts to normalize the suffixes - functions that used
_init(), _setup(), _finalize(), or similar that did not follow the
above pattern were renamed. Other than function name changes, there
should be no code impact to this patch.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Unify the ATA and AHCI ATAPI command processing into one function in
block.c (process_atapi_op).
This patch disables the existing handlers for ATA ATAPI isready and
reset. However, it's unlikely that support is needed and it does not
appear that the implemented support is fully correct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Remove these infrequently used macros and replace with explicit
GET_BDA/SET_BDA calls.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Add the wait loop that CDs are already using to usb-msc in the HD
case, to cope with a NOT READY or UNIT ATTENTION condition.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The READ CAPACITY output is not used except for some debugging messages.
In the future, we will use this code for USB sticks too, but those
already send READ CAPACITY. To avoid code duplication, switch to TEST
UNIT READY for this task.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
|
| |
This patch creates a common bounce buffer in block.c which
is shared by the cdrom and ahci drivers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
|
|
| |
The "Drives" struct just held three global variables - declare the
three global variables independently.
|
|
|
|
|
|
|
|
|
|
| |
Current code creates only one IPL entry of type IPL_TYPE_CDROM even if
there are more then one CDROM drive present. If CDROM that the entry
refers to is not bootable there is no way to retry boot from another
CDROM. Fix this by creating IPL entry for each CDROM drive found. First
CDROM will always be placed in IPL entry 3 for backwards compatibility.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
|
|
|
|
|
| |
Now that a soft-reboot forces a hard-reboot, it is no longer necessary
to manually reset global variables.
|
|
|
|
|
|
|
| |
Using the low memory buffer gives more flexibility with the final
location of the buffer.
Don't allocate the buffer at all if no cdrom drives are present.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Move common "cdb" request functions to a new file.
|
|
|
|
|
| |
This eliminates the limit on the number of available drives. It also
allows for each driver to allocate additional custom fields.
|
|
|
|
|
| |
Introduce standard definitions and names for the "command data block"
commands used in the cdrom code.
|
|
|
|
| |
Omitting "void" leads to a K&R style declaration which was not intended.
|
|
|
|
| |
Handle case where timetamp counter overflows while waiting.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|