-
Notifications
You must be signed in to change notification settings - Fork 0
/
forktest.asm
702 lines (630 loc) · 20.8 KB
/
forktest.asm
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
_forktest: file format elf32-i386
Disassembly of section .text:
00000000 <printf>:
#define N 1000
void
printf(int fd, char *s, ...)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 08 sub $0x8,%esp
write(fd, s, strlen(s));
6: 83 ec 0c sub $0xc,%esp
9: ff 75 0c pushl 0xc(%ebp)
c: e8 97 01 00 00 call 1a8 <strlen>
11: 83 c4 10 add $0x10,%esp
14: 83 ec 04 sub $0x4,%esp
17: 50 push %eax
18: ff 75 0c pushl 0xc(%ebp)
1b: ff 75 08 pushl 0x8(%ebp)
1e: e8 67 03 00 00 call 38a <write>
23: 83 c4 10 add $0x10,%esp
}
26: 90 nop
27: c9 leave
28: c3 ret
00000029 <forktest>:
void
forktest(void)
{
29: 55 push %ebp
2a: 89 e5 mov %esp,%ebp
2c: 83 ec 18 sub $0x18,%esp
int n, pid;
printf(1, "fork test\n");
2f: 83 ec 08 sub $0x8,%esp
32: 68 0c 04 00 00 push $0x40c
37: 6a 01 push $0x1
39: e8 c2 ff ff ff call 0 <printf>
3e: 83 c4 10 add $0x10,%esp
for(n=0; n<N; n++){
41: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
48: eb 1d jmp 67 <forktest+0x3e>
pid = fork();
4a: e8 13 03 00 00 call 362 <fork>
4f: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid < 0)
52: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
56: 78 1a js 72 <forktest+0x49>
break;
if(pid == 0)
58: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
5c: 75 05 jne 63 <forktest+0x3a>
exit();
5e: e8 07 03 00 00 call 36a <exit>
{
int n, pid;
printf(1, "fork test\n");
for(n=0; n<N; n++){
63: 83 45 f4 01 addl $0x1,-0xc(%ebp)
67: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
6e: 7e da jle 4a <forktest+0x21>
70: eb 01 jmp 73 <forktest+0x4a>
pid = fork();
if(pid < 0)
break;
72: 90 nop
if(pid == 0)
exit();
}
if(n == N){
73: 81 7d f4 e8 03 00 00 cmpl $0x3e8,-0xc(%ebp)
7a: 75 40 jne bc <forktest+0x93>
printf(1, "fork claimed to work N times!\n", N);
7c: 83 ec 04 sub $0x4,%esp
7f: 68 e8 03 00 00 push $0x3e8
84: 68 18 04 00 00 push $0x418
89: 6a 01 push $0x1
8b: e8 70 ff ff ff call 0 <printf>
90: 83 c4 10 add $0x10,%esp
exit();
93: e8 d2 02 00 00 call 36a <exit>
}
for(; n > 0; n--){
if(wait() < 0){
98: e8 d5 02 00 00 call 372 <wait>
9d: 85 c0 test %eax,%eax
9f: 79 17 jns b8 <forktest+0x8f>
printf(1, "wait stopped early\n");
a1: 83 ec 08 sub $0x8,%esp
a4: 68 37 04 00 00 push $0x437
a9: 6a 01 push $0x1
ab: e8 50 ff ff ff call 0 <printf>
b0: 83 c4 10 add $0x10,%esp
exit();
b3: e8 b2 02 00 00 call 36a <exit>
if(n == N){
printf(1, "fork claimed to work N times!\n", N);
exit();
}
for(; n > 0; n--){
b8: 83 6d f4 01 subl $0x1,-0xc(%ebp)
bc: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
c0: 7f d6 jg 98 <forktest+0x6f>
printf(1, "wait stopped early\n");
exit();
}
}
if(wait() != -1){
c2: e8 ab 02 00 00 call 372 <wait>
c7: 83 f8 ff cmp $0xffffffff,%eax
ca: 74 17 je e3 <forktest+0xba>
printf(1, "wait got too many\n");
cc: 83 ec 08 sub $0x8,%esp
cf: 68 4b 04 00 00 push $0x44b
d4: 6a 01 push $0x1
d6: e8 25 ff ff ff call 0 <printf>
db: 83 c4 10 add $0x10,%esp
exit();
de: e8 87 02 00 00 call 36a <exit>
}
printf(1, "fork test OK\n");
e3: 83 ec 08 sub $0x8,%esp
e6: 68 5e 04 00 00 push $0x45e
eb: 6a 01 push $0x1
ed: e8 0e ff ff ff call 0 <printf>
f2: 83 c4 10 add $0x10,%esp
}
f5: 90 nop
f6: c9 leave
f7: c3 ret
000000f8 <main>:
int
main(void)
{
f8: 8d 4c 24 04 lea 0x4(%esp),%ecx
fc: 83 e4 f0 and $0xfffffff0,%esp
ff: ff 71 fc pushl -0x4(%ecx)
102: 55 push %ebp
103: 89 e5 mov %esp,%ebp
105: 51 push %ecx
106: 83 ec 04 sub $0x4,%esp
forktest();
109: e8 1b ff ff ff call 29 <forktest>
exit();
10e: e8 57 02 00 00 call 36a <exit>
00000113 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
113: 55 push %ebp
114: 89 e5 mov %esp,%ebp
116: 57 push %edi
117: 53 push %ebx
asm volatile("cld; rep stosb" :
118: 8b 4d 08 mov 0x8(%ebp),%ecx
11b: 8b 55 10 mov 0x10(%ebp),%edx
11e: 8b 45 0c mov 0xc(%ebp),%eax
121: 89 cb mov %ecx,%ebx
123: 89 df mov %ebx,%edi
125: 89 d1 mov %edx,%ecx
127: fc cld
128: f3 aa rep stos %al,%es:(%edi)
12a: 89 ca mov %ecx,%edx
12c: 89 fb mov %edi,%ebx
12e: 89 5d 08 mov %ebx,0x8(%ebp)
131: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
134: 90 nop
135: 5b pop %ebx
136: 5f pop %edi
137: 5d pop %ebp
138: c3 ret
00000139 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
139: 55 push %ebp
13a: 89 e5 mov %esp,%ebp
13c: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
13f: 8b 45 08 mov 0x8(%ebp),%eax
142: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
145: 90 nop
146: 8b 45 08 mov 0x8(%ebp),%eax
149: 8d 50 01 lea 0x1(%eax),%edx
14c: 89 55 08 mov %edx,0x8(%ebp)
14f: 8b 55 0c mov 0xc(%ebp),%edx
152: 8d 4a 01 lea 0x1(%edx),%ecx
155: 89 4d 0c mov %ecx,0xc(%ebp)
158: 0f b6 12 movzbl (%edx),%edx
15b: 88 10 mov %dl,(%eax)
15d: 0f b6 00 movzbl (%eax),%eax
160: 84 c0 test %al,%al
162: 75 e2 jne 146 <strcpy+0xd>
;
return os;
164: 8b 45 fc mov -0x4(%ebp),%eax
}
167: c9 leave
168: c3 ret
00000169 <strcmp>:
int
strcmp(const char *p, const char *q)
{
169: 55 push %ebp
16a: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
16c: eb 08 jmp 176 <strcmp+0xd>
p++, q++;
16e: 83 45 08 01 addl $0x1,0x8(%ebp)
172: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
176: 8b 45 08 mov 0x8(%ebp),%eax
179: 0f b6 00 movzbl (%eax),%eax
17c: 84 c0 test %al,%al
17e: 74 10 je 190 <strcmp+0x27>
180: 8b 45 08 mov 0x8(%ebp),%eax
183: 0f b6 10 movzbl (%eax),%edx
186: 8b 45 0c mov 0xc(%ebp),%eax
189: 0f b6 00 movzbl (%eax),%eax
18c: 38 c2 cmp %al,%dl
18e: 74 de je 16e <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
190: 8b 45 08 mov 0x8(%ebp),%eax
193: 0f b6 00 movzbl (%eax),%eax
196: 0f b6 d0 movzbl %al,%edx
199: 8b 45 0c mov 0xc(%ebp),%eax
19c: 0f b6 00 movzbl (%eax),%eax
19f: 0f b6 c0 movzbl %al,%eax
1a2: 29 c2 sub %eax,%edx
1a4: 89 d0 mov %edx,%eax
}
1a6: 5d pop %ebp
1a7: c3 ret
000001a8 <strlen>:
uint
strlen(char *s)
{
1a8: 55 push %ebp
1a9: 89 e5 mov %esp,%ebp
1ab: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1ae: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1b5: eb 04 jmp 1bb <strlen+0x13>
1b7: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1bb: 8b 55 fc mov -0x4(%ebp),%edx
1be: 8b 45 08 mov 0x8(%ebp),%eax
1c1: 01 d0 add %edx,%eax
1c3: 0f b6 00 movzbl (%eax),%eax
1c6: 84 c0 test %al,%al
1c8: 75 ed jne 1b7 <strlen+0xf>
;
return n;
1ca: 8b 45 fc mov -0x4(%ebp),%eax
}
1cd: c9 leave
1ce: c3 ret
000001cf <memset>:
void*
memset(void *dst, int c, uint n)
{
1cf: 55 push %ebp
1d0: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
1d2: 8b 45 10 mov 0x10(%ebp),%eax
1d5: 50 push %eax
1d6: ff 75 0c pushl 0xc(%ebp)
1d9: ff 75 08 pushl 0x8(%ebp)
1dc: e8 32 ff ff ff call 113 <stosb>
1e1: 83 c4 0c add $0xc,%esp
return dst;
1e4: 8b 45 08 mov 0x8(%ebp),%eax
}
1e7: c9 leave
1e8: c3 ret
000001e9 <strchr>:
char*
strchr(const char *s, char c)
{
1e9: 55 push %ebp
1ea: 89 e5 mov %esp,%ebp
1ec: 83 ec 04 sub $0x4,%esp
1ef: 8b 45 0c mov 0xc(%ebp),%eax
1f2: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1f5: eb 14 jmp 20b <strchr+0x22>
if(*s == c)
1f7: 8b 45 08 mov 0x8(%ebp),%eax
1fa: 0f b6 00 movzbl (%eax),%eax
1fd: 3a 45 fc cmp -0x4(%ebp),%al
200: 75 05 jne 207 <strchr+0x1e>
return (char*)s;
202: 8b 45 08 mov 0x8(%ebp),%eax
205: eb 13 jmp 21a <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
207: 83 45 08 01 addl $0x1,0x8(%ebp)
20b: 8b 45 08 mov 0x8(%ebp),%eax
20e: 0f b6 00 movzbl (%eax),%eax
211: 84 c0 test %al,%al
213: 75 e2 jne 1f7 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
215: b8 00 00 00 00 mov $0x0,%eax
}
21a: c9 leave
21b: c3 ret
0000021c <gets>:
char*
gets(char *buf, int max)
{
21c: 55 push %ebp
21d: 89 e5 mov %esp,%ebp
21f: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
222: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
229: eb 42 jmp 26d <gets+0x51>
cc = read(0, &c, 1);
22b: 83 ec 04 sub $0x4,%esp
22e: 6a 01 push $0x1
230: 8d 45 ef lea -0x11(%ebp),%eax
233: 50 push %eax
234: 6a 00 push $0x0
236: e8 47 01 00 00 call 382 <read>
23b: 83 c4 10 add $0x10,%esp
23e: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
241: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
245: 7e 33 jle 27a <gets+0x5e>
break;
buf[i++] = c;
247: 8b 45 f4 mov -0xc(%ebp),%eax
24a: 8d 50 01 lea 0x1(%eax),%edx
24d: 89 55 f4 mov %edx,-0xc(%ebp)
250: 89 c2 mov %eax,%edx
252: 8b 45 08 mov 0x8(%ebp),%eax
255: 01 c2 add %eax,%edx
257: 0f b6 45 ef movzbl -0x11(%ebp),%eax
25b: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
25d: 0f b6 45 ef movzbl -0x11(%ebp),%eax
261: 3c 0a cmp $0xa,%al
263: 74 16 je 27b <gets+0x5f>
265: 0f b6 45 ef movzbl -0x11(%ebp),%eax
269: 3c 0d cmp $0xd,%al
26b: 74 0e je 27b <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
26d: 8b 45 f4 mov -0xc(%ebp),%eax
270: 83 c0 01 add $0x1,%eax
273: 3b 45 0c cmp 0xc(%ebp),%eax
276: 7c b3 jl 22b <gets+0xf>
278: eb 01 jmp 27b <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
27a: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
27b: 8b 55 f4 mov -0xc(%ebp),%edx
27e: 8b 45 08 mov 0x8(%ebp),%eax
281: 01 d0 add %edx,%eax
283: c6 00 00 movb $0x0,(%eax)
return buf;
286: 8b 45 08 mov 0x8(%ebp),%eax
}
289: c9 leave
28a: c3 ret
0000028b <stat>:
int
stat(char *n, struct stat *st)
{
28b: 55 push %ebp
28c: 89 e5 mov %esp,%ebp
28e: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
291: 83 ec 08 sub $0x8,%esp
294: 6a 00 push $0x0
296: ff 75 08 pushl 0x8(%ebp)
299: e8 0c 01 00 00 call 3aa <open>
29e: 83 c4 10 add $0x10,%esp
2a1: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
2a4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2a8: 79 07 jns 2b1 <stat+0x26>
return -1;
2aa: b8 ff ff ff ff mov $0xffffffff,%eax
2af: eb 25 jmp 2d6 <stat+0x4b>
r = fstat(fd, st);
2b1: 83 ec 08 sub $0x8,%esp
2b4: ff 75 0c pushl 0xc(%ebp)
2b7: ff 75 f4 pushl -0xc(%ebp)
2ba: e8 03 01 00 00 call 3c2 <fstat>
2bf: 83 c4 10 add $0x10,%esp
2c2: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2c5: 83 ec 0c sub $0xc,%esp
2c8: ff 75 f4 pushl -0xc(%ebp)
2cb: e8 c2 00 00 00 call 392 <close>
2d0: 83 c4 10 add $0x10,%esp
return r;
2d3: 8b 45 f0 mov -0x10(%ebp),%eax
}
2d6: c9 leave
2d7: c3 ret
000002d8 <atoi>:
int
atoi(const char *s)
{
2d8: 55 push %ebp
2d9: 89 e5 mov %esp,%ebp
2db: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
2de: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
2e5: eb 25 jmp 30c <atoi+0x34>
n = n*10 + *s++ - '0';
2e7: 8b 55 fc mov -0x4(%ebp),%edx
2ea: 89 d0 mov %edx,%eax
2ec: c1 e0 02 shl $0x2,%eax
2ef: 01 d0 add %edx,%eax
2f1: 01 c0 add %eax,%eax
2f3: 89 c1 mov %eax,%ecx
2f5: 8b 45 08 mov 0x8(%ebp),%eax
2f8: 8d 50 01 lea 0x1(%eax),%edx
2fb: 89 55 08 mov %edx,0x8(%ebp)
2fe: 0f b6 00 movzbl (%eax),%eax
301: 0f be c0 movsbl %al,%eax
304: 01 c8 add %ecx,%eax
306: 83 e8 30 sub $0x30,%eax
309: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
30c: 8b 45 08 mov 0x8(%ebp),%eax
30f: 0f b6 00 movzbl (%eax),%eax
312: 3c 2f cmp $0x2f,%al
314: 7e 0a jle 320 <atoi+0x48>
316: 8b 45 08 mov 0x8(%ebp),%eax
319: 0f b6 00 movzbl (%eax),%eax
31c: 3c 39 cmp $0x39,%al
31e: 7e c7 jle 2e7 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
320: 8b 45 fc mov -0x4(%ebp),%eax
}
323: c9 leave
324: c3 ret
00000325 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
325: 55 push %ebp
326: 89 e5 mov %esp,%ebp
328: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
32b: 8b 45 08 mov 0x8(%ebp),%eax
32e: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
331: 8b 45 0c mov 0xc(%ebp),%eax
334: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
337: eb 17 jmp 350 <memmove+0x2b>
*dst++ = *src++;
339: 8b 45 fc mov -0x4(%ebp),%eax
33c: 8d 50 01 lea 0x1(%eax),%edx
33f: 89 55 fc mov %edx,-0x4(%ebp)
342: 8b 55 f8 mov -0x8(%ebp),%edx
345: 8d 4a 01 lea 0x1(%edx),%ecx
348: 89 4d f8 mov %ecx,-0x8(%ebp)
34b: 0f b6 12 movzbl (%edx),%edx
34e: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
350: 8b 45 10 mov 0x10(%ebp),%eax
353: 8d 50 ff lea -0x1(%eax),%edx
356: 89 55 10 mov %edx,0x10(%ebp)
359: 85 c0 test %eax,%eax
35b: 7f dc jg 339 <memmove+0x14>
*dst++ = *src++;
return vdst;
35d: 8b 45 08 mov 0x8(%ebp),%eax
}
360: c9 leave
361: c3 ret
00000362 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
362: b8 01 00 00 00 mov $0x1,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <exit>:
SYSCALL(exit)
36a: b8 02 00 00 00 mov $0x2,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <wait>:
SYSCALL(wait)
372: b8 03 00 00 00 mov $0x3,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <pipe>:
SYSCALL(pipe)
37a: b8 04 00 00 00 mov $0x4,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <read>:
SYSCALL(read)
382: b8 05 00 00 00 mov $0x5,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <write>:
SYSCALL(write)
38a: b8 10 00 00 00 mov $0x10,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <close>:
SYSCALL(close)
392: b8 15 00 00 00 mov $0x15,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <kill>:
SYSCALL(kill)
39a: b8 06 00 00 00 mov $0x6,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <exec>:
SYSCALL(exec)
3a2: b8 07 00 00 00 mov $0x7,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <open>:
SYSCALL(open)
3aa: b8 0f 00 00 00 mov $0xf,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <mknod>:
SYSCALL(mknod)
3b2: b8 11 00 00 00 mov $0x11,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <unlink>:
SYSCALL(unlink)
3ba: b8 12 00 00 00 mov $0x12,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <fstat>:
SYSCALL(fstat)
3c2: b8 08 00 00 00 mov $0x8,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <link>:
SYSCALL(link)
3ca: b8 13 00 00 00 mov $0x13,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <mkdir>:
SYSCALL(mkdir)
3d2: b8 14 00 00 00 mov $0x14,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <chdir>:
SYSCALL(chdir)
3da: b8 09 00 00 00 mov $0x9,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <dup>:
SYSCALL(dup)
3e2: b8 0a 00 00 00 mov $0xa,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <getpid>:
SYSCALL(getpid)
3ea: b8 0b 00 00 00 mov $0xb,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <sbrk>:
SYSCALL(sbrk)
3f2: b8 0c 00 00 00 mov $0xc,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <sleep>:
SYSCALL(sleep)
3fa: b8 0d 00 00 00 mov $0xd,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <uptime>:
SYSCALL(uptime)
402: b8 0e 00 00 00 mov $0xe,%eax
407: cd 40 int $0x40
409: c3 ret