-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype.h
More file actions
53 lines (41 loc) · 1.08 KB
/
type.h
File metadata and controls
53 lines (41 loc) · 1.08 KB
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
43
44
45
46
47
48
49
50
51
52
53
/*************** type.h file for LEVEL-1 ****************/
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef struct ext2_super_block SUPER;
typedef struct ext2_group_desc GD;
typedef struct ext2_inode INODE;
typedef struct ext2_dir_entry_2 DIR;
SUPER *sp;
GD *gp;
INODE *ip;
DIR *dp;
#define FREE 0
#define READY 1
#define BLKSIZE 1024
#define NMINODE 128
#define NPROC 2
#define NFD 10
typedef struct minode{
INODE INODE; // INODE structure on disk
int dev, ino; // (dev, ino) of INODE
int refCount; // in use count
int dirty; // 0 for clean, 1 for modified
int mounted; // for level-3
struct mntable *mptr; // for level-3
}MINODE;
typedef struct oft{
int mode;
int refCount;
MINODE* minodePtr;
int offset;
}OFT;
typedef struct proc{
struct proc *next;
int pid; // process ID
int uid; // user ID
int ppid;
int gid;
MINODE *cwd; // CWD directory pointer
OFT *fd[NFD];
}PROC;