You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bios_disks.h 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef BIOS_DISKS_H
  2. #define BIOS_DISKS_H
  3. #include "dev.h"
  4. /*
  5. * Constants
  6. *
  7. */
  8. #define BIOS_DISK_MAX_NAME_LEN 6
  9. struct bios_disk_sector {
  10. char data[512];
  11. };
  12. /*
  13. * The location of a BIOS disk
  14. *
  15. */
  16. struct bios_disk_loc {
  17. uint8_t drive;
  18. };
  19. /*
  20. * A physical BIOS disk device
  21. *
  22. */
  23. struct bios_disk_device {
  24. char name[BIOS_DISK_MAX_NAME_LEN];
  25. uint8_t drive;
  26. uint8_t type;
  27. };
  28. /*
  29. * A BIOS disk driver, with a valid device ID range and naming
  30. * function.
  31. *
  32. */
  33. struct bios_disk_driver {
  34. void ( *fill_drive_name ) ( char *buf, uint8_t drive );
  35. uint8_t min_drive;
  36. uint8_t max_drive;
  37. };
  38. /*
  39. * Define a BIOS disk driver
  40. *
  41. */
  42. #define BIOS_DISK_DRIVER( _name, _fill_drive_name, _min_drive, _max_drive ) \
  43. static struct bios_disk_driver _name = { \
  44. .fill_drive_name = _fill_drive_name, \
  45. .min_drive = _min_drive, \
  46. .max_drive = _max_drive, \
  47. }
  48. /*
  49. * Functions in bios_disks.c
  50. *
  51. */
  52. /*
  53. * bios_disk bus global definition
  54. *
  55. */
  56. extern struct bus_driver bios_disk_driver;
  57. #endif /* BIOS_DISKS_H */