-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.txt
370 lines (353 loc) · 13.9 KB
/
output.txt
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
make[1]: Entering directory '/home/bugenzhao/OSProjects/OSProject1'
>> Building...
make -C ./ptree_syscall KID=~/Android/kernel/goldfish TOOLCHAIN=/home/bugenzhao/Android/android-ndk-linux/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin
make[2]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/ptree_syscall'
make -C ~/Android/kernel/goldfish ARCH=arm CROSS_COMPILE=/home/bugenzhao/Android/android-ndk-linux/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- M=/home/bugenzhao/OSProjects/OSProject1/ptree_syscall modules
make[3]: Entering directory '/home/bugenzhao/Android/kernel/goldfish'
CC [M] /home/bugenzhao/OSProjects/OSProject1/ptree_syscall/ptree.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/bugenzhao/OSProjects/OSProject1/ptree_syscall/ptree.mod.o
LD [M] /home/bugenzhao/OSProjects/OSProject1/ptree_syscall/ptree.ko
make[3]: Leaving directory '/home/bugenzhao/Android/kernel/goldfish'
make[2]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/ptree_syscall'
make -C ./ptree_test
make[2]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/ptree_test'
cd jni && ndk-build
make[3]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/ptree_test/jni'
[armeabi] Compile thumb : ptree_test <= ptree_test.c
[armeabi] Executable : ptree_test
[armeabi] Install : ptree_test => libs/armeabi/ptree_test
make[3]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/ptree_test/jni'
make[2]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/ptree_test'
make -C ./ptree_prtchld
make[2]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/ptree_prtchld'
cd jni && ndk-build
make[3]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/ptree_prtchld/jni'
[armeabi] Compile thumb : ptree_prtchld <= ptree_prtchld.c
[armeabi] Executable : ptree_prtchld
[armeabi] Install : ptree_prtchld => libs/armeabi/ptree_prtchld
make[3]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/ptree_prtchld/jni'
make[2]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/ptree_prtchld'
make -C ./BurgerBuddies
make[2]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/BurgerBuddies'
cd jni && ndk-build
make[3]: Entering directory '/home/bugenzhao/OSProjects/OSProject1/BurgerBuddies/jni'
[armeabi] Compile thumb : BBC <= BurgerBuddies.c
[armeabi] Compile thumb : BBC <= sbuf.c
[armeabi] Compile thumb : BBC <= sem.c
[armeabi] Executable : BBC
[armeabi] Install : BBC => libs/armeabi/BBC
make[3]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/BurgerBuddies/jni'
make[2]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1/BurgerBuddies'
>> Uploading...
adb shell rmmod /data/misc/ptree.ko > /dev/null
adb shell rm -f /data/misc/ptree.ko
adb push ./ptree_syscall/ptree.ko /data/misc
adb push ./ptree_test/libs/armeabi/ptree_test /data/misc
adb push ./ptree_prtchld/libs/armeabi/ptree_prtchld /data/misc
adb push ./BurgerBuddies/libs/armeabi/BBC /data/misc
>> Running...
>> Problem 1
adb shell chmod +x /data/misc/ptree_test /data/misc/ptree_prtchld
adb shell insmod /data/misc/ptree.ko
adb shell lsmod
Module Size Used by
ptree 2111 0
>> Problem 2
adb shell /data/misc/ptree_test
swapper ,0,0,0,1,0,0
init ,1,1,0,45,2,0
ueventd ,45,1,1,0,62,0
logd ,62,1,1,0,63,1036
vold ,63,1,1,0,71,0
healthd ,71,1,1,0,72,0
lmkd ,72,1,1,0,73,0
servicemanager ,73,1,1,0,74,1000
surfaceflinger ,74,0,1,0,76,1000
qemud ,76,1,1,0,79,0
sh ,79,1,1,0,80,2000
adbd ,80,1,1,685,81,0
ptree_test ,685,0,80,0,1,0
netd ,81,1,1,0,82,0
debuggerd ,82,0,1,0,83,0
rild ,83,1,1,0,84,1001
drmserver ,84,1,1,0,85,1019
mediaserver ,85,136,82,0,86,1013
installd ,86,1,1,0,87,0
keystore ,87,1,1,0,88,1017
main ,88,1,1,308,89,0
system_server ,308,1,88,0,532,1000
ndroid.systemui ,532,1,88,0,562,10013
externalstorage ,562,0,88,0,1,10006
gatekeeperd ,89,1,1,0,90,1000
perfprofd ,90,1,1,0,91,0
fingerprintd ,91,1,1,0,1,1000
kthreadd ,2,1,0,3,0,0
ksoftirqd/0 ,3,1,2,0,4,0
kworker/0:0 ,4,1,2,0,5,0
kworker/u:0 ,5,1,2,0,6,0
khelper ,6,1,2,0,7,0
sync_supers ,7,1,2,0,8,0
bdi-default ,8,1,2,0,9,0
kblockd ,9,1,2,0,10,0
rpciod ,10,1,2,0,11,0
kworker/0:1 ,11,1,2,0,12,0
kswapd0 ,12,1,2,0,13,0
fsnotify_mark ,13,1,2,0,14,0
crypto ,14,1,2,0,25,0
kworker/u:1 ,25,1,2,0,30,0
mtdblock0 ,30,1,2,0,35,0
mtdblock1 ,35,1,2,0,40,0
mtdblock2 ,40,1,2,0,41,0
binder ,41,1,2,0,42,0
deferwq ,42,1,2,0,43,0
kworker/u:2 ,43,1,2,0,44,0
mmcqd/0 ,44,1,2,0,47,0
jbd2/mtdblock0- ,47,1,2,0,48,0
ext4-dio-unwrit ,48,1,2,0,49,0
kworker/0:2 ,49,1,2,0,52,0
flush-31:1 ,52,1,2,0,54,0
jbd2/mtdblock1- ,54,1,2,0,55,0
ext4-dio-unwrit ,55,1,2,0,58,0
flush-31:2 ,58,1,2,0,60,0
jbd2/mtdblock2- ,60,1,2,0,61,0
ext4-dio-unwrit ,61,1,2,0,69,0
kauditd ,69,1,2,0,0,0
>> Problem 3
adb shell "cd /data/misc && ./ptree_prtchld"
518030910211 Parent is 689
518030910211 Child is 690
swapper ,0,0,0,1,0,0
init ,1,1,0,45,2,0
ueventd ,45,1,1,0,62,0
logd ,62,1,1,0,63,1036
vold ,63,1,1,0,71,0
healthd ,71,1,1,0,72,0
lmkd ,72,1,1,0,73,0
servicemanager ,73,1,1,0,74,1000
surfaceflinger ,74,0,1,0,76,1000
qemud ,76,1,1,0,79,0
sh ,79,1,1,0,80,2000
adbd ,80,1,1,687,81,0
sh ,687,1,80,689,1,0
ptree_prtchld ,689,1,687,690,1,0
ptree_test ,690,0,689,0,1,0
netd ,81,1,1,0,82,0
debuggerd ,82,1,1,0,83,0
rild ,83,1,1,0,84,1001
drmserver ,84,1,1,0,85,1019
mediaserver ,85,1,1,0,86,1013
installd ,86,1,1,0,87,0
keystore ,87,1,1,0,88,1017
main ,88,1,1,308,89,0
system_server ,308,1,88,0,532,1000
ndroid.systemui ,532,0,88,0,562,10013
externalstorage ,562,0,88,0,1,10006
gatekeeperd ,89,1,1,0,90,1000
perfprofd ,90,1,1,0,91,0
fingerprintd ,91,1,1,0,1,1000
kthreadd ,2,1,0,3,0,0
ksoftirqd/0 ,3,1,2,0,4,0
kworker/0:0 ,4,1,2,0,5,0
kworker/u:0 ,5,1,2,0,6,0
khelper ,6,1,2,0,7,0
sync_supers ,7,1,2,0,8,0
bdi-default ,8,1,2,0,9,0
kblockd ,9,1,2,0,10,0
rpciod ,10,1,2,0,11,0
kworker/0:1 ,11,1,2,0,12,0
kswapd0 ,12,1,2,0,13,0
fsnotify_mark ,13,1,2,0,14,0
crypto ,14,1,2,0,25,0
kworker/u:1 ,25,1,2,0,30,0
mtdblock0 ,30,1,2,0,35,0
mtdblock1 ,35,1,2,0,40,0
mtdblock2 ,40,1,2,0,41,0
binder ,41,1,2,0,42,0
deferwq ,42,1,2,0,43,0
kworker/u:2 ,43,1,2,0,44,0
mmcqd/0 ,44,1,2,0,47,0
jbd2/mtdblock0- ,47,1,2,0,48,0
ext4-dio-unwrit ,48,1,2,0,49,0
kworker/0:2 ,49,1,2,0,52,0
flush-31:1 ,52,1,2,0,54,0
jbd2/mtdblock1- ,54,1,2,0,55,0
ext4-dio-unwrit ,55,1,2,0,58,0
flush-31:2 ,58,1,2,0,60,0
jbd2/mtdblock2- ,60,1,2,0,61,0
ext4-dio-unwrit ,61,1,2,0,69,0
kauditd ,69,1,2,0,0,0
>> Problem 4
adb shell /data/misc/BBC 2 4 41 10
Welcome to Bugen's Burger Buddies!
Cooks [2], Cashiers [4], Customers [41]
Begin Run.
Cook [1] makes a burger.
Cook [2] makes a burger.
Cook [2] makes a burger.
Customer [28] comes.
Casher [4] accepts an order from Customer [28].
Casher [4] takes a burger form Cook [1] to Customer [28].
Cook [1] makes a burger.
Customer [1] comes.
Casher [4] accepts an order from Customer [1].
Casher [4] takes a burger form Cook [2] to Customer [1].
Cook [2] makes a burger.
Customer [6] comes.
Casher [4] accepts an order from Customer [6].
Casher [4] takes a burger form Cook [2] to Customer [6].
Cook [1] makes a burger.
Customer [31] comes.
Casher [4] accepts an order from Customer [31].
Casher [4] takes a burger form Cook [1] to Customer [31].
Cook [1] makes a burger.
Customer [23] comes.
Casher [4] accepts an order from Customer [23].
Casher [4] takes a burger form Cook [2] to Customer [23].
Cook [2] makes a burger.
Customer [30] comes.
Casher [4] accepts an order from Customer [30].
Casher [4] takes a burger form Cook [1] to Customer [30].
Customer [15] comes.
Casher [4] accepts an order from Customer [15].
Casher [4] takes a burger form Cook [1] to Customer [15].
Cook [2] makes a burger.
Customer [7] comes.
Casher [4] accepts an order from Customer [7].
Casher [4] takes a burger form Cook [2] to Customer [7].
Cook [1] makes a burger.
Customer [12] comes.
Casher [4] accepts an order from Customer [12].
Casher [4] takes a burger form Cook [2] to Customer [12].
Customer [33] comes.
Casher [4] accepts an order from Customer [33].
Casher [4] takes a burger form Cook [1] to Customer [33].
Customer [3] comes.
Casher [4] accepts an order from Customer [3].
Cook [1] makes a burger.
Casher [4] takes a burger form Cook [1] to Customer [3].
Customer [4] comes.
Casher [3] accepts an order from Customer [4].
Cook [2] makes a burger.
Casher [3] takes a burger form Cook [2] to Customer [4].
Customer [19] comes.
Casher [1] accepts an order from Customer [19].
Cook [1] makes a burger.
Casher [1] takes a burger form Cook [1] to Customer [19].
Cook [2] makes a burger.
Customer [14] comes.
Casher [2] accepts an order from Customer [14].
Casher [2] takes a burger form Cook [2] to Customer [14].
Cook [2] makes a burger.
Customer [21] comes.
Casher [2] accepts an order from Customer [21].
Casher [2] takes a burger form Cook [2] to Customer [21].
Cook [1] makes a burger.
Customer [41] comes.
Casher [2] accepts an order from Customer [41].
Casher [2] takes a burger form Cook [1] to Customer [41].
Cook [1] makes a burger.
Cook [2] makes a burger.
Customer [16] comes.
Casher [2] accepts an order from Customer [16].
Casher [2] takes a burger form Cook [1] to Customer [16].
Cook [1] makes a burger.
Customer [39] comes.
Casher [2] accepts an order from Customer [39].
Casher [2] takes a burger form Cook [2] to Customer [39].
Cook [1] makes a burger.
Cook [2] makes a burger.
Customer [29] comes.
Casher [2] accepts an order from Customer [29].
Casher [2] takes a burger form Cook [1] to Customer [29].
Customer [13] comes.
Casher [2] accepts an order from Customer [13].
Casher [2] takes a burger form Cook [1] to Customer [13].
Customer [8] comes.
Casher [2] accepts an order from Customer [8].
Casher [2] takes a burger form Cook [2] to Customer [8].
Customer [36] comes.
Casher [2] accepts an order from Customer [36].
Customer [17] comes.
Casher [4] accepts an order from Customer [17].
Customer [24] comes.
Casher [3] accepts an order from Customer [24].
Cook [2] makes a burger.
Casher [2] takes a burger form Cook [2] to Customer [36].
Cook [1] makes a burger.
Customer [40] comes.
Casher [4] takes a burger form Cook [1] to Customer [17].
Casher [4] accepts an order from Customer [40].
Cook [2] makes a burger.
Casher [4] takes a burger form Cook [2] to Customer [40].
Customer [34] comes.
Casher [1] accepts an order from Customer [34].
Customer [25] comes.
Casher [2] accepts an order from Customer [25].
Customer [5] comes.
Casher [4] accepts an order from Customer [5].
Cook [2] makes a burger.
Casher [3] takes a burger form Cook [2] to Customer [24].
Cook [1] makes a burger.
Casher [1] takes a burger form Cook [1] to Customer [34].
Customer [2] comes.
Casher [3] accepts an order from Customer [2].
Cook [1] makes a burger.
Casher [2] takes a burger form Cook [1] to Customer [25].
Cook [2] makes a burger.
Customer [38] comes.
Casher [4] takes a burger form Cook [2] to Customer [5].
Casher [4] accepts an order from Customer [38].
Customer [18] comes.
Customer [11] comes.
Casher [1] accepts an order from Customer [18].
Casher [2] accepts an order from Customer [11].
Customer [32] comes.
Cook [2] makes a burger.
Casher [4] takes a burger form Cook [2] to Customer [38].
Casher [4] accepts an order from Customer [32].
Cook [1] makes a burger.
Customer [35] comes.
Casher [4] takes a burger form Cook [1] to Customer [32].
Casher [4] accepts an order from Customer [35].
Customer [27] comes.
Customer [22] comes.
Cook [2] makes a burger.
Casher [4] takes a burger form Cook [2] to Customer [35].
Casher [4] accepts an order from Customer [27].
Customer [9] comes.
Customer [26] comes.
Customer [10] comes.
Cook [1] makes a burger.
Casher [4] takes a burger form Cook [1] to Customer [27].
Casher [4] accepts an order from Customer [22].
Customer [37] comes.
Customer [20] comes.
Cook [2] makes a burger.
Cook [1] makes a burger.
Casher [4] takes a burger form Cook [2] to Customer [22].
Casher [4] accepts an order from Customer [9].
Casher [4] takes a burger form Cook [1] to Customer [9].
Casher [4] accepts an order from Customer [26].
Cook [1] makes a burger.
Casher [4] takes a burger form Cook [1] to Customer [26].
Casher [4] accepts an order from Customer [10].
Cook [2] makes a burger.
Casher [4] takes a burger form Cook [2] to Customer [10].
Casher [4] accepts an order from Customer [37].
Cook [1] makes a burger.
Casher [4] takes a burger form Cook [1] to Customer [37].
Casher [4] accepts an order from Customer [20].
Casher [4] takes a burger form Cook [2] to Customer [20].
Cook [2] makes a burger.
Cook [1] makes a burger.
Casher [3] takes a burger form Cook [1] to Customer [2].
Cook [1] makes a burger.
Casher [1] takes a burger form Cook [1] to Customer [18].
Cook [2] makes a burger.
Casher [2] takes a burger form Cook [2] to Customer [11].
All customers are served! Done.
>> Cleaning...
adb shell rmmod /data/misc/ptree.ko
make[1]: Leaving directory '/home/bugenzhao/OSProjects/OSProject1'