-
Notifications
You must be signed in to change notification settings - Fork 0
/
initrd.h
42 lines (35 loc) · 904 Bytes
/
initrd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "vfs.h"
#define INITRD_MAGIC (0xF154F00D ^ ~0)
#define SUPPORTED_VERSION (0x0003)
struct initrd_inode {
uint32_t mask; // The permissions mask.
uint32_t uid; // The owning user.
uint32_t gid; // The owning group.
uint32_t ino; // This is device-specific - provides a way for a filesystem to identify files.
uint32_t length; // Size of the file, in bytes.
uint32_t offset;
};
struct initrd_disk_dir {
uint32_t ino;
uint32_t num;
uint32_t subdirs[0];
};
struct initrd_subdir {
const char *name;
uint32_t ino;
};
struct initrd_online_dir {
uint32_t ino;
uint32_t num;
struct initrd_subdir *subdirs;
};
struct initrd_superblock {
struct superblock s;
struct vfs_dirent *file_list;
struct initrd_inode *inode_list;
unsigned inode_num;
struct initrd_online_dir *dir_list;
unsigned dir_num;
char *contents;
};
unsigned init_initrd(void);