Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/fs/filesys.h need to be fixed.

0001 /*                    The Quest Operating System
0002  *  Copyright (C) 2005-2010  Richard West, Boston University
0003  *
0004  *  This program is free software: you can redistribute it and/or modify
0005  *  it under the terms of the GNU General Public License as published by
0006  *  the Free Software Foundation, either version 3 of the License, or
0007  *  (at your option) any later version.
0008  *
0009  *  This program is distributed in the hope that it will be useful,
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  *  GNU General Public License for more details.
0013  *
0014  *  You should have received a copy of the GNU General Public License
0015  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
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;       /* big endian */
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 /* Error codes (taken from grub) */
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  * Local Variables:
0147  * indent-tabs-mode: nil
0148  * mode: C
0149  * c-file-style: "gnu"
0150  * c-basic-offset: 2
0151  * End: 
0152  */
0153 
0154 /* vi: set et sw=2 sts=2: */