1 /* filesys.h - abstract filesystem interface */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define FSYS_FFS_NUM 1
26 int ffs_read (char *buf
, int len
);
27 int ffs_dir (char *dirname
);
28 int ffs_embed (unsigned long long *start_sector
, int needed_sectors
);
30 #define FSYS_FFS_NUM 0
34 #define FSYS_UFS_NUM 1
36 int ufs_read (char *buf
, int len
);
37 int ufs_dir (char *dirname
);
38 int ufs_embed (unsigned long long *start_sector
, int needed_sectors
);
40 #define FSYS_UFS_NUM 0
44 #define FSYS_UFS2_NUM 1
45 int ufs2_mount (void);
46 int ufs2_read (char *buf
, int len
);
47 int ufs2_dir (char *dirname
);
48 int ufs2_embed (unsigned long long *start_sector
, int needed_sectors
);
50 #define FSYS_UFS2_NUM 0
54 #define FSYS_ZFS_NUM 1
56 int zfs_read (char *buf
, int len
);
57 int zfs_open (char *dirname
);
58 int zfs_embed (unsigned long long *start_sector
, int needed_sectors
);
60 #define FSYS_ZFS_NUM 0
64 #define FSYS_FAT_NUM 1
66 int fat_read (char *buf
, int len
);
67 int fat_dir (char *dirname
);
69 #define FSYS_FAT_NUM 0
73 #define FSYS_EXT2FS_NUM 1
74 int ext2fs_mount (void);
75 int ext2fs_read (char *buf
, int len
);
76 int ext2fs_dir (char *dirname
);
78 #define FSYS_EXT2FS_NUM 0
82 #define FSYS_MINIX_NUM 1
83 int minix_mount (void);
84 int minix_read (char *buf
, int len
);
85 int minix_dir (char *dirname
);
87 #define FSYS_MINIX_NUM 0
91 #define FSYS_REISERFS_NUM 1
92 int reiserfs_mount (void);
93 int reiserfs_read (char *buf
, int len
);
94 int reiserfs_dir (char *dirname
);
95 int reiserfs_embed (unsigned long long *start_sector
, int needed_sectors
);
97 #define FSYS_REISERFS_NUM 0
101 #define FSYS_VSTAFS_NUM 1
102 int vstafs_mount (void);
103 int vstafs_read (char *buf
, int len
);
104 int vstafs_dir (char *dirname
);
106 #define FSYS_VSTAFS_NUM 0
110 #define FSYS_JFS_NUM 1
111 int jfs_mount (void);
112 int jfs_read (char *buf
, int len
);
113 int jfs_dir (char *dirname
);
114 int jfs_embed (unsigned long long *start_sector
, int needed_sectors
);
116 #define FSYS_JFS_NUM 0
120 #define FSYS_XFS_NUM 1
121 int xfs_mount (void);
122 int xfs_read (char *buf
, int len
);
123 int xfs_dir (char *dirname
);
125 #define FSYS_XFS_NUM 0
129 #define FSYS_TFTP_NUM 1
130 int tftp_mount (void);
131 int tftp_read (char *buf
, int len
);
132 int tftp_dir (char *dirname
);
133 void tftp_close (void);
135 #define FSYS_TFTP_NUM 0
139 #define FSYS_ISO9660_NUM 1
140 int iso9660_mount (void);
141 int iso9660_read (char *buf
, int len
);
142 int iso9660_dir (char *dirname
);
144 #define FSYS_ISO9660_NUM 0
149 (FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM \
150 + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM \
151 + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS_NUM + FSYS_UFS2_NUM \
155 /* defines for the block filesystem info area */
156 #ifndef NO_BLOCK_FILES
157 #define BLK_CUR_FILEPOS (*((int*)FSYS_BUF))
158 #define BLK_CUR_BLKLIST (*((int*)(FSYS_BUF+4)))
159 #define BLK_CUR_BLKNUM (*((int*)(FSYS_BUF+8)))
160 #define BLK_MAX_ADDR (FSYS_BUF+0x7FF9)
161 #define BLK_BLKSTART(l) (*((int*)l))
162 #define BLK_BLKLENGTH(l) (*((int*)(l+4)))
163 #define BLK_BLKLIST_START (FSYS_BUF+12)
164 #define BLK_BLKLIST_INC_VAL 8
165 #endif /* NO_BLOCK_FILES */
167 /* this next part is pretty ugly, but it keeps it in one place! */
172 int (*mount_func
) (void);
173 int (*read_func
) (char *buf
, int len
);
174 int (*dir_func
) (char *dirname
);
175 void (*close_func
) (void);
176 int (*embed_func
) (unsigned long long *start_sector
, int needed_sectors
);
180 # define print_possibilities 0
182 extern int print_possibilities
;
186 extern struct fsys_entry fsys_table
[NUM_FSYS
+ 1];