1 #ifndef FS_H 2 #define FS_H 3 4 #include <stdint.h> 5 6 //typedef uint64_t sector_t; 7 8 #ifdef IDE_DISK 9 int ide_probe(int drive); 10 int ide_read(int drive, sector_t sector, void *buffer); 11 #endif 12 13 #ifdef USB_DISK 14 int usb_probe(int drive); 15 int usb_read(int drive, sector_t sector, void *buffer); 16 #endif 17 18 #define DISK_IDE 1 19 #define DISK_MEM 2 20 #define DISK_USB 3 21 22 int devopen(const char *name, int *reopen); 23 int devread(unsigned long sector, unsigned long byte_offset, 24 unsigned long byte_len, void *buf); 25 26 int file_open(const char *filename); 27 int file_read(void *buf, unsigned long len); 28 int file_seek(unsigned long offset); 29 unsigned long file_size(void); 30 31 #define PARTITION_UNKNOWN 0xbad6a7 32 33 #ifdef ELTORITO 34 int open_eltorito_image(int part, unsigned long *start, unsigned long *length); 35 #else 36 # define open_eltorito_image(x,y,z) PARTITION_UNKNOWN 37 #endif 38 39 extern int using_devsize; 40 41 #endif /* FS_H */ 42