-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.asm
14568 lines (13860 loc) · 545 KB
/
kernel.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
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
kernel: formato del fichero elf32-i386
Desensamblado de la sección .text:
80100000 <multiboot_header>:
80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh
80100006: 00 00 add %al,(%eax)
80100008: fe 4f 52 decb 0x52(%edi)
8010000b: e4 .byte 0xe4
8010000c <entry>:
# Entering xv6 on boot processor, with paging off.
.globl entry
entry:
# Turn on page size extension for 4Mbyte pages
movl %cr4, %eax
8010000c: 0f 20 e0 mov %cr4,%eax
orl $(CR4_PSE), %eax
8010000f: 83 c8 10 or $0x10,%eax
movl %eax, %cr4
80100012: 0f 22 e0 mov %eax,%cr4
# Set page directory
movl $(V2P_WO(entrypgdir)), %eax
80100015: b8 00 90 10 00 mov $0x109000,%eax
movl %eax, %cr3
8010001a: 0f 22 d8 mov %eax,%cr3
# Turn on paging.
movl %cr0, %eax
8010001d: 0f 20 c0 mov %cr0,%eax
orl $(CR0_PG|CR0_WP), %eax
80100020: 0d 00 00 01 80 or $0x80010000,%eax
movl %eax, %cr0
80100025: 0f 22 c0 mov %eax,%cr0
# Set up the stack pointer.
movl $(stack + KSTACKSIZE), %esp
80100028: bc c0 b5 10 80 mov $0x8010b5c0,%esp
# Jump to main(), and switch to executing at
# high addresses. The indirect call is needed because
# the assembler produces a PC-relative instruction
# for a direct jump.
mov $main, %eax
8010002d: b8 a9 2a 10 80 mov $0x80102aa9,%eax
jmp *%eax
80100032: ff e0 jmp *%eax
80100034 <bget>:
// Look through buffer cache for block on device dev.
// If not found, allocate a buffer.
// In either case, return locked buffer.
static struct buf*
bget(uint dev, uint blockno)
{
80100034: 55 push %ebp
80100035: 89 e5 mov %esp,%ebp
80100037: 57 push %edi
80100038: 56 push %esi
80100039: 53 push %ebx
8010003a: 83 ec 18 sub $0x18,%esp
8010003d: 89 c6 mov %eax,%esi
8010003f: 89 d7 mov %edx,%edi
struct buf *b;
acquire(&bcache.lock);
80100041: 68 c0 b5 10 80 push $0x8010b5c0
80100046: e8 c4 3d 00 00 call 80103e0f <acquire>
// Is the block already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
8010004b: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx
80100051: 83 c4 10 add $0x10,%esp
80100054: eb 03 jmp 80100059 <bget+0x25>
80100056: 8b 5b 54 mov 0x54(%ebx),%ebx
80100059: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
8010005f: 74 2e je 8010008f <bget+0x5b>
if(b->dev == dev && b->blockno == blockno){
80100061: 39 73 04 cmp %esi,0x4(%ebx)
80100064: 75 f0 jne 80100056 <bget+0x22>
80100066: 39 7b 08 cmp %edi,0x8(%ebx)
80100069: 75 eb jne 80100056 <bget+0x22>
b->refcnt++;
8010006b: 8b 43 4c mov 0x4c(%ebx),%eax
8010006e: 40 inc %eax
8010006f: 89 43 4c mov %eax,0x4c(%ebx)
release(&bcache.lock);
80100072: 83 ec 0c sub $0xc,%esp
80100075: 68 c0 b5 10 80 push $0x8010b5c0
8010007a: e8 f9 3d 00 00 call 80103e78 <release>
acquiresleep(&b->lock);
8010007f: 8d 43 0c lea 0xc(%ebx),%eax
80100082: 89 04 24 mov %eax,(%esp)
80100085: e8 56 3b 00 00 call 80103be0 <acquiresleep>
return b;
8010008a: 83 c4 10 add $0x10,%esp
8010008d: eb 4c jmp 801000db <bget+0xa7>
}
// Not cached; recycle an unused buffer.
// Even if refcnt==0, B_DIRTY indicates a buffer is in use
// because log.c has modified it but not yet committed it.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
8010008f: 8b 1d 0c fd 10 80 mov 0x8010fd0c,%ebx
80100095: eb 03 jmp 8010009a <bget+0x66>
80100097: 8b 5b 50 mov 0x50(%ebx),%ebx
8010009a: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
801000a0: 74 43 je 801000e5 <bget+0xb1>
if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) {
801000a2: 83 7b 4c 00 cmpl $0x0,0x4c(%ebx)
801000a6: 75 ef jne 80100097 <bget+0x63>
801000a8: f6 03 04 testb $0x4,(%ebx)
801000ab: 75 ea jne 80100097 <bget+0x63>
b->dev = dev;
801000ad: 89 73 04 mov %esi,0x4(%ebx)
b->blockno = blockno;
801000b0: 89 7b 08 mov %edi,0x8(%ebx)
b->flags = 0;
801000b3: c7 03 00 00 00 00 movl $0x0,(%ebx)
b->refcnt = 1;
801000b9: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
release(&bcache.lock);
801000c0: 83 ec 0c sub $0xc,%esp
801000c3: 68 c0 b5 10 80 push $0x8010b5c0
801000c8: e8 ab 3d 00 00 call 80103e78 <release>
acquiresleep(&b->lock);
801000cd: 8d 43 0c lea 0xc(%ebx),%eax
801000d0: 89 04 24 mov %eax,(%esp)
801000d3: e8 08 3b 00 00 call 80103be0 <acquiresleep>
return b;
801000d8: 83 c4 10 add $0x10,%esp
}
}
panic("bget: no buffers");
}
801000db: 89 d8 mov %ebx,%eax
801000dd: 8d 65 f4 lea -0xc(%ebp),%esp
801000e0: 5b pop %ebx
801000e1: 5e pop %esi
801000e2: 5f pop %edi
801000e3: 5d pop %ebp
801000e4: c3 ret
panic("bget: no buffers");
801000e5: 83 ec 0c sub $0xc,%esp
801000e8: 68 a0 6a 10 80 push $0x80106aa0
801000ed: e8 63 02 00 00 call 80100355 <panic>
801000f2 <binit>:
{
801000f2: f3 0f 1e fb endbr32
801000f6: 55 push %ebp
801000f7: 89 e5 mov %esp,%ebp
801000f9: 53 push %ebx
801000fa: 83 ec 0c sub $0xc,%esp
initlock(&bcache.lock, "bcache");
801000fd: 68 b1 6a 10 80 push $0x80106ab1
80100102: 68 c0 b5 10 80 push $0x8010b5c0
80100107: e8 b8 3b 00 00 call 80103cc4 <initlock>
bcache.head.prev = &bcache.head;
8010010c: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c
80100113: fc 10 80
bcache.head.next = &bcache.head;
80100116: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10
8010011d: fc 10 80
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100120: 83 c4 10 add $0x10,%esp
80100123: bb f4 b5 10 80 mov $0x8010b5f4,%ebx
80100128: eb 37 jmp 80100161 <binit+0x6f>
b->next = bcache.head.next;
8010012a: a1 10 fd 10 80 mov 0x8010fd10,%eax
8010012f: 89 43 54 mov %eax,0x54(%ebx)
b->prev = &bcache.head;
80100132: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx)
initsleeplock(&b->lock, "buffer");
80100139: 83 ec 08 sub $0x8,%esp
8010013c: 68 b8 6a 10 80 push $0x80106ab8
80100141: 8d 43 0c lea 0xc(%ebx),%eax
80100144: 50 push %eax
80100145: e8 5f 3a 00 00 call 80103ba9 <initsleeplock>
bcache.head.next->prev = b;
8010014a: a1 10 fd 10 80 mov 0x8010fd10,%eax
8010014f: 89 58 50 mov %ebx,0x50(%eax)
bcache.head.next = b;
80100152: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100158: 81 c3 5c 02 00 00 add $0x25c,%ebx
8010015e: 83 c4 10 add $0x10,%esp
80100161: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
80100167: 72 c1 jb 8010012a <binit+0x38>
}
80100169: 8b 5d fc mov -0x4(%ebp),%ebx
8010016c: c9 leave
8010016d: c3 ret
8010016e <bread>:
// Return a locked buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
8010016e: f3 0f 1e fb endbr32
80100172: 55 push %ebp
80100173: 89 e5 mov %esp,%ebp
80100175: 53 push %ebx
80100176: 83 ec 04 sub $0x4,%esp
struct buf *b;
b = bget(dev, blockno);
80100179: 8b 55 0c mov 0xc(%ebp),%edx
8010017c: 8b 45 08 mov 0x8(%ebp),%eax
8010017f: e8 b0 fe ff ff call 80100034 <bget>
80100184: 89 c3 mov %eax,%ebx
if((b->flags & B_VALID) == 0) {
80100186: f6 00 02 testb $0x2,(%eax)
80100189: 74 07 je 80100192 <bread+0x24>
iderw(b);
}
return b;
}
8010018b: 89 d8 mov %ebx,%eax
8010018d: 8b 5d fc mov -0x4(%ebp),%ebx
80100190: c9 leave
80100191: c3 ret
iderw(b);
80100192: 83 ec 0c sub $0xc,%esp
80100195: 50 push %eax
80100196: e8 aa 1c 00 00 call 80101e45 <iderw>
8010019b: 83 c4 10 add $0x10,%esp
return b;
8010019e: eb eb jmp 8010018b <bread+0x1d>
801001a0 <bwrite>:
// Write b's contents to disk. Must be locked.
void
bwrite(struct buf *b)
{
801001a0: f3 0f 1e fb endbr32
801001a4: 55 push %ebp
801001a5: 89 e5 mov %esp,%ebp
801001a7: 53 push %ebx
801001a8: 83 ec 10 sub $0x10,%esp
801001ab: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holdingsleep(&b->lock))
801001ae: 8d 43 0c lea 0xc(%ebx),%eax
801001b1: 50 push %eax
801001b2: e8 bb 3a 00 00 call 80103c72 <holdingsleep>
801001b7: 83 c4 10 add $0x10,%esp
801001ba: 85 c0 test %eax,%eax
801001bc: 74 14 je 801001d2 <bwrite+0x32>
panic("bwrite");
b->flags |= B_DIRTY;
801001be: 83 0b 04 orl $0x4,(%ebx)
iderw(b);
801001c1: 83 ec 0c sub $0xc,%esp
801001c4: 53 push %ebx
801001c5: e8 7b 1c 00 00 call 80101e45 <iderw>
}
801001ca: 83 c4 10 add $0x10,%esp
801001cd: 8b 5d fc mov -0x4(%ebp),%ebx
801001d0: c9 leave
801001d1: c3 ret
panic("bwrite");
801001d2: 83 ec 0c sub $0xc,%esp
801001d5: 68 bf 6a 10 80 push $0x80106abf
801001da: e8 76 01 00 00 call 80100355 <panic>
801001df <brelse>:
// Release a locked buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
801001df: f3 0f 1e fb endbr32
801001e3: 55 push %ebp
801001e4: 89 e5 mov %esp,%ebp
801001e6: 56 push %esi
801001e7: 53 push %ebx
801001e8: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holdingsleep(&b->lock))
801001eb: 8d 73 0c lea 0xc(%ebx),%esi
801001ee: 83 ec 0c sub $0xc,%esp
801001f1: 56 push %esi
801001f2: e8 7b 3a 00 00 call 80103c72 <holdingsleep>
801001f7: 83 c4 10 add $0x10,%esp
801001fa: 85 c0 test %eax,%eax
801001fc: 74 69 je 80100267 <brelse+0x88>
panic("brelse");
releasesleep(&b->lock);
801001fe: 83 ec 0c sub $0xc,%esp
80100201: 56 push %esi
80100202: e8 2c 3a 00 00 call 80103c33 <releasesleep>
acquire(&bcache.lock);
80100207: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp)
8010020e: e8 fc 3b 00 00 call 80103e0f <acquire>
b->refcnt--;
80100213: 8b 43 4c mov 0x4c(%ebx),%eax
80100216: 48 dec %eax
80100217: 89 43 4c mov %eax,0x4c(%ebx)
if (b->refcnt == 0) {
8010021a: 83 c4 10 add $0x10,%esp
8010021d: 85 c0 test %eax,%eax
8010021f: 75 2f jne 80100250 <brelse+0x71>
// no one is waiting for it.
b->next->prev = b->prev;
80100221: 8b 43 54 mov 0x54(%ebx),%eax
80100224: 8b 53 50 mov 0x50(%ebx),%edx
80100227: 89 50 50 mov %edx,0x50(%eax)
b->prev->next = b->next;
8010022a: 8b 43 50 mov 0x50(%ebx),%eax
8010022d: 8b 53 54 mov 0x54(%ebx),%edx
80100230: 89 50 54 mov %edx,0x54(%eax)
b->next = bcache.head.next;
80100233: a1 10 fd 10 80 mov 0x8010fd10,%eax
80100238: 89 43 54 mov %eax,0x54(%ebx)
b->prev = &bcache.head;
8010023b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx)
bcache.head.next->prev = b;
80100242: a1 10 fd 10 80 mov 0x8010fd10,%eax
80100247: 89 58 50 mov %ebx,0x50(%eax)
bcache.head.next = b;
8010024a: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10
}
release(&bcache.lock);
80100250: 83 ec 0c sub $0xc,%esp
80100253: 68 c0 b5 10 80 push $0x8010b5c0
80100258: e8 1b 3c 00 00 call 80103e78 <release>
}
8010025d: 83 c4 10 add $0x10,%esp
80100260: 8d 65 f8 lea -0x8(%ebp),%esp
80100263: 5b pop %ebx
80100264: 5e pop %esi
80100265: 5d pop %ebp
80100266: c3 ret
panic("brelse");
80100267: 83 ec 0c sub $0xc,%esp
8010026a: 68 c6 6a 10 80 push $0x80106ac6
8010026f: e8 e1 00 00 00 call 80100355 <panic>
80100274 <consoleread>:
}
}
int
consoleread(struct inode *ip, char *dst, int n)
{
80100274: f3 0f 1e fb endbr32
80100278: 55 push %ebp
80100279: 89 e5 mov %esp,%ebp
8010027b: 57 push %edi
8010027c: 56 push %esi
8010027d: 53 push %ebx
8010027e: 83 ec 28 sub $0x28,%esp
80100281: 8b 7d 08 mov 0x8(%ebp),%edi
80100284: 8b 75 0c mov 0xc(%ebp),%esi
80100287: 8b 5d 10 mov 0x10(%ebp),%ebx
uint target;
int c;
iunlock(ip);
8010028a: 57 push %edi
8010028b: e8 ca 13 00 00 call 8010165a <iunlock>
target = n;
80100290: 89 5d e4 mov %ebx,-0x1c(%ebp)
acquire(&cons.lock);
80100293: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010029a: e8 70 3b 00 00 call 80103e0f <acquire>
while(n > 0){
8010029f: 83 c4 10 add $0x10,%esp
801002a2: 85 db test %ebx,%ebx
801002a4: 0f 8e 8c 00 00 00 jle 80100336 <consoleread+0xc2>
while(input.r == input.w){
801002aa: a1 a0 ff 10 80 mov 0x8010ffa0,%eax
801002af: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax
801002b5: 75 47 jne 801002fe <consoleread+0x8a>
if(myproc()->killed){
801002b7: e8 b9 2f 00 00 call 80103275 <myproc>
801002bc: 83 78 24 00 cmpl $0x0,0x24(%eax)
801002c0: 75 17 jne 801002d9 <consoleread+0x65>
release(&cons.lock);
ilock(ip);
return -1;
}
sleep(&input.r, &cons.lock);
801002c2: 83 ec 08 sub $0x8,%esp
801002c5: 68 20 a5 10 80 push $0x8010a520
801002ca: 68 a0 ff 10 80 push $0x8010ffa0
801002cf: e8 26 35 00 00 call 801037fa <sleep>
801002d4: 83 c4 10 add $0x10,%esp
801002d7: eb d1 jmp 801002aa <consoleread+0x36>
release(&cons.lock);
801002d9: 83 ec 0c sub $0xc,%esp
801002dc: 68 20 a5 10 80 push $0x8010a520
801002e1: e8 92 3b 00 00 call 80103e78 <release>
ilock(ip);
801002e6: 89 3c 24 mov %edi,(%esp)
801002e9: e8 a8 12 00 00 call 80101596 <ilock>
return -1;
801002ee: 83 c4 10 add $0x10,%esp
801002f1: b8 ff ff ff ff mov $0xffffffff,%eax
}
release(&cons.lock);
ilock(ip);
return target - n;
}
801002f6: 8d 65 f4 lea -0xc(%ebp),%esp
801002f9: 5b pop %ebx
801002fa: 5e pop %esi
801002fb: 5f pop %edi
801002fc: 5d pop %ebp
801002fd: c3 ret
c = input.buf[input.r++ % INPUT_BUF];
801002fe: 8d 50 01 lea 0x1(%eax),%edx
80100301: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0
80100307: 89 c2 mov %eax,%edx
80100309: 83 e2 7f and $0x7f,%edx
8010030c: 8a 92 20 ff 10 80 mov -0x7fef00e0(%edx),%dl
80100312: 0f be ca movsbl %dl,%ecx
if(c == C('D')){ // EOF
80100315: 80 fa 04 cmp $0x4,%dl
80100318: 74 12 je 8010032c <consoleread+0xb8>
*dst++ = c;
8010031a: 8d 46 01 lea 0x1(%esi),%eax
8010031d: 88 16 mov %dl,(%esi)
--n;
8010031f: 4b dec %ebx
if(c == '\n')
80100320: 83 f9 0a cmp $0xa,%ecx
80100323: 74 11 je 80100336 <consoleread+0xc2>
*dst++ = c;
80100325: 89 c6 mov %eax,%esi
80100327: e9 76 ff ff ff jmp 801002a2 <consoleread+0x2e>
if(n < target){
8010032c: 3b 5d e4 cmp -0x1c(%ebp),%ebx
8010032f: 73 05 jae 80100336 <consoleread+0xc2>
input.r--;
80100331: a3 a0 ff 10 80 mov %eax,0x8010ffa0
release(&cons.lock);
80100336: 83 ec 0c sub $0xc,%esp
80100339: 68 20 a5 10 80 push $0x8010a520
8010033e: e8 35 3b 00 00 call 80103e78 <release>
ilock(ip);
80100343: 89 3c 24 mov %edi,(%esp)
80100346: e8 4b 12 00 00 call 80101596 <ilock>
return target - n;
8010034b: 8b 45 e4 mov -0x1c(%ebp),%eax
8010034e: 29 d8 sub %ebx,%eax
80100350: 83 c4 10 add $0x10,%esp
80100353: eb a1 jmp 801002f6 <consoleread+0x82>
80100355 <panic>:
{
80100355: f3 0f 1e fb endbr32
80100359: 55 push %ebp
8010035a: 89 e5 mov %esp,%ebp
8010035c: 53 push %ebx
8010035d: 83 ec 34 sub $0x34,%esp
}
static inline void
cli(void)
{
asm volatile("cli");
80100360: fa cli
cons.locking = 0;
80100361: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554
80100368: 00 00 00
cprintf("lapicid %d: panic: ", lapicid());
8010036b: e8 62 20 00 00 call 801023d2 <lapicid>
80100370: 83 ec 08 sub $0x8,%esp
80100373: 50 push %eax
80100374: 68 cd 6a 10 80 push $0x80106acd
80100379: e8 7f 02 00 00 call 801005fd <cprintf>
cprintf(s);
8010037e: 83 c4 04 add $0x4,%esp
80100381: ff 75 08 pushl 0x8(%ebp)
80100384: e8 74 02 00 00 call 801005fd <cprintf>
cprintf("\n");
80100389: c7 04 24 93 74 10 80 movl $0x80107493,(%esp)
80100390: e8 68 02 00 00 call 801005fd <cprintf>
getcallerpcs(&s, pcs);
80100395: 83 c4 08 add $0x8,%esp
80100398: 8d 45 d0 lea -0x30(%ebp),%eax
8010039b: 50 push %eax
8010039c: 8d 45 08 lea 0x8(%ebp),%eax
8010039f: 50 push %eax
801003a0: e8 3e 39 00 00 call 80103ce3 <getcallerpcs>
for(i=0; i<10; i++)
801003a5: 83 c4 10 add $0x10,%esp
801003a8: bb 00 00 00 00 mov $0x0,%ebx
801003ad: eb 15 jmp 801003c4 <panic+0x6f>
cprintf(" %p", pcs[i]);
801003af: 83 ec 08 sub $0x8,%esp
801003b2: ff 74 9d d0 pushl -0x30(%ebp,%ebx,4)
801003b6: 68 e1 6a 10 80 push $0x80106ae1
801003bb: e8 3d 02 00 00 call 801005fd <cprintf>
for(i=0; i<10; i++)
801003c0: 43 inc %ebx
801003c1: 83 c4 10 add $0x10,%esp
801003c4: 83 fb 09 cmp $0x9,%ebx
801003c7: 7e e6 jle 801003af <panic+0x5a>
panicked = 1; // freeze other CPU
801003c9: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558
801003d0: 00 00 00
for(;;)
801003d3: eb fe jmp 801003d3 <panic+0x7e>
801003d5 <cgaputc>:
{
801003d5: 55 push %ebp
801003d6: 89 e5 mov %esp,%ebp
801003d8: 57 push %edi
801003d9: 56 push %esi
801003da: 53 push %ebx
801003db: 83 ec 0c sub $0xc,%esp
801003de: 89 c6 mov %eax,%esi
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801003e0: bf d4 03 00 00 mov $0x3d4,%edi
801003e5: b0 0e mov $0xe,%al
801003e7: 89 fa mov %edi,%edx
801003e9: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801003ea: bb d5 03 00 00 mov $0x3d5,%ebx
801003ef: 89 da mov %ebx,%edx
801003f1: ec in (%dx),%al
pos = inb(CRTPORT+1) << 8;
801003f2: 0f b6 c8 movzbl %al,%ecx
801003f5: c1 e1 08 shl $0x8,%ecx
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801003f8: b0 0f mov $0xf,%al
801003fa: 89 fa mov %edi,%edx
801003fc: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801003fd: 89 da mov %ebx,%edx
801003ff: ec in (%dx),%al
pos |= inb(CRTPORT+1);
80100400: 0f b6 c0 movzbl %al,%eax
80100403: 09 c1 or %eax,%ecx
if(c == '\n')
80100405: 83 fe 0a cmp $0xa,%esi
80100408: 74 61 je 8010046b <cgaputc+0x96>
else if(c == BACKSPACE){
8010040a: 81 fe 00 01 00 00 cmp $0x100,%esi
80100410: 74 69 je 8010047b <cgaputc+0xa6>
crt[pos++] = (c&0xff) | 0x0700; // black on white
80100412: 89 f0 mov %esi,%eax
80100414: 0f b6 f0 movzbl %al,%esi
80100417: 8d 59 01 lea 0x1(%ecx),%ebx
8010041a: 81 ce 00 07 00 00 or $0x700,%esi
80100420: 66 89 b4 09 00 80 0b mov %si,-0x7ff48000(%ecx,%ecx,1)
80100427: 80
if(pos < 0 || pos > 25*80)
80100428: 81 fb d0 07 00 00 cmp $0x7d0,%ebx
8010042e: 77 58 ja 80100488 <cgaputc+0xb3>
if((pos/80) >= 24){ // Scroll up.
80100430: 81 fb 7f 07 00 00 cmp $0x77f,%ebx
80100436: 7f 5d jg 80100495 <cgaputc+0xc0>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100438: be d4 03 00 00 mov $0x3d4,%esi
8010043d: b0 0e mov $0xe,%al
8010043f: 89 f2 mov %esi,%edx
80100441: ee out %al,(%dx)
outb(CRTPORT+1, pos>>8);
80100442: 89 d8 mov %ebx,%eax
80100444: c1 f8 08 sar $0x8,%eax
80100447: b9 d5 03 00 00 mov $0x3d5,%ecx
8010044c: 89 ca mov %ecx,%edx
8010044e: ee out %al,(%dx)
8010044f: b0 0f mov $0xf,%al
80100451: 89 f2 mov %esi,%edx
80100453: ee out %al,(%dx)
80100454: 88 d8 mov %bl,%al
80100456: 89 ca mov %ecx,%edx
80100458: ee out %al,(%dx)
crt[pos] = ' ' | 0x0700;
80100459: 66 c7 84 1b 00 80 0b movw $0x720,-0x7ff48000(%ebx,%ebx,1)
80100460: 80 20 07
}
80100463: 8d 65 f4 lea -0xc(%ebp),%esp
80100466: 5b pop %ebx
80100467: 5e pop %esi
80100468: 5f pop %edi
80100469: 5d pop %ebp
8010046a: c3 ret
pos += 80 - pos%80;
8010046b: bb 50 00 00 00 mov $0x50,%ebx
80100470: 89 c8 mov %ecx,%eax
80100472: 99 cltd
80100473: f7 fb idiv %ebx
80100475: 29 d3 sub %edx,%ebx
80100477: 01 cb add %ecx,%ebx
80100479: eb ad jmp 80100428 <cgaputc+0x53>
if(pos > 0) --pos;
8010047b: 85 c9 test %ecx,%ecx
8010047d: 7e 05 jle 80100484 <cgaputc+0xaf>
8010047f: 8d 59 ff lea -0x1(%ecx),%ebx
80100482: eb a4 jmp 80100428 <cgaputc+0x53>
pos |= inb(CRTPORT+1);
80100484: 89 cb mov %ecx,%ebx
80100486: eb a0 jmp 80100428 <cgaputc+0x53>
panic("pos under/overflow");
80100488: 83 ec 0c sub $0xc,%esp
8010048b: 68 e5 6a 10 80 push $0x80106ae5
80100490: e8 c0 fe ff ff call 80100355 <panic>
memmove(crt, crt+80, sizeof(crt[0])*23*80);
80100495: 83 ec 04 sub $0x4,%esp
80100498: 68 60 0e 00 00 push $0xe60
8010049d: 68 a0 80 0b 80 push $0x800b80a0
801004a2: 68 00 80 0b 80 push $0x800b8000
801004a7: e8 95 3a 00 00 call 80103f41 <memmove>
pos -= 80;
801004ac: 83 eb 50 sub $0x50,%ebx
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801004af: b8 80 07 00 00 mov $0x780,%eax
801004b4: 29 d8 sub %ebx,%eax
801004b6: 8d 94 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%edx
801004bd: 83 c4 0c add $0xc,%esp
801004c0: 01 c0 add %eax,%eax
801004c2: 50 push %eax
801004c3: 6a 00 push $0x0
801004c5: 52 push %edx
801004c6: e8 f8 39 00 00 call 80103ec3 <memset>
801004cb: 83 c4 10 add $0x10,%esp
801004ce: e9 65 ff ff ff jmp 80100438 <cgaputc+0x63>
801004d3 <consputc>:
if(panicked){
801004d3: 83 3d 58 a5 10 80 00 cmpl $0x0,0x8010a558
801004da: 74 03 je 801004df <consputc+0xc>
asm volatile("cli");
801004dc: fa cli
for(;;)
801004dd: eb fe jmp 801004dd <consputc+0xa>
{
801004df: 55 push %ebp
801004e0: 89 e5 mov %esp,%ebp
801004e2: 53 push %ebx
801004e3: 83 ec 04 sub $0x4,%esp
801004e6: 89 c3 mov %eax,%ebx
if(c == BACKSPACE){
801004e8: 3d 00 01 00 00 cmp $0x100,%eax
801004ed: 74 18 je 80100507 <consputc+0x34>
uartputc(c);
801004ef: 83 ec 0c sub $0xc,%esp
801004f2: 50 push %eax
801004f3: e8 44 51 00 00 call 8010563c <uartputc>
801004f8: 83 c4 10 add $0x10,%esp
cgaputc(c);
801004fb: 89 d8 mov %ebx,%eax
801004fd: e8 d3 fe ff ff call 801003d5 <cgaputc>
}
80100502: 8b 5d fc mov -0x4(%ebp),%ebx
80100505: c9 leave
80100506: c3 ret
uartputc('\b'); uartputc(' '); uartputc('\b');
80100507: 83 ec 0c sub $0xc,%esp
8010050a: 6a 08 push $0x8
8010050c: e8 2b 51 00 00 call 8010563c <uartputc>
80100511: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80100518: e8 1f 51 00 00 call 8010563c <uartputc>
8010051d: c7 04 24 08 00 00 00 movl $0x8,(%esp)
80100524: e8 13 51 00 00 call 8010563c <uartputc>
80100529: 83 c4 10 add $0x10,%esp
8010052c: eb cd jmp 801004fb <consputc+0x28>
8010052e <printint>:
{
8010052e: 55 push %ebp
8010052f: 89 e5 mov %esp,%ebp
80100531: 57 push %edi
80100532: 56 push %esi
80100533: 53 push %ebx
80100534: 83 ec 2c sub $0x2c,%esp
80100537: 89 d6 mov %edx,%esi
80100539: 89 4d d4 mov %ecx,-0x2c(%ebp)
if(sign && (sign = xx < 0))
8010053c: 85 c9 test %ecx,%ecx
8010053e: 74 0c je 8010054c <printint+0x1e>
80100540: 89 c7 mov %eax,%edi
80100542: c1 ef 1f shr $0x1f,%edi
80100545: 89 7d d4 mov %edi,-0x2c(%ebp)
80100548: 85 c0 test %eax,%eax
8010054a: 78 35 js 80100581 <printint+0x53>
x = xx;
8010054c: 89 c1 mov %eax,%ecx
i = 0;
8010054e: bb 00 00 00 00 mov $0x0,%ebx
buf[i++] = digits[x % base];
80100553: 89 c8 mov %ecx,%eax
80100555: ba 00 00 00 00 mov $0x0,%edx
8010055a: f7 f6 div %esi
8010055c: 89 df mov %ebx,%edi
8010055e: 43 inc %ebx
8010055f: 8a 92 10 6b 10 80 mov -0x7fef94f0(%edx),%dl
80100565: 88 54 3d d8 mov %dl,-0x28(%ebp,%edi,1)
}while((x /= base) != 0);
80100569: 89 ca mov %ecx,%edx
8010056b: 89 c1 mov %eax,%ecx
8010056d: 39 d6 cmp %edx,%esi
8010056f: 76 e2 jbe 80100553 <printint+0x25>
if(sign)
80100571: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp)
80100575: 74 1a je 80100591 <printint+0x63>
buf[i++] = '-';
80100577: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
8010057c: 8d 5f 02 lea 0x2(%edi),%ebx
8010057f: eb 10 jmp 80100591 <printint+0x63>
x = -xx;
80100581: f7 d8 neg %eax
80100583: 89 c1 mov %eax,%ecx
80100585: eb c7 jmp 8010054e <printint+0x20>
consputc(buf[i]);
80100587: 0f be 44 1d d8 movsbl -0x28(%ebp,%ebx,1),%eax
8010058c: e8 42 ff ff ff call 801004d3 <consputc>
while(--i >= 0)
80100591: 4b dec %ebx
80100592: 79 f3 jns 80100587 <printint+0x59>
}
80100594: 83 c4 2c add $0x2c,%esp
80100597: 5b pop %ebx
80100598: 5e pop %esi
80100599: 5f pop %edi
8010059a: 5d pop %ebp
8010059b: c3 ret
8010059c <consolewrite>:
int
consolewrite(struct inode *ip, char *buf, int n)
{
8010059c: f3 0f 1e fb endbr32
801005a0: 55 push %ebp
801005a1: 89 e5 mov %esp,%ebp
801005a3: 57 push %edi
801005a4: 56 push %esi
801005a5: 53 push %ebx
801005a6: 83 ec 18 sub $0x18,%esp
801005a9: 8b 7d 0c mov 0xc(%ebp),%edi
801005ac: 8b 75 10 mov 0x10(%ebp),%esi
int i;
iunlock(ip);
801005af: ff 75 08 pushl 0x8(%ebp)
801005b2: e8 a3 10 00 00 call 8010165a <iunlock>
acquire(&cons.lock);
801005b7: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
801005be: e8 4c 38 00 00 call 80103e0f <acquire>
for(i = 0; i < n; i++)
801005c3: 83 c4 10 add $0x10,%esp
801005c6: bb 00 00 00 00 mov $0x0,%ebx
801005cb: 39 f3 cmp %esi,%ebx
801005cd: 7d 0c jge 801005db <consolewrite+0x3f>
consputc(buf[i] & 0xff);
801005cf: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
801005d3: e8 fb fe ff ff call 801004d3 <consputc>
for(i = 0; i < n; i++)
801005d8: 43 inc %ebx
801005d9: eb f0 jmp 801005cb <consolewrite+0x2f>
release(&cons.lock);
801005db: 83 ec 0c sub $0xc,%esp
801005de: 68 20 a5 10 80 push $0x8010a520
801005e3: e8 90 38 00 00 call 80103e78 <release>
ilock(ip);
801005e8: 83 c4 04 add $0x4,%esp
801005eb: ff 75 08 pushl 0x8(%ebp)
801005ee: e8 a3 0f 00 00 call 80101596 <ilock>
return n;
}
801005f3: 89 f0 mov %esi,%eax
801005f5: 8d 65 f4 lea -0xc(%ebp),%esp
801005f8: 5b pop %ebx
801005f9: 5e pop %esi
801005fa: 5f pop %edi
801005fb: 5d pop %ebp
801005fc: c3 ret
801005fd <cprintf>:
{
801005fd: f3 0f 1e fb endbr32
80100601: 55 push %ebp
80100602: 89 e5 mov %esp,%ebp
80100604: 57 push %edi
80100605: 56 push %esi
80100606: 53 push %ebx
80100607: 83 ec 1c sub $0x1c,%esp
locking = cons.locking;
8010060a: a1 54 a5 10 80 mov 0x8010a554,%eax
8010060f: 89 45 e0 mov %eax,-0x20(%ebp)
if(locking)
80100612: 85 c0 test %eax,%eax
80100614: 75 10 jne 80100626 <cprintf+0x29>
if (fmt == 0)
80100616: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
8010061a: 74 1c je 80100638 <cprintf+0x3b>
argp = (uint*)(void*)(&fmt + 1);
8010061c: 8d 7d 0c lea 0xc(%ebp),%edi
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
8010061f: be 00 00 00 00 mov $0x0,%esi
80100624: eb 25 jmp 8010064b <cprintf+0x4e>
acquire(&cons.lock);
80100626: 83 ec 0c sub $0xc,%esp
80100629: 68 20 a5 10 80 push $0x8010a520
8010062e: e8 dc 37 00 00 call 80103e0f <acquire>
80100633: 83 c4 10 add $0x10,%esp
80100636: eb de jmp 80100616 <cprintf+0x19>
panic("null fmt");
80100638: 83 ec 0c sub $0xc,%esp
8010063b: 68 ff 6a 10 80 push $0x80106aff
80100640: e8 10 fd ff ff call 80100355 <panic>
consputc(c);
80100645: e8 89 fe ff ff call 801004d3 <consputc>
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
8010064a: 46 inc %esi
8010064b: 8b 55 08 mov 0x8(%ebp),%edx
8010064e: 0f b6 04 32 movzbl (%edx,%esi,1),%eax
80100652: 85 c0 test %eax,%eax
80100654: 0f 84 ac 00 00 00 je 80100706 <cprintf+0x109>
if(c != '%'){
8010065a: 83 f8 25 cmp $0x25,%eax
8010065d: 75 e6 jne 80100645 <cprintf+0x48>
c = fmt[++i] & 0xff;
8010065f: 46 inc %esi
80100660: 0f b6 1c 32 movzbl (%edx,%esi,1),%ebx
if(c == 0)
80100664: 85 db test %ebx,%ebx
80100666: 0f 84 9a 00 00 00 je 80100706 <cprintf+0x109>
switch(c){
8010066c: 83 fb 70 cmp $0x70,%ebx
8010066f: 74 2e je 8010069f <cprintf+0xa2>
80100671: 7f 22 jg 80100695 <cprintf+0x98>
80100673: 83 fb 25 cmp $0x25,%ebx
80100676: 74 69 je 801006e1 <cprintf+0xe4>
80100678: 83 fb 64 cmp $0x64,%ebx
8010067b: 75 73 jne 801006f0 <cprintf+0xf3>
printint(*argp++, 10, 1);
8010067d: 8d 5f 04 lea 0x4(%edi),%ebx
80100680: 8b 07 mov (%edi),%eax
80100682: b9 01 00 00 00 mov $0x1,%ecx
80100687: ba 0a 00 00 00 mov $0xa,%edx
8010068c: e8 9d fe ff ff call 8010052e <printint>
80100691: 89 df mov %ebx,%edi
break;
80100693: eb b5 jmp 8010064a <cprintf+0x4d>
switch(c){
80100695: 83 fb 73 cmp $0x73,%ebx
80100698: 74 1d je 801006b7 <cprintf+0xba>
8010069a: 83 fb 78 cmp $0x78,%ebx
8010069d: 75 51 jne 801006f0 <cprintf+0xf3>
printint(*argp++, 16, 0);
8010069f: 8d 5f 04 lea 0x4(%edi),%ebx
801006a2: 8b 07 mov (%edi),%eax
801006a4: b9 00 00 00 00 mov $0x0,%ecx
801006a9: ba 10 00 00 00 mov $0x10,%edx
801006ae: e8 7b fe ff ff call 8010052e <printint>
801006b3: 89 df mov %ebx,%edi
break;
801006b5: eb 93 jmp 8010064a <cprintf+0x4d>
if((s = (char*)*argp++) == 0)
801006b7: 8d 47 04 lea 0x4(%edi),%eax
801006ba: 89 45 e4 mov %eax,-0x1c(%ebp)
801006bd: 8b 1f mov (%edi),%ebx
801006bf: 85 db test %ebx,%ebx
801006c1: 75 05 jne 801006c8 <cprintf+0xcb>
s = "(null)";
801006c3: bb f8 6a 10 80 mov $0x80106af8,%ebx
for(; *s; s++)
801006c8: 8a 03 mov (%ebx),%al
801006ca: 84 c0 test %al,%al
801006cc: 74 0b je 801006d9 <cprintf+0xdc>
consputc(*s);
801006ce: 0f be c0 movsbl %al,%eax
801006d1: e8 fd fd ff ff call 801004d3 <consputc>
for(; *s; s++)
801006d6: 43 inc %ebx
801006d7: eb ef jmp 801006c8 <cprintf+0xcb>
if((s = (char*)*argp++) == 0)
801006d9: 8b 7d e4 mov -0x1c(%ebp),%edi
801006dc: e9 69 ff ff ff jmp 8010064a <cprintf+0x4d>
consputc('%');
801006e1: b8 25 00 00 00 mov $0x25,%eax
801006e6: e8 e8 fd ff ff call 801004d3 <consputc>
break;
801006eb: e9 5a ff ff ff jmp 8010064a <cprintf+0x4d>
consputc('%');
801006f0: b8 25 00 00 00 mov $0x25,%eax
801006f5: e8 d9 fd ff ff call 801004d3 <consputc>
consputc(c);
801006fa: 89 d8 mov %ebx,%eax
801006fc: e8 d2 fd ff ff call 801004d3 <consputc>
break;
80100701: e9 44 ff ff ff jmp 8010064a <cprintf+0x4d>
if(locking)
80100706: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
8010070a: 75 08 jne 80100714 <cprintf+0x117>
}
8010070c: 8d 65 f4 lea -0xc(%ebp),%esp
8010070f: 5b pop %ebx
80100710: 5e pop %esi
80100711: 5f pop %edi
80100712: 5d pop %ebp
80100713: c3 ret
release(&cons.lock);
80100714: 83 ec 0c sub $0xc,%esp
80100717: 68 20 a5 10 80 push $0x8010a520
8010071c: e8 57 37 00 00 call 80103e78 <release>
80100721: 83 c4 10 add $0x10,%esp
}
80100724: eb e6 jmp 8010070c <cprintf+0x10f>
80100726 <consoleintr>:
{
80100726: f3 0f 1e fb endbr32
8010072a: 55 push %ebp
8010072b: 89 e5 mov %esp,%ebp
8010072d: 57 push %edi
8010072e: 56 push %esi
8010072f: 53 push %ebx
80100730: 83 ec 18 sub $0x18,%esp
80100733: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&cons.lock);
80100736: 68 20 a5 10 80 push $0x8010a520
8010073b: e8 cf 36 00 00 call 80103e0f <acquire>
while((c = getc()) >= 0){
80100740: 83 c4 10 add $0x10,%esp
int c, doprocdump = 0;
80100743: be 00 00 00 00 mov $0x0,%esi
while((c = getc()) >= 0){
80100748: eb 13 jmp 8010075d <consoleintr+0x37>
switch(c){
8010074a: 83 ff 08 cmp $0x8,%edi
8010074d: 0f 84 d1 00 00 00 je 80100824 <consoleintr+0xfe>
80100753: 83 ff 10 cmp $0x10,%edi
80100756: 75 25 jne 8010077d <consoleintr+0x57>
80100758: be 01 00 00 00 mov $0x1,%esi
while((c = getc()) >= 0){
8010075d: ff d3 call *%ebx
8010075f: 89 c7 mov %eax,%edi
80100761: 85 c0 test %eax,%eax
80100763: 0f 88 eb 00 00 00 js 80100854 <consoleintr+0x12e>
switch(c){
80100769: 83 ff 15 cmp $0x15,%edi
8010076c: 0f 84 8d 00 00 00 je 801007ff <consoleintr+0xd9>
80100772: 7e d6 jle 8010074a <consoleintr+0x24>
80100774: 83 ff 7f cmp $0x7f,%edi
80100777: 0f 84 a7 00 00 00 je 80100824 <consoleintr+0xfe>
if(c != 0 && input.e-input.r < INPUT_BUF){
8010077d: 85 ff test %edi,%edi
8010077f: 74 dc je 8010075d <consoleintr+0x37>
80100781: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
80100786: 89 c2 mov %eax,%edx
80100788: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx
8010078e: 83 fa 7f cmp $0x7f,%edx
80100791: 77 ca ja 8010075d <consoleintr+0x37>
c = (c == '\r') ? '\n' : c;
80100793: 83 ff 0d cmp $0xd,%edi
80100796: 0f 84 ae 00 00 00 je 8010084a <consoleintr+0x124>
input.buf[input.e++ % INPUT_BUF] = c;
8010079c: 8d 50 01 lea 0x1(%eax),%edx
8010079f: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8
801007a5: 83 e0 7f and $0x7f,%eax
801007a8: 89 f9 mov %edi,%ecx
801007aa: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax)
consputc(c);
801007b0: 89 f8 mov %edi,%eax
801007b2: e8 1c fd ff ff call 801004d3 <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
801007b7: 83 ff 0a cmp $0xa,%edi
801007ba: 74 15 je 801007d1 <consoleintr+0xab>
801007bc: 83 ff 04 cmp $0x4,%edi
801007bf: 74 10 je 801007d1 <consoleintr+0xab>
801007c1: a1 a0 ff 10 80 mov 0x8010ffa0,%eax
801007c6: 83 e8 80 sub $0xffffff80,%eax
801007c9: 39 05 a8 ff 10 80 cmp %eax,0x8010ffa8
801007cf: 75 8c jne 8010075d <consoleintr+0x37>
input.w = input.e;
801007d1: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
801007d6: a3 a4 ff 10 80 mov %eax,0x8010ffa4
wakeup(&input.r);
801007db: 83 ec 0c sub $0xc,%esp
801007de: 68 a0 ff 10 80 push $0x8010ffa0
801007e3: e8 8c 31 00 00 call 80103974 <wakeup>
801007e8: 83 c4 10 add $0x10,%esp
801007eb: e9 6d ff ff ff jmp 8010075d <consoleintr+0x37>
input.e--;
801007f0: a3 a8 ff 10 80 mov %eax,0x8010ffa8
consputc(BACKSPACE);
801007f5: b8 00 01 00 00 mov $0x100,%eax
801007fa: e8 d4 fc ff ff call 801004d3 <consputc>
while(input.e != input.w &&
801007ff: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
80100804: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax
8010080a: 0f 84 4d ff ff ff je 8010075d <consoleintr+0x37>