disk.h 724 B

123456789101112131415161718192021
  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. * Resets FDC state so the next read re-initialises for the new drive. */
  6. void disk_set_drive(unsigned int drive);
  7. /* Return currently selected drive number. */
  8. unsigned int disk_get_drive(void);
  9. /* Read count sectors starting at lba into buf.
  10. * Returns 0 on success, -1 on error. */
  11. int disk_read_sectors(unsigned int lba, void *buf, unsigned int count);
  12. /* Write count sectors from buf starting at lba.
  13. * Returns 0 on success, -1 on error. */
  14. int disk_write_sectors(unsigned int lba, const void *buf, unsigned int count);
  15. #endif