| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Use cdrom_read() instead of cdrom_read_512() for loading the initial
image. The initial image will always start on a 2K block, and it
should be okay to load extra sectors if the sector count doesn't
end on a 2K boundary.
|
|
|
|
| |
The standard functions are better known and not harder to implement.
|
|
|
|
|
|
|
| |
Add code to search for roms in the "coreboot file system".
Change hardcode option rom detection to use vendor/deviceid instead of
bus/device/fn.
Move streq() function to generic place so cbfs functions can use it.
|
| |
|
|
|
|
|
|
| |
Don't just loop 50/300 times for 5/30 seconds - use real timers.
Reorganize code - move read capacity to its own function.
Fix apparent bug - atapi_get_sense() returns zero on success.
|
|
|
|
|
|
|
| |
Define and use a struct for the master boot record.
Simplify cdrom emulation chs setting code.
Fix an apparent bug in harddrive chs setting - it wasn't properly
masking the spt/cyl fields.
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Rename VAR16 to VAR16_32 -- that macro supports accesses from both
16bit and 32bit mode.
Introduce a new macro VAR16 that must be present on all global
variables accessed from 16bit mode.
|
|
|
|
|
| |
The dpte, cdrom locks, and disk sector count remain in the ebda.
Also, enhance SET_GLOBAL macro to avoid unused variable warnings.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Minor code cleanups.
Fix parenthesis imbalance in keyboard led test.
The printf() call is only used in 32bit mode - make this explicit to
the compiler - it improves the code generation.
Clear the screen after initializing the vga option rom.
|
| |
|
|
|
|
|
|
| |
Replace DEBUGF calls with dprintf calls.
Make ata calls consistently use 'int' return codes.
Make each error return code in ata.c use a unique negative number.
|
|
|
|
|
|
| |
Rename BX_INFO() to dprintf() and add a "severity level" parameter.
Add CONFIG_DEBUG_LEVEL compile option to control debug verbosity.
Add more debug info to init steps of post.c.
|
|
|
|
| |
Break up some functions and play with inlining to reduce stack usage.
|
|
|
|
|
| |
Clean up some warnings.
Make sure floppy_dbt structure is aliagned to 1 byte boundary.
|
|
|
|
|
| |
The extended read methods must be disabled.
Resynch with original bochs bios list of available functions.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This allows one to support just booting from cdroms that don't require
floppy/harddisk emulation.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Buffer size was in wrong argument position.
Clarify code by using sizeof().
|
| |
|