-
Notifications
You must be signed in to change notification settings - Fork 0
/
minix.equ
189 lines (130 loc) · 2.68 KB
/
minix.equ
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
; minix V1 (L)
; uses 30-char filenames
BLOCK_SIZE equ 1024
BOOT_BLOCK equ 0
SUPER_BLOCK equ 1
v1 record 0
MAGIC equ $137F
DIRSIZE equ 14
NR_DZONES equ 7 ; 7 direct zones
NR_TZONES equ 9 ; 9 total zones
; too big...
;MAX_FILE_SIZE equ $10081c00
endr
v1_super record 0
__begin equ *
ninodes ds.w 1
nzones ds.w 1
imap_blocks ds.w 1
zmap_blocks ds.w 1
firstdatazone ds.w 1
log_zone_size ds.w 1
max_size ds.l 1
magic ds.w 1
__end equ *
__sizeof equ __end - __begin
endr
v1_inode record 0
__begin equ *
mode ds.w 1
uid ds.w 1
size ds.l 1
mtime ds.l 1
gid ds.b 1
nlinks ds.b 1
zone ds.w v1.NR_TZONES
__end equ *
__sizeof equ __end - __begin
endr
v1_dirent record 0
__begin equ *
inode ds.w 1
name ds.b v1.DIRSIZE
__end equ *
__sizeof equ __end - __begin
endr
; v1 (Linux)
v1L record 0
MAGIC equ $138F
DIRSIZE equ 30
endr
v1L_dirent record 0
__begin equ *
inode ds.w 1
name ds.b v1L.DIRSIZE
__end equ *
__sizeof equ __end - __begin
endr
; version 2
v2 record 0
NR_DZONES equ 7
NR_TZONES equ 10
MAGIC equ $2468
DIRSIZE equ 14
;MAX_FILE_SIZE equ $7fffffff
endr
v2_super record 0
__begin equ *
inodes ds.w 1
nzones ds.w 1
imap_blocks ds.w 1
zmap_blocks ds.w 1
firstdatazone ds.w 1
log_zone_size ds.w 1
max_size ds.l 1
magic ds.w 1
ds.w 1 ; padding
zones ds.l 1
__end equ *
__sizeof equ __end - __begin
endr
v2_inode record 0
__begin equ *
mode ds.w 1
nlinks ds.w 1
uid ds.w 1
gid ds.w 1
size ds.l 1
atime ds.l 1
mtime ds.l 1
ctime ds.l 1
zone ds.l v2.NR_TZONES
__end equ *
__sizeof equ __end - __begin
endr
v2_dirent record 0
__begin equ *
inode ds.w 1
name ds.b v2.DIRSIZE
__end equ *
__sizeof equ __end - __begin
endr
; v2 (Linux)
v2l record 0
MAGIC equ $2478
DIRSIZE equ 30
endr
; sys/stat equates
S_IFMT equ $f000 ; type of file
S_IFWHT equ $e000 ; union white out.
S_IFSOCK equ $c000 ; unix domain socket
S_IFLNK equ $a000 ; symbolic link, not implemented
S_IFREG equ $8000 ; regular
S_IFBLK equ $6000 ; block special
S_IFDIR equ $4000 ; directory
S_IFCHR equ $2000 ; character special
S_IFIFO equ $1000 ; this is a FIFO
S_ISUID equ $0800 ; set user id on execution
S_ISGID equ $0400 ; set group id on execution
S_IRWXU equ $01c0 ; owner: rwx------
S_IRUSR equ $0100 ; owner: r--------
S_IWUSR equ $0080 ; owner: -w-------
S_IXUSR equ $0040 ; owner: --x------
S_IRWXG equ $0038 ; group: ---rwx---
S_IRGRP equ $0020 ; group: ---r-----
S_IWGRP equ $0010 ; group: ----w----
S_IXGRP equ $0008 ; group: -----x---
S_IRWXO equ $0007 ; others: ------rwx
S_IROTH equ $0004 ; others: ------r--
S_IWOTH equ $0002 ; others: -------w-
S_IXOTH equ $0001 ; others: --------x