aboutsummaryrefslogtreecommitdiffstats
path: root/src/block.c
Commit message (Collapse)AuthorAgeFilesLines
* Support for booting from virtio disksGleb Natapov2010-05-101-0/+3
| | | | | | This patch adds native support for booting from virtio disks to Seabios. Signed-off-by: Gleb Natapov <gleb@redhat.com>
* Force use of indirect function calls in inline assembler.Kevin O'Connor2010-03-201-1/+1
| | | | | | | | | | | | For indirect calls, place function address in a register and call it. This is less optimal when gcc can inline the code and the destination address is known at compile time. However, older gcc compilers don't do as well with inlining, and they then mess up the code generation. There doesn't seem to be a way to tell gcc how to emit the code correctly for both immediate addresses and register addresses, so fall back to a safe way. Also, reduce params to stack_hop to avoid register assignment issues.
* Dynamically allocate ata_channel info; introduce custom atadrive_s struct.Kevin O'Connor2010-02-281-3/+6
| | | | | | | | | | | 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.
* Cleanup - build drive description in temp memory during init.Kevin O'Connor2010-02-211-28/+0
| | | | | | | | | Remove describe_drive() mechanism for calling printf with a drive description. Instead, have each drive build a description in temporary ram during drive initialization. Also, remove fields now unneeded from 'struct disk_s' - model and cntl_info.
* Initial support for booting from USB drives.Kevin O'Connor2010-02-171-0/+6
| | | | | | | | This patch adds initial support for USB Mass Storage Controllers. This includes support for bulk transfers on UHCI controllers. Code to detect a USB MSC device is added, and wrappers for sending "cdb" block commands over USB are added. The scsi "inquiry" command is also added.
* Don't require a valid physical cylinders/heads/spt for logical mapping.Kevin O'Connor2010-02-171-7/+10
| | | | | | | Modern drives don't provide a "physical" chs report - try to detect that and force an LBA mapping in that case. Also, don't require setup_translation be called only on ATA drives.
* Dynamically allocate each drive_g with malloc_fseg().Kevin O'Connor2010-02-151-33/+13
| | | | | This eliminates the limit on the number of available drives. It also allows for each driver to allocate additional custom fields.
* Introduce standard warnings for allocation failures and timeouts.Kevin O'Connor2010-02-141-1/+1
| | | | | There is no need for custom warnings for many common failures. Introduce a common warning which is consistent and more visible.
* Set FDPT in irq table even for small drives.Kevin O'Connor2010-01-031-14/+13
| | | | Fix bug due to fill_fdpt exiting early in non-logical drive case.
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-2/+2
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.Kevin O'Connor2009-12-261-1/+1
| | | | | Prepare for support of segmented 32bit code. Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
* Add floppy and cdrom drives in sorted order.Kevin O'Connor2009-11-251-18/+37
| | | | | With threads a cdrom could be found in random order - so always add to the idmap in a defined manor.
* Fix compiler warning in setup_translation().Kevin O'Connor2009-11-091-1/+1
| | | | Assign 'desc' just to silence compiler warning.
* Improve debugging output from threads.Kevin O'Connor2009-10-241-7/+11
| | | | | Show the "thread id" on each debug message sent from a thread. Also, cleanup translation dprintf() so it looks nicer withe thread output.
* Replace irq_enable() regions with explicit calls to check for irqs.Kevin O'Connor2009-10-241-4/+0
| | | | | | | | Add new function yield() which will permit irqs to trigger. The yield() call enables irqs to occur in 32bit mode. Add [num]sleep calls that yield instead of just spinning. Rename existing int 1586 usleep call to biosusleep. Convert many calls to mdelay to msleep.
* Pass 'drive_s' pointer instead of driveid.Kevin O'Connor2009-10-221-40/+72
| | | | | | 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.
* Fix bug in fdpt filling - driveid is not hdid.Kevin O'Connor2009-09-201-5/+5
| | | | Make sure driveid is used properly.
* Unify cd emulation access and main disk access code.Kevin O'Connor2009-09-121-1/+3
| | | | | | | | | 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.
* Add mechanism for describing internal drives in boot menu.Kevin O'Connor2009-09-121-0/+25
| | | | | | | | Allow each drive type to describe itself on the boot menu. This fixes a bug where driveid was used in place of ataid in the boot menu. Also, expand descriptions for each drive type. Don't overload the IPL type for BCVs - instead introduce new types.
* Replace common segment/offset pairs with struct segoff_s.Kevin O'Connor2009-09-091-4/+4
| | | | Introduce 'struct segoff_s' to more places.
* Rename VAR16_32 to VAR16VISIBLE.Kevin O'Connor2009-09-091-1/+2
| | | | | Sometimes VAR16_32 is used to export a definition to assembler, so clarify its naming.
* Add support for using floppy images in CBFS.Kevin O'Connor2009-08-161-2/+4
| | | | | | Add new "ramdisk" type for disk accesses. Extract out high-mem finding code from pmm into find_high_area(). Fix bug in GDB_BASE and GDT_LIMIT macros (wrong bit shifts).
* Unify floppy and harddrive command routing.Kevin O'Connor2009-08-161-0/+59
| | | | | Implement low-level floppy commands using the disk_op structure. The requests can then be filled using the regular disk_13xx functions.
* Add floppy controllers to "drives" list also.Kevin O'Connor2009-08-161-3/+28
| | | | | | | | | | | | 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
* Separate ATA code from generic disk code.Kevin O'Connor2009-08-111-0/+211
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.