disk.h 1014 B

123456789101112131415161718192021222324252627
  1. /* Disk layer: read sectors via direct FDC + ISA DMA in protected mode. */
  2. #ifndef DISK_H
  3. #define DISK_H
  4. /* Select the floppy drive (0 or 1) used by subsequent disk_read_sectors calls.
  5. * Keeps the controller initialised; the new drive is spun up and recalibrated
  6. * only when needed. */
  7. void disk_set_drive(unsigned int drive);
  8. /* Quick boot-scan presence/media probe: one read with a short timeout, no
  9. * recovery retries. Returns 1 if a readable disk is in the drive, 0
  10. * otherwise. Normal I/O after a successful probe still gets full retries. */
  11. int disk_probe(unsigned int drive);
  12. /* Return currently selected drive number. */
  13. unsigned int disk_get_drive(void);
  14. /* Read count sectors starting at lba into buf.
  15. * Returns 0 on success, -1 on error. */
  16. int disk_read_sectors(unsigned int lba, void *buf, unsigned int count);
  17. /* Write count sectors from buf starting at lba.
  18. * Returns 0 on success, -1 on error. */
  19. int disk_write_sectors(unsigned int lba, const void *buf, unsigned int count);
  20. #endif