Warning, cross-references for /kernel/include/fs/filesys.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _FILESYS_H_
0019 #define _FILESYS_H_
0020
0021 #include "types.h"
0022 #include "drivers/ata/ata.h"
0023
0024 #define PATHSEP '/'
0025
0026 int ext2fs_mount (void);
0027 int ext2fs_read (char *buf, int len);
0028 int ext2fs_dir (char *dirname);
0029
0030 struct _iso9660_dir_record
0031 {
0032 uint8 length;
0033 uint8 zero_1;
0034 uint32 first_sector;
0035 uint32 first_sector_BE;
0036 uint32 data_length;
0037 uint32 data_length_BE;
0038 uint8 years_since_1900;
0039 uint8 month;
0040 uint8 day;
0041 uint8 hour;
0042 uint8 minute;
0043 uint8 second;
0044 uint8 GMT_offset;
0045 uint8 flag_hidden:1;
0046 uint8 flag_dir:1;
0047 uint8 flag_assoc:1;
0048 uint8 flag_recfmtspec:1;
0049 uint8 flag_permspec:1;
0050 uint8 flag_unused:2;
0051 uint8 flag_notfinal:1;
0052 uint8 zero_2;
0053 uint8 zero_3;
0054 uint16 volume_sequence;
0055 uint16 volume_sequence_BE;
0056 uint8 identifier_length;
0057 uint8 identifier[32];
0058 } PACKED;
0059 typedef struct _iso9660_dir_record iso9660_dir_record;
0060
0061 typedef struct
0062 {
0063 uint32 bus, drive, root_dir_sector, root_dir_data_length;
0064 } iso9660_mounted_info;
0065
0066 typedef struct
0067 {
0068 iso9660_mounted_info *mount;
0069 uint32 sector, offset, length;
0070 } iso9660_handle;
0071
0072 int iso9660_mount (uint32, uint32, iso9660_mounted_info *);
0073 int iso9660_read (iso9660_handle *, uint8 *, uint32);
0074 int iso9660_open (iso9660_mounted_info *, char *, iso9660_handle *);
0075
0076 int eziso_mount (uint32 bus, uint32 drive);
0077 int eziso_dir (char *pathname);
0078 int eziso_read (char *buf, int len);
0079
0080 int vfat_mount (void);
0081 int vfat_dir (char *pathname);
0082 int vfat_read (char *buf, int len);
0083
0084 bool eztftp_mount (char *ifname);
0085 int eztftp_dir (char *pathname);
0086 int eztftp_read (char *buf, int len);
0087
0088 #define VFS_FSYS_NONE 0
0089 #define VFS_FSYS_EZEXT2 1
0090 #define VFS_FSYS_EZISO 2
0091 #define VFS_FSYS_EZUSB 3
0092 #define VFS_FSYS_EZTFTP 4
0093
0094 void vfs_set_root (int type, ata_info * drive_info);
0095 int vfs_dir (char *);
0096 int vfs_read (char *, char *, int);
0097
0098 #define SECTOR_SIZE 0x200
0099
0100
0101 typedef enum
0102 {
0103 ERR_NONE = 0,
0104 ERR_BAD_FILENAME,
0105 ERR_BAD_FILETYPE,
0106 ERR_BAD_GZIP_DATA,
0107 ERR_BAD_GZIP_HEADER,
0108 ERR_BAD_PART_TABLE,
0109 ERR_BAD_VERSION,
0110 ERR_BELOW_1MB,
0111 ERR_BOOT_COMMAND,
0112 ERR_BOOT_FAILURE,
0113 ERR_BOOT_FEATURES,
0114 ERR_DEV_FORMAT,
0115 ERR_DEV_VALUES,
0116 ERR_EXEC_FORMAT,
0117 ERR_FILELENGTH,
0118 ERR_FILE_NOT_FOUND,
0119 ERR_FSYS_CORRUPT,
0120 ERR_FSYS_MOUNT,
0121 ERR_GEOM,
0122 ERR_NEED_LX_KERNEL,
0123 ERR_NEED_MB_KERNEL,
0124 ERR_NO_DISK,
0125 ERR_NO_PART,
0126 ERR_NUMBER_PARSING,
0127 ERR_OUTSIDE_PART,
0128 ERR_READ,
0129 ERR_SYMLINK_LOOP,
0130 ERR_UNRECOGNIZED,
0131 ERR_WONT_FIT,
0132 ERR_WRITE,
0133 ERR_BAD_ARGUMENT,
0134 ERR_UNALIGNED,
0135 ERR_PRIVILEGED,
0136 ERR_DEV_NEED_INIT,
0137 ERR_NO_DISK_SPACE,
0138 ERR_NUMBER_OVERFLOW,
0139
0140 MAX_ERR_NUM
0141 } grub_error_t;
0142
0143 #endif
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154