-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforktest.asm
708 lines (633 loc) · 20.6 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
703
704
705
706
707
708
_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 18 sub $0x18,%esp
write(fd, s, strlen(s));
6: 8b 45 0c mov 0xc(%ebp),%eax
9: 89 04 24 mov %eax,(%esp)
c: e8 92 01 00 00 call 1a3 <strlen>
11: 89 44 24 08 mov %eax,0x8(%esp)
15: 8b 45 0c mov 0xc(%ebp),%eax
18: 89 44 24 04 mov %eax,0x4(%esp)
1c: 8b 45 08 mov 0x8(%ebp),%eax
1f: 89 04 24 mov %eax,(%esp)
22: e8 59 03 00 00 call 380 <write>
}
27: c9 leave
28: c3 ret
00000029 <forktest>:
void
forktest(void)
{
29: 55 push %ebp
2a: 89 e5 mov %esp,%ebp
2c: 83 ec 28 sub $0x28,%esp
int n, pid;
printf(1, "fork test\n");
2f: c7 44 24 04 18 04 00 movl $0x418,0x4(%esp)
36: 00
37: c7 04 24 01 00 00 00 movl $0x1,(%esp)
3e: e8 bd ff ff ff call 0 <printf>
for(n=0; n<N; n++){
43: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
4a: eb 1c jmp 68 <forktest+0x3f>
pid = fork();
4c: e8 07 03 00 00 call 358 <fork>
51: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid < 0)
54: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
58: 78 19 js 73 <forktest+0x4a>
break;
if(pid == 0)
5a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
5e: 75 05 jne 65 <forktest+0x3c>
exit();
60: e8 fb 02 00 00 call 360 <exit>
{
int n, pid;
printf(1, "fork test\n");
for(n=0; n<N; n++){
65: ff 45 f4 incl -0xc(%ebp)
68: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
6f: 7e db jle 4c <forktest+0x23>
71: eb 01 jmp 74 <forktest+0x4b>
pid = fork();
if(pid < 0)
break;
73: 90 nop
if(pid == 0)
exit();
}
if(n == N){
74: 81 7d f4 e8 03 00 00 cmpl $0x3e8,-0xc(%ebp)
7b: 75 46 jne c3 <forktest+0x9a>
printf(1, "fork claimed to work N times!\n", N);
7d: c7 44 24 08 e8 03 00 movl $0x3e8,0x8(%esp)
84: 00
85: c7 44 24 04 24 04 00 movl $0x424,0x4(%esp)
8c: 00
8d: c7 04 24 01 00 00 00 movl $0x1,(%esp)
94: e8 67 ff ff ff call 0 <printf>
exit();
99: e8 c2 02 00 00 call 360 <exit>
}
for(; n > 0; n--){
if(wait() < 0){
9e: e8 c5 02 00 00 call 368 <wait>
a3: 85 c0 test %eax,%eax
a5: 79 19 jns c0 <forktest+0x97>
printf(1, "wait stopped early\n");
a7: c7 44 24 04 43 04 00 movl $0x443,0x4(%esp)
ae: 00
af: c7 04 24 01 00 00 00 movl $0x1,(%esp)
b6: e8 45 ff ff ff call 0 <printf>
exit();
bb: e8 a0 02 00 00 call 360 <exit>
if(n == N){
printf(1, "fork claimed to work N times!\n", N);
exit();
}
for(; n > 0; n--){
c0: ff 4d f4 decl -0xc(%ebp)
c3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
c7: 7f d5 jg 9e <forktest+0x75>
printf(1, "wait stopped early\n");
exit();
}
}
if(wait() != -1){
c9: e8 9a 02 00 00 call 368 <wait>
ce: 83 f8 ff cmp $0xffffffff,%eax
d1: 74 19 je ec <forktest+0xc3>
printf(1, "wait got too many\n");
d3: c7 44 24 04 57 04 00 movl $0x457,0x4(%esp)
da: 00
db: c7 04 24 01 00 00 00 movl $0x1,(%esp)
e2: e8 19 ff ff ff call 0 <printf>
exit();
e7: e8 74 02 00 00 call 360 <exit>
}
printf(1, "fork test OK\n");
ec: c7 44 24 04 6a 04 00 movl $0x46a,0x4(%esp)
f3: 00
f4: c7 04 24 01 00 00 00 movl $0x1,(%esp)
fb: e8 00 ff ff ff call 0 <printf>
}
100: c9 leave
101: c3 ret
00000102 <main>:
int
main(void)
{
102: 55 push %ebp
103: 89 e5 mov %esp,%ebp
105: 83 e4 f0 and $0xfffffff0,%esp
forktest();
108: e8 1c ff ff ff call 29 <forktest>
exit();
10d: e8 4e 02 00 00 call 360 <exit>
112: 66 90 xchg %ax,%ax
00000114 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
114: 55 push %ebp
115: 89 e5 mov %esp,%ebp
117: 57 push %edi
118: 53 push %ebx
asm volatile("cld; rep stosb" :
119: 8b 4d 08 mov 0x8(%ebp),%ecx
11c: 8b 55 10 mov 0x10(%ebp),%edx
11f: 8b 45 0c mov 0xc(%ebp),%eax
122: 89 cb mov %ecx,%ebx
124: 89 df mov %ebx,%edi
126: 89 d1 mov %edx,%ecx
128: fc cld
129: f3 aa rep stos %al,%es:(%edi)
12b: 89 ca mov %ecx,%edx
12d: 89 fb mov %edi,%ebx
12f: 89 5d 08 mov %ebx,0x8(%ebp)
132: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
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 0c mov 0xc(%ebp),%eax
149: 8a 10 mov (%eax),%dl
14b: 8b 45 08 mov 0x8(%ebp),%eax
14e: 88 10 mov %dl,(%eax)
150: 8b 45 08 mov 0x8(%ebp),%eax
153: 8a 00 mov (%eax),%al
155: 84 c0 test %al,%al
157: 0f 95 c0 setne %al
15a: ff 45 08 incl 0x8(%ebp)
15d: ff 45 0c incl 0xc(%ebp)
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 06 jmp 174 <strcmp+0xb>
p++, q++;
16e: ff 45 08 incl 0x8(%ebp)
171: ff 45 0c incl 0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
174: 8b 45 08 mov 0x8(%ebp),%eax
177: 8a 00 mov (%eax),%al
179: 84 c0 test %al,%al
17b: 74 0e je 18b <strcmp+0x22>
17d: 8b 45 08 mov 0x8(%ebp),%eax
180: 8a 10 mov (%eax),%dl
182: 8b 45 0c mov 0xc(%ebp),%eax
185: 8a 00 mov (%eax),%al
187: 38 c2 cmp %al,%dl
189: 74 e3 je 16e <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
18b: 8b 45 08 mov 0x8(%ebp),%eax
18e: 8a 00 mov (%eax),%al
190: 0f b6 d0 movzbl %al,%edx
193: 8b 45 0c mov 0xc(%ebp),%eax
196: 8a 00 mov (%eax),%al
198: 0f b6 c0 movzbl %al,%eax
19b: 89 d1 mov %edx,%ecx
19d: 29 c1 sub %eax,%ecx
19f: 89 c8 mov %ecx,%eax
}
1a1: 5d pop %ebp
1a2: c3 ret
000001a3 <strlen>:
uint
strlen(char *s)
{
1a3: 55 push %ebp
1a4: 89 e5 mov %esp,%ebp
1a6: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1a9: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1b0: eb 03 jmp 1b5 <strlen+0x12>
1b2: ff 45 fc incl -0x4(%ebp)
1b5: 8b 55 fc mov -0x4(%ebp),%edx
1b8: 8b 45 08 mov 0x8(%ebp),%eax
1bb: 01 d0 add %edx,%eax
1bd: 8a 00 mov (%eax),%al
1bf: 84 c0 test %al,%al
1c1: 75 ef jne 1b2 <strlen+0xf>
;
return n;
1c3: 8b 45 fc mov -0x4(%ebp),%eax
}
1c6: c9 leave
1c7: c3 ret
000001c8 <memset>:
void*
memset(void *dst, int c, uint n)
{
1c8: 55 push %ebp
1c9: 89 e5 mov %esp,%ebp
1cb: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
1ce: 8b 45 10 mov 0x10(%ebp),%eax
1d1: 89 44 24 08 mov %eax,0x8(%esp)
1d5: 8b 45 0c mov 0xc(%ebp),%eax
1d8: 89 44 24 04 mov %eax,0x4(%esp)
1dc: 8b 45 08 mov 0x8(%ebp),%eax
1df: 89 04 24 mov %eax,(%esp)
1e2: e8 2d ff ff ff call 114 <stosb>
return dst;
1e7: 8b 45 08 mov 0x8(%ebp),%eax
}
1ea: c9 leave
1eb: c3 ret
000001ec <strchr>:
char*
strchr(const char *s, char c)
{
1ec: 55 push %ebp
1ed: 89 e5 mov %esp,%ebp
1ef: 83 ec 04 sub $0x4,%esp
1f2: 8b 45 0c mov 0xc(%ebp),%eax
1f5: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1f8: eb 12 jmp 20c <strchr+0x20>
if(*s == c)
1fa: 8b 45 08 mov 0x8(%ebp),%eax
1fd: 8a 00 mov (%eax),%al
1ff: 3a 45 fc cmp -0x4(%ebp),%al
202: 75 05 jne 209 <strchr+0x1d>
return (char*)s;
204: 8b 45 08 mov 0x8(%ebp),%eax
207: eb 11 jmp 21a <strchr+0x2e>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
209: ff 45 08 incl 0x8(%ebp)
20c: 8b 45 08 mov 0x8(%ebp),%eax
20f: 8a 00 mov (%eax),%al
211: 84 c0 test %al,%al
213: 75 e5 jne 1fa <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 28 sub $0x28,%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: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
232: 00
233: 8d 45 ef lea -0x11(%ebp),%eax
236: 89 44 24 04 mov %eax,0x4(%esp)
23a: c7 04 24 00 00 00 00 movl $0x0,(%esp)
241: e8 32 01 00 00 call 378 <read>
246: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
249: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
24d: 7e 29 jle 278 <gets+0x5c>
break;
buf[i++] = c;
24f: 8b 55 f4 mov -0xc(%ebp),%edx
252: 8b 45 08 mov 0x8(%ebp),%eax
255: 01 c2 add %eax,%edx
257: 8a 45 ef mov -0x11(%ebp),%al
25a: 88 02 mov %al,(%edx)
25c: ff 45 f4 incl -0xc(%ebp)
if(c == '\n' || c == '\r')
25f: 8a 45 ef mov -0x11(%ebp),%al
262: 3c 0a cmp $0xa,%al
264: 74 13 je 279 <gets+0x5d>
266: 8a 45 ef mov -0x11(%ebp),%al
269: 3c 0d cmp $0xd,%al
26b: 74 0c je 279 <gets+0x5d>
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: 40 inc %eax
271: 3b 45 0c cmp 0xc(%ebp),%eax
274: 7c b5 jl 22b <gets+0xf>
276: eb 01 jmp 279 <gets+0x5d>
cc = read(0, &c, 1);
if(cc < 1)
break;
278: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
279: 8b 55 f4 mov -0xc(%ebp),%edx
27c: 8b 45 08 mov 0x8(%ebp),%eax
27f: 01 d0 add %edx,%eax
281: c6 00 00 movb $0x0,(%eax)
return buf;
284: 8b 45 08 mov 0x8(%ebp),%eax
}
287: c9 leave
288: c3 ret
00000289 <stat>:
int
stat(char *n, struct stat *st)
{
289: 55 push %ebp
28a: 89 e5 mov %esp,%ebp
28c: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
28f: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
296: 00
297: 8b 45 08 mov 0x8(%ebp),%eax
29a: 89 04 24 mov %eax,(%esp)
29d: e8 fe 00 00 00 call 3a0 <open>
2a2: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
2a5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2a9: 79 07 jns 2b2 <stat+0x29>
return -1;
2ab: b8 ff ff ff ff mov $0xffffffff,%eax
2b0: eb 23 jmp 2d5 <stat+0x4c>
r = fstat(fd, st);
2b2: 8b 45 0c mov 0xc(%ebp),%eax
2b5: 89 44 24 04 mov %eax,0x4(%esp)
2b9: 8b 45 f4 mov -0xc(%ebp),%eax
2bc: 89 04 24 mov %eax,(%esp)
2bf: e8 f4 00 00 00 call 3b8 <fstat>
2c4: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2c7: 8b 45 f4 mov -0xc(%ebp),%eax
2ca: 89 04 24 mov %eax,(%esp)
2cd: e8 b6 00 00 00 call 388 <close>
return r;
2d2: 8b 45 f0 mov -0x10(%ebp),%eax
}
2d5: c9 leave
2d6: c3 ret
000002d7 <atoi>:
int
atoi(const char *s)
{
2d7: 55 push %ebp
2d8: 89 e5 mov %esp,%ebp
2da: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
2dd: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
2e4: eb 21 jmp 307 <atoi+0x30>
n = n*10 + *s++ - '0';
2e6: 8b 55 fc mov -0x4(%ebp),%edx
2e9: 89 d0 mov %edx,%eax
2eb: c1 e0 02 shl $0x2,%eax
2ee: 01 d0 add %edx,%eax
2f0: d1 e0 shl %eax
2f2: 89 c2 mov %eax,%edx
2f4: 8b 45 08 mov 0x8(%ebp),%eax
2f7: 8a 00 mov (%eax),%al
2f9: 0f be c0 movsbl %al,%eax
2fc: 01 d0 add %edx,%eax
2fe: 83 e8 30 sub $0x30,%eax
301: 89 45 fc mov %eax,-0x4(%ebp)
304: ff 45 08 incl 0x8(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
307: 8b 45 08 mov 0x8(%ebp),%eax
30a: 8a 00 mov (%eax),%al
30c: 3c 2f cmp $0x2f,%al
30e: 7e 09 jle 319 <atoi+0x42>
310: 8b 45 08 mov 0x8(%ebp),%eax
313: 8a 00 mov (%eax),%al
315: 3c 39 cmp $0x39,%al
317: 7e cd jle 2e6 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
319: 8b 45 fc mov -0x4(%ebp),%eax
}
31c: c9 leave
31d: c3 ret
0000031e <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
31e: 55 push %ebp
31f: 89 e5 mov %esp,%ebp
321: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
324: 8b 45 08 mov 0x8(%ebp),%eax
327: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
32a: 8b 45 0c mov 0xc(%ebp),%eax
32d: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
330: eb 10 jmp 342 <memmove+0x24>
*dst++ = *src++;
332: 8b 45 f8 mov -0x8(%ebp),%eax
335: 8a 10 mov (%eax),%dl
337: 8b 45 fc mov -0x4(%ebp),%eax
33a: 88 10 mov %dl,(%eax)
33c: ff 45 fc incl -0x4(%ebp)
33f: ff 45 f8 incl -0x8(%ebp)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
342: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
346: 0f 9f c0 setg %al
349: ff 4d 10 decl 0x10(%ebp)
34c: 84 c0 test %al,%al
34e: 75 e2 jne 332 <memmove+0x14>
*dst++ = *src++;
return vdst;
350: 8b 45 08 mov 0x8(%ebp),%eax
}
353: c9 leave
354: c3 ret
355: 66 90 xchg %ax,%ax
357: 90 nop
00000358 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
358: b8 01 00 00 00 mov $0x1,%eax
35d: cd 40 int $0x40
35f: c3 ret
00000360 <exit>:
SYSCALL(exit)
360: b8 02 00 00 00 mov $0x2,%eax
365: cd 40 int $0x40
367: c3 ret
00000368 <wait>:
SYSCALL(wait)
368: b8 03 00 00 00 mov $0x3,%eax
36d: cd 40 int $0x40
36f: c3 ret
00000370 <pipe>:
SYSCALL(pipe)
370: b8 04 00 00 00 mov $0x4,%eax
375: cd 40 int $0x40
377: c3 ret
00000378 <read>:
SYSCALL(read)
378: b8 05 00 00 00 mov $0x5,%eax
37d: cd 40 int $0x40
37f: c3 ret
00000380 <write>:
SYSCALL(write)
380: b8 10 00 00 00 mov $0x10,%eax
385: cd 40 int $0x40
387: c3 ret
00000388 <close>:
SYSCALL(close)
388: b8 15 00 00 00 mov $0x15,%eax
38d: cd 40 int $0x40
38f: c3 ret
00000390 <kill>:
SYSCALL(kill)
390: b8 06 00 00 00 mov $0x6,%eax
395: cd 40 int $0x40
397: c3 ret
00000398 <exec>:
SYSCALL(exec)
398: b8 07 00 00 00 mov $0x7,%eax
39d: cd 40 int $0x40
39f: c3 ret
000003a0 <open>:
SYSCALL(open)
3a0: b8 0f 00 00 00 mov $0xf,%eax
3a5: cd 40 int $0x40
3a7: c3 ret
000003a8 <mknod>:
SYSCALL(mknod)
3a8: b8 11 00 00 00 mov $0x11,%eax
3ad: cd 40 int $0x40
3af: c3 ret
000003b0 <unlink>:
SYSCALL(unlink)
3b0: b8 12 00 00 00 mov $0x12,%eax
3b5: cd 40 int $0x40
3b7: c3 ret
000003b8 <fstat>:
SYSCALL(fstat)
3b8: b8 08 00 00 00 mov $0x8,%eax
3bd: cd 40 int $0x40
3bf: c3 ret
000003c0 <link>:
SYSCALL(link)
3c0: b8 13 00 00 00 mov $0x13,%eax
3c5: cd 40 int $0x40
3c7: c3 ret
000003c8 <mkdir>:
SYSCALL(mkdir)
3c8: b8 14 00 00 00 mov $0x14,%eax
3cd: cd 40 int $0x40
3cf: c3 ret
000003d0 <chdir>:
SYSCALL(chdir)
3d0: b8 09 00 00 00 mov $0x9,%eax
3d5: cd 40 int $0x40
3d7: c3 ret
000003d8 <dup>:
SYSCALL(dup)
3d8: b8 0a 00 00 00 mov $0xa,%eax
3dd: cd 40 int $0x40
3df: c3 ret
000003e0 <getpid>:
SYSCALL(getpid)
3e0: b8 0b 00 00 00 mov $0xb,%eax
3e5: cd 40 int $0x40
3e7: c3 ret
000003e8 <sbrk>:
SYSCALL(sbrk)
3e8: b8 0c 00 00 00 mov $0xc,%eax
3ed: cd 40 int $0x40
3ef: c3 ret
000003f0 <sleep>:
SYSCALL(sleep)
3f0: b8 0d 00 00 00 mov $0xd,%eax
3f5: cd 40 int $0x40
3f7: c3 ret
000003f8 <uptime>:
SYSCALL(uptime)
3f8: b8 0e 00 00 00 mov $0xe,%eax
3fd: cd 40 int $0x40
3ff: c3 ret
00000400 <getppid>:
SYSCALL(getppid) // USER DEFINED SYS CALL
400: b8 16 00 00 00 mov $0x16,%eax
405: cd 40 int $0x40
407: c3 ret
00000408 <icount>:
SYSCALL(icount) // USER DEFINED SYS CALL
408: b8 17 00 00 00 mov $0x17,%eax
40d: cd 40 int $0x40
40f: c3 ret
00000410 <signal>:
SYSCALL(signal) // USER DEFINED SYS CALL
410: b8 18 00 00 00 mov $0x18,%eax
415: cd 40 int $0x40
417: c3 ret