-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel.asm
17726 lines (16633 loc) · 655 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: file format elf32-i386
Disassembly of section .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 a0 10 00 mov $0x10a000,%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 50 c6 10 80 mov $0x8010c650,%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 7d 34 10 80 mov $0x8010347d,%eax
jmp *%eax
80100032: ff e0 jmp *%eax
80100034 <binit>:
struct buf head;
} bcache;
void
binit(void)
{
80100034: 55 push %ebp
80100035: 89 e5 mov %esp,%ebp
80100037: 83 ec 18 sub $0x18,%esp
struct buf *b;
initlock(&bcache.lock, "bcache");
8010003a: 83 ec 08 sub $0x8,%esp
8010003d: 68 a8 80 10 80 push $0x801080a8
80100042: 68 60 c6 10 80 push $0x8010c660
80100047: e8 45 4b 00 00 call 80104b91 <initlock>
8010004c: 83 c4 10 add $0x10,%esp
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
8010004f: c7 05 90 db 10 80 84 movl $0x8010db84,0x8010db90
80100056: db 10 80
bcache.head.next = &bcache.head;
80100059: c7 05 94 db 10 80 84 movl $0x8010db84,0x8010db94
80100060: db 10 80
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100063: c7 45 f4 94 c6 10 80 movl $0x8010c694,-0xc(%ebp)
8010006a: eb 3a jmp 801000a6 <binit+0x72>
b->next = bcache.head.next;
8010006c: 8b 15 94 db 10 80 mov 0x8010db94,%edx
80100072: 8b 45 f4 mov -0xc(%ebp),%eax
80100075: 89 50 10 mov %edx,0x10(%eax)
b->prev = &bcache.head;
80100078: 8b 45 f4 mov -0xc(%ebp),%eax
8010007b: c7 40 0c 84 db 10 80 movl $0x8010db84,0xc(%eax)
b->dev = -1;
80100082: 8b 45 f4 mov -0xc(%ebp),%eax
80100085: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax)
bcache.head.next->prev = b;
8010008c: a1 94 db 10 80 mov 0x8010db94,%eax
80100091: 8b 55 f4 mov -0xc(%ebp),%edx
80100094: 89 50 0c mov %edx,0xc(%eax)
bcache.head.next = b;
80100097: 8b 45 f4 mov -0xc(%ebp),%eax
8010009a: a3 94 db 10 80 mov %eax,0x8010db94
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
8010009f: 81 45 f4 18 02 00 00 addl $0x218,-0xc(%ebp)
801000a6: b8 84 db 10 80 mov $0x8010db84,%eax
801000ab: 39 45 f4 cmp %eax,-0xc(%ebp)
801000ae: 72 bc jb 8010006c <binit+0x38>
b->prev = &bcache.head;
b->dev = -1;
bcache.head.next->prev = b;
bcache.head.next = b;
}
}
801000b0: 90 nop
801000b1: c9 leave
801000b2: c3 ret
801000b3 <bget>:
// Look through buffer cache for sector on device dev.
// If not found, allocate fresh block.
// In either case, return B_BUSY buffer.
static struct buf*
bget(uint dev, uint sector)
{
801000b3: 55 push %ebp
801000b4: 89 e5 mov %esp,%ebp
801000b6: 83 ec 18 sub $0x18,%esp
struct buf *b;
acquire(&bcache.lock);
801000b9: 83 ec 0c sub $0xc,%esp
801000bc: 68 60 c6 10 80 push $0x8010c660
801000c1: e8 ed 4a 00 00 call 80104bb3 <acquire>
801000c6: 83 c4 10 add $0x10,%esp
loop:
// Is the sector already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000c9: a1 94 db 10 80 mov 0x8010db94,%eax
801000ce: 89 45 f4 mov %eax,-0xc(%ebp)
801000d1: eb 67 jmp 8010013a <bget+0x87>
if(b->dev == dev && b->sector == sector){
801000d3: 8b 45 f4 mov -0xc(%ebp),%eax
801000d6: 8b 40 04 mov 0x4(%eax),%eax
801000d9: 3b 45 08 cmp 0x8(%ebp),%eax
801000dc: 75 53 jne 80100131 <bget+0x7e>
801000de: 8b 45 f4 mov -0xc(%ebp),%eax
801000e1: 8b 40 08 mov 0x8(%eax),%eax
801000e4: 3b 45 0c cmp 0xc(%ebp),%eax
801000e7: 75 48 jne 80100131 <bget+0x7e>
if(!(b->flags & B_BUSY)){
801000e9: 8b 45 f4 mov -0xc(%ebp),%eax
801000ec: 8b 00 mov (%eax),%eax
801000ee: 83 e0 01 and $0x1,%eax
801000f1: 85 c0 test %eax,%eax
801000f3: 75 27 jne 8010011c <bget+0x69>
b->flags |= B_BUSY;
801000f5: 8b 45 f4 mov -0xc(%ebp),%eax
801000f8: 8b 00 mov (%eax),%eax
801000fa: 83 c8 01 or $0x1,%eax
801000fd: 89 c2 mov %eax,%edx
801000ff: 8b 45 f4 mov -0xc(%ebp),%eax
80100102: 89 10 mov %edx,(%eax)
release(&bcache.lock);
80100104: 83 ec 0c sub $0xc,%esp
80100107: 68 60 c6 10 80 push $0x8010c660
8010010c: e8 09 4b 00 00 call 80104c1a <release>
80100111: 83 c4 10 add $0x10,%esp
return b;
80100114: 8b 45 f4 mov -0xc(%ebp),%eax
80100117: e9 98 00 00 00 jmp 801001b4 <bget+0x101>
}
sleep(b, &bcache.lock);
8010011c: 83 ec 08 sub $0x8,%esp
8010011f: 68 60 c6 10 80 push $0x8010c660
80100124: ff 75 f4 pushl -0xc(%ebp)
80100127: e8 8e 47 00 00 call 801048ba <sleep>
8010012c: 83 c4 10 add $0x10,%esp
goto loop;
8010012f: eb 98 jmp 801000c9 <bget+0x16>
acquire(&bcache.lock);
loop:
// Is the sector already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
80100131: 8b 45 f4 mov -0xc(%ebp),%eax
80100134: 8b 40 10 mov 0x10(%eax),%eax
80100137: 89 45 f4 mov %eax,-0xc(%ebp)
8010013a: 81 7d f4 84 db 10 80 cmpl $0x8010db84,-0xc(%ebp)
80100141: 75 90 jne 801000d3 <bget+0x20>
goto loop;
}
}
// Not cached; recycle some non-busy and clean buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100143: a1 90 db 10 80 mov 0x8010db90,%eax
80100148: 89 45 f4 mov %eax,-0xc(%ebp)
8010014b: eb 51 jmp 8010019e <bget+0xeb>
if((b->flags & B_BUSY) == 0 && (b->flags & B_DIRTY) == 0){
8010014d: 8b 45 f4 mov -0xc(%ebp),%eax
80100150: 8b 00 mov (%eax),%eax
80100152: 83 e0 01 and $0x1,%eax
80100155: 85 c0 test %eax,%eax
80100157: 75 3c jne 80100195 <bget+0xe2>
80100159: 8b 45 f4 mov -0xc(%ebp),%eax
8010015c: 8b 00 mov (%eax),%eax
8010015e: 83 e0 04 and $0x4,%eax
80100161: 85 c0 test %eax,%eax
80100163: 75 30 jne 80100195 <bget+0xe2>
b->dev = dev;
80100165: 8b 45 f4 mov -0xc(%ebp),%eax
80100168: 8b 55 08 mov 0x8(%ebp),%edx
8010016b: 89 50 04 mov %edx,0x4(%eax)
b->sector = sector;
8010016e: 8b 45 f4 mov -0xc(%ebp),%eax
80100171: 8b 55 0c mov 0xc(%ebp),%edx
80100174: 89 50 08 mov %edx,0x8(%eax)
b->flags = B_BUSY;
80100177: 8b 45 f4 mov -0xc(%ebp),%eax
8010017a: c7 00 01 00 00 00 movl $0x1,(%eax)
release(&bcache.lock);
80100180: 83 ec 0c sub $0xc,%esp
80100183: 68 60 c6 10 80 push $0x8010c660
80100188: e8 8d 4a 00 00 call 80104c1a <release>
8010018d: 83 c4 10 add $0x10,%esp
return b;
80100190: 8b 45 f4 mov -0xc(%ebp),%eax
80100193: eb 1f jmp 801001b4 <bget+0x101>
goto loop;
}
}
// Not cached; recycle some non-busy and clean buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100195: 8b 45 f4 mov -0xc(%ebp),%eax
80100198: 8b 40 0c mov 0xc(%eax),%eax
8010019b: 89 45 f4 mov %eax,-0xc(%ebp)
8010019e: 81 7d f4 84 db 10 80 cmpl $0x8010db84,-0xc(%ebp)
801001a5: 75 a6 jne 8010014d <bget+0x9a>
b->flags = B_BUSY;
release(&bcache.lock);
return b;
}
}
panic("bget: no buffers");
801001a7: 83 ec 0c sub $0xc,%esp
801001aa: 68 af 80 10 80 push $0x801080af
801001af: e8 b2 03 00 00 call 80100566 <panic>
}
801001b4: c9 leave
801001b5: c3 ret
801001b6 <bread>:
// Return a B_BUSY buf with the contents of the indicated disk sector.
struct buf*
bread(uint dev, uint sector)
{
801001b6: 55 push %ebp
801001b7: 89 e5 mov %esp,%ebp
801001b9: 83 ec 18 sub $0x18,%esp
struct buf *b;
b = bget(dev, sector);
801001bc: 83 ec 08 sub $0x8,%esp
801001bf: ff 75 0c pushl 0xc(%ebp)
801001c2: ff 75 08 pushl 0x8(%ebp)
801001c5: e8 e9 fe ff ff call 801000b3 <bget>
801001ca: 83 c4 10 add $0x10,%esp
801001cd: 89 45 f4 mov %eax,-0xc(%ebp)
if(!(b->flags & B_VALID))
801001d0: 8b 45 f4 mov -0xc(%ebp),%eax
801001d3: 8b 00 mov (%eax),%eax
801001d5: 83 e0 02 and $0x2,%eax
801001d8: 85 c0 test %eax,%eax
801001da: 75 0e jne 801001ea <bread+0x34>
iderw(b);
801001dc: 83 ec 0c sub $0xc,%esp
801001df: ff 75 f4 pushl -0xc(%ebp)
801001e2: e8 71 26 00 00 call 80102858 <iderw>
801001e7: 83 c4 10 add $0x10,%esp
return b;
801001ea: 8b 45 f4 mov -0xc(%ebp),%eax
}
801001ed: c9 leave
801001ee: c3 ret
801001ef <bwrite>:
// Write b's contents to disk. Must be B_BUSY.
void
bwrite(struct buf *b)
{
801001ef: 55 push %ebp
801001f0: 89 e5 mov %esp,%ebp
801001f2: 83 ec 08 sub $0x8,%esp
if((b->flags & B_BUSY) == 0)
801001f5: 8b 45 08 mov 0x8(%ebp),%eax
801001f8: 8b 00 mov (%eax),%eax
801001fa: 83 e0 01 and $0x1,%eax
801001fd: 85 c0 test %eax,%eax
801001ff: 75 0d jne 8010020e <bwrite+0x1f>
panic("bwrite");
80100201: 83 ec 0c sub $0xc,%esp
80100204: 68 c0 80 10 80 push $0x801080c0
80100209: e8 58 03 00 00 call 80100566 <panic>
b->flags |= B_DIRTY;
8010020e: 8b 45 08 mov 0x8(%ebp),%eax
80100211: 8b 00 mov (%eax),%eax
80100213: 83 c8 04 or $0x4,%eax
80100216: 89 c2 mov %eax,%edx
80100218: 8b 45 08 mov 0x8(%ebp),%eax
8010021b: 89 10 mov %edx,(%eax)
iderw(b);
8010021d: 83 ec 0c sub $0xc,%esp
80100220: ff 75 08 pushl 0x8(%ebp)
80100223: e8 30 26 00 00 call 80102858 <iderw>
80100228: 83 c4 10 add $0x10,%esp
}
8010022b: 90 nop
8010022c: c9 leave
8010022d: c3 ret
8010022e <brelse>:
// Release a B_BUSY buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
8010022e: 55 push %ebp
8010022f: 89 e5 mov %esp,%ebp
80100231: 83 ec 08 sub $0x8,%esp
if((b->flags & B_BUSY) == 0)
80100234: 8b 45 08 mov 0x8(%ebp),%eax
80100237: 8b 00 mov (%eax),%eax
80100239: 83 e0 01 and $0x1,%eax
8010023c: 85 c0 test %eax,%eax
8010023e: 75 0d jne 8010024d <brelse+0x1f>
panic("brelse");
80100240: 83 ec 0c sub $0xc,%esp
80100243: 68 c7 80 10 80 push $0x801080c7
80100248: e8 19 03 00 00 call 80100566 <panic>
acquire(&bcache.lock);
8010024d: 83 ec 0c sub $0xc,%esp
80100250: 68 60 c6 10 80 push $0x8010c660
80100255: e8 59 49 00 00 call 80104bb3 <acquire>
8010025a: 83 c4 10 add $0x10,%esp
b->next->prev = b->prev;
8010025d: 8b 45 08 mov 0x8(%ebp),%eax
80100260: 8b 40 10 mov 0x10(%eax),%eax
80100263: 8b 55 08 mov 0x8(%ebp),%edx
80100266: 8b 52 0c mov 0xc(%edx),%edx
80100269: 89 50 0c mov %edx,0xc(%eax)
b->prev->next = b->next;
8010026c: 8b 45 08 mov 0x8(%ebp),%eax
8010026f: 8b 40 0c mov 0xc(%eax),%eax
80100272: 8b 55 08 mov 0x8(%ebp),%edx
80100275: 8b 52 10 mov 0x10(%edx),%edx
80100278: 89 50 10 mov %edx,0x10(%eax)
b->next = bcache.head.next;
8010027b: 8b 15 94 db 10 80 mov 0x8010db94,%edx
80100281: 8b 45 08 mov 0x8(%ebp),%eax
80100284: 89 50 10 mov %edx,0x10(%eax)
b->prev = &bcache.head;
80100287: 8b 45 08 mov 0x8(%ebp),%eax
8010028a: c7 40 0c 84 db 10 80 movl $0x8010db84,0xc(%eax)
bcache.head.next->prev = b;
80100291: a1 94 db 10 80 mov 0x8010db94,%eax
80100296: 8b 55 08 mov 0x8(%ebp),%edx
80100299: 89 50 0c mov %edx,0xc(%eax)
bcache.head.next = b;
8010029c: 8b 45 08 mov 0x8(%ebp),%eax
8010029f: a3 94 db 10 80 mov %eax,0x8010db94
b->flags &= ~B_BUSY;
801002a4: 8b 45 08 mov 0x8(%ebp),%eax
801002a7: 8b 00 mov (%eax),%eax
801002a9: 83 e0 fe and $0xfffffffe,%eax
801002ac: 89 c2 mov %eax,%edx
801002ae: 8b 45 08 mov 0x8(%ebp),%eax
801002b1: 89 10 mov %edx,(%eax)
wakeup(b);
801002b3: 83 ec 0c sub $0xc,%esp
801002b6: ff 75 08 pushl 0x8(%ebp)
801002b9: e8 e7 46 00 00 call 801049a5 <wakeup>
801002be: 83 c4 10 add $0x10,%esp
release(&bcache.lock);
801002c1: 83 ec 0c sub $0xc,%esp
801002c4: 68 60 c6 10 80 push $0x8010c660
801002c9: e8 4c 49 00 00 call 80104c1a <release>
801002ce: 83 c4 10 add $0x10,%esp
}
801002d1: 90 nop
801002d2: c9 leave
801002d3: c3 ret
801002d4 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
801002d4: 55 push %ebp
801002d5: 89 e5 mov %esp,%ebp
801002d7: 83 ec 14 sub $0x14,%esp
801002da: 8b 45 08 mov 0x8(%ebp),%eax
801002dd: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801002e1: 0f b7 45 ec movzwl -0x14(%ebp),%eax
801002e5: 89 c2 mov %eax,%edx
801002e7: ec in (%dx),%al
801002e8: 88 45 ff mov %al,-0x1(%ebp)
return data;
801002eb: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
801002ef: c9 leave
801002f0: c3 ret
801002f1 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
801002f1: 55 push %ebp
801002f2: 89 e5 mov %esp,%ebp
801002f4: 83 ec 08 sub $0x8,%esp
801002f7: 8b 55 08 mov 0x8(%ebp),%edx
801002fa: 8b 45 0c mov 0xc(%ebp),%eax
801002fd: 66 89 55 fc mov %dx,-0x4(%ebp)
80100301: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100304: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80100308: 0f b7 55 fc movzwl -0x4(%ebp),%edx
8010030c: ee out %al,(%dx)
}
8010030d: 90 nop
8010030e: c9 leave
8010030f: c3 ret
80100310 <cli>:
asm volatile("movw %0, %%gs" : : "r" (v));
}
static inline void
cli(void)
{
80100310: 55 push %ebp
80100311: 89 e5 mov %esp,%ebp
asm volatile("cli");
80100313: fa cli
}
80100314: 90 nop
80100315: 5d pop %ebp
80100316: c3 ret
80100317 <printint>:
int locking;
} cons;
static void
printint(int xx, int base, int sign)
{
80100317: 55 push %ebp
80100318: 89 e5 mov %esp,%ebp
8010031a: 53 push %ebx
8010031b: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
8010031e: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80100322: 74 1c je 80100340 <printint+0x29>
80100324: 8b 45 08 mov 0x8(%ebp),%eax
80100327: c1 e8 1f shr $0x1f,%eax
8010032a: 0f b6 c0 movzbl %al,%eax
8010032d: 89 45 10 mov %eax,0x10(%ebp)
80100330: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80100334: 74 0a je 80100340 <printint+0x29>
x = -xx;
80100336: 8b 45 08 mov 0x8(%ebp),%eax
80100339: f7 d8 neg %eax
8010033b: 89 45 f0 mov %eax,-0x10(%ebp)
8010033e: eb 06 jmp 80100346 <printint+0x2f>
else
x = xx;
80100340: 8b 45 08 mov 0x8(%ebp),%eax
80100343: 89 45 f0 mov %eax,-0x10(%ebp)
i = 0;
80100346: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
8010034d: 8b 4d f4 mov -0xc(%ebp),%ecx
80100350: 8d 41 01 lea 0x1(%ecx),%eax
80100353: 89 45 f4 mov %eax,-0xc(%ebp)
80100356: 8b 5d 0c mov 0xc(%ebp),%ebx
80100359: 8b 45 f0 mov -0x10(%ebp),%eax
8010035c: ba 00 00 00 00 mov $0x0,%edx
80100361: f7 f3 div %ebx
80100363: 89 d0 mov %edx,%eax
80100365: 0f b6 80 04 90 10 80 movzbl -0x7fef6ffc(%eax),%eax
8010036c: 88 44 0d e0 mov %al,-0x20(%ebp,%ecx,1)
}while((x /= base) != 0);
80100370: 8b 5d 0c mov 0xc(%ebp),%ebx
80100373: 8b 45 f0 mov -0x10(%ebp),%eax
80100376: ba 00 00 00 00 mov $0x0,%edx
8010037b: f7 f3 div %ebx
8010037d: 89 45 f0 mov %eax,-0x10(%ebp)
80100380: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100384: 75 c7 jne 8010034d <printint+0x36>
if(sign)
80100386: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010038a: 74 2a je 801003b6 <printint+0x9f>
buf[i++] = '-';
8010038c: 8b 45 f4 mov -0xc(%ebp),%eax
8010038f: 8d 50 01 lea 0x1(%eax),%edx
80100392: 89 55 f4 mov %edx,-0xc(%ebp)
80100395: c6 44 05 e0 2d movb $0x2d,-0x20(%ebp,%eax,1)
while(--i >= 0)
8010039a: eb 1a jmp 801003b6 <printint+0x9f>
consputc(buf[i]);
8010039c: 8d 55 e0 lea -0x20(%ebp),%edx
8010039f: 8b 45 f4 mov -0xc(%ebp),%eax
801003a2: 01 d0 add %edx,%eax
801003a4: 0f b6 00 movzbl (%eax),%eax
801003a7: 0f be c0 movsbl %al,%eax
801003aa: 83 ec 0c sub $0xc,%esp
801003ad: 50 push %eax
801003ae: e8 c3 03 00 00 call 80100776 <consputc>
801003b3: 83 c4 10 add $0x10,%esp
}while((x /= base) != 0);
if(sign)
buf[i++] = '-';
while(--i >= 0)
801003b6: 83 6d f4 01 subl $0x1,-0xc(%ebp)
801003ba: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801003be: 79 dc jns 8010039c <printint+0x85>
consputc(buf[i]);
}
801003c0: 90 nop
801003c1: 8b 5d fc mov -0x4(%ebp),%ebx
801003c4: c9 leave
801003c5: c3 ret
801003c6 <cprintf>:
//PAGEBREAK: 50
// Print to the console. only understands %d, %x, %p, %s.
void
cprintf(char *fmt, ...)
{
801003c6: 55 push %ebp
801003c7: 89 e5 mov %esp,%ebp
801003c9: 83 ec 28 sub $0x28,%esp
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
801003cc: a1 f4 b5 10 80 mov 0x8010b5f4,%eax
801003d1: 89 45 e8 mov %eax,-0x18(%ebp)
if(locking)
801003d4: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
801003d8: 74 10 je 801003ea <cprintf+0x24>
acquire(&cons.lock);
801003da: 83 ec 0c sub $0xc,%esp
801003dd: 68 c0 b5 10 80 push $0x8010b5c0
801003e2: e8 cc 47 00 00 call 80104bb3 <acquire>
801003e7: 83 c4 10 add $0x10,%esp
if (fmt == 0)
801003ea: 8b 45 08 mov 0x8(%ebp),%eax
801003ed: 85 c0 test %eax,%eax
801003ef: 75 0d jne 801003fe <cprintf+0x38>
panic("null fmt");
801003f1: 83 ec 0c sub $0xc,%esp
801003f4: 68 ce 80 10 80 push $0x801080ce
801003f9: e8 68 01 00 00 call 80100566 <panic>
argp = (uint*)(void*)(&fmt + 1);
801003fe: 8d 45 0c lea 0xc(%ebp),%eax
80100401: 89 45 f0 mov %eax,-0x10(%ebp)
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100404: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
8010040b: e9 1a 01 00 00 jmp 8010052a <cprintf+0x164>
if(c != '%'){
80100410: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
80100414: 74 13 je 80100429 <cprintf+0x63>
consputc(c);
80100416: 83 ec 0c sub $0xc,%esp
80100419: ff 75 e4 pushl -0x1c(%ebp)
8010041c: e8 55 03 00 00 call 80100776 <consputc>
80100421: 83 c4 10 add $0x10,%esp
continue;
80100424: e9 fd 00 00 00 jmp 80100526 <cprintf+0x160>
}
c = fmt[++i] & 0xff;
80100429: 8b 55 08 mov 0x8(%ebp),%edx
8010042c: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80100430: 8b 45 f4 mov -0xc(%ebp),%eax
80100433: 01 d0 add %edx,%eax
80100435: 0f b6 00 movzbl (%eax),%eax
80100438: 0f be c0 movsbl %al,%eax
8010043b: 25 ff 00 00 00 and $0xff,%eax
80100440: 89 45 e4 mov %eax,-0x1c(%ebp)
if(c == 0)
80100443: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80100447: 0f 84 ff 00 00 00 je 8010054c <cprintf+0x186>
break;
switch(c){
8010044d: 8b 45 e4 mov -0x1c(%ebp),%eax
80100450: 83 f8 70 cmp $0x70,%eax
80100453: 74 47 je 8010049c <cprintf+0xd6>
80100455: 83 f8 70 cmp $0x70,%eax
80100458: 7f 13 jg 8010046d <cprintf+0xa7>
8010045a: 83 f8 25 cmp $0x25,%eax
8010045d: 0f 84 98 00 00 00 je 801004fb <cprintf+0x135>
80100463: 83 f8 64 cmp $0x64,%eax
80100466: 74 14 je 8010047c <cprintf+0xb6>
80100468: e9 9d 00 00 00 jmp 8010050a <cprintf+0x144>
8010046d: 83 f8 73 cmp $0x73,%eax
80100470: 74 47 je 801004b9 <cprintf+0xf3>
80100472: 83 f8 78 cmp $0x78,%eax
80100475: 74 25 je 8010049c <cprintf+0xd6>
80100477: e9 8e 00 00 00 jmp 8010050a <cprintf+0x144>
case 'd':
printint(*argp++, 10, 1);
8010047c: 8b 45 f0 mov -0x10(%ebp),%eax
8010047f: 8d 50 04 lea 0x4(%eax),%edx
80100482: 89 55 f0 mov %edx,-0x10(%ebp)
80100485: 8b 00 mov (%eax),%eax
80100487: 83 ec 04 sub $0x4,%esp
8010048a: 6a 01 push $0x1
8010048c: 6a 0a push $0xa
8010048e: 50 push %eax
8010048f: e8 83 fe ff ff call 80100317 <printint>
80100494: 83 c4 10 add $0x10,%esp
break;
80100497: e9 8a 00 00 00 jmp 80100526 <cprintf+0x160>
case 'x':
case 'p':
printint(*argp++, 16, 0);
8010049c: 8b 45 f0 mov -0x10(%ebp),%eax
8010049f: 8d 50 04 lea 0x4(%eax),%edx
801004a2: 89 55 f0 mov %edx,-0x10(%ebp)
801004a5: 8b 00 mov (%eax),%eax
801004a7: 83 ec 04 sub $0x4,%esp
801004aa: 6a 00 push $0x0
801004ac: 6a 10 push $0x10
801004ae: 50 push %eax
801004af: e8 63 fe ff ff call 80100317 <printint>
801004b4: 83 c4 10 add $0x10,%esp
break;
801004b7: eb 6d jmp 80100526 <cprintf+0x160>
case 's':
if((s = (char*)*argp++) == 0)
801004b9: 8b 45 f0 mov -0x10(%ebp),%eax
801004bc: 8d 50 04 lea 0x4(%eax),%edx
801004bf: 89 55 f0 mov %edx,-0x10(%ebp)
801004c2: 8b 00 mov (%eax),%eax
801004c4: 89 45 ec mov %eax,-0x14(%ebp)
801004c7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
801004cb: 75 22 jne 801004ef <cprintf+0x129>
s = "(null)";
801004cd: c7 45 ec d7 80 10 80 movl $0x801080d7,-0x14(%ebp)
for(; *s; s++)
801004d4: eb 19 jmp 801004ef <cprintf+0x129>
consputc(*s);
801004d6: 8b 45 ec mov -0x14(%ebp),%eax
801004d9: 0f b6 00 movzbl (%eax),%eax
801004dc: 0f be c0 movsbl %al,%eax
801004df: 83 ec 0c sub $0xc,%esp
801004e2: 50 push %eax
801004e3: e8 8e 02 00 00 call 80100776 <consputc>
801004e8: 83 c4 10 add $0x10,%esp
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
s = "(null)";
for(; *s; s++)
801004eb: 83 45 ec 01 addl $0x1,-0x14(%ebp)
801004ef: 8b 45 ec mov -0x14(%ebp),%eax
801004f2: 0f b6 00 movzbl (%eax),%eax
801004f5: 84 c0 test %al,%al
801004f7: 75 dd jne 801004d6 <cprintf+0x110>
consputc(*s);
break;
801004f9: eb 2b jmp 80100526 <cprintf+0x160>
case '%':
consputc('%');
801004fb: 83 ec 0c sub $0xc,%esp
801004fe: 6a 25 push $0x25
80100500: e8 71 02 00 00 call 80100776 <consputc>
80100505: 83 c4 10 add $0x10,%esp
break;
80100508: eb 1c jmp 80100526 <cprintf+0x160>
default:
// Print unknown % sequence to draw attention.
consputc('%');
8010050a: 83 ec 0c sub $0xc,%esp
8010050d: 6a 25 push $0x25
8010050f: e8 62 02 00 00 call 80100776 <consputc>
80100514: 83 c4 10 add $0x10,%esp
consputc(c);
80100517: 83 ec 0c sub $0xc,%esp
8010051a: ff 75 e4 pushl -0x1c(%ebp)
8010051d: e8 54 02 00 00 call 80100776 <consputc>
80100522: 83 c4 10 add $0x10,%esp
break;
80100525: 90 nop
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100526: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010052a: 8b 55 08 mov 0x8(%ebp),%edx
8010052d: 8b 45 f4 mov -0xc(%ebp),%eax
80100530: 01 d0 add %edx,%eax
80100532: 0f b6 00 movzbl (%eax),%eax
80100535: 0f be c0 movsbl %al,%eax
80100538: 25 ff 00 00 00 and $0xff,%eax
8010053d: 89 45 e4 mov %eax,-0x1c(%ebp)
80100540: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80100544: 0f 85 c6 fe ff ff jne 80100410 <cprintf+0x4a>
8010054a: eb 01 jmp 8010054d <cprintf+0x187>
consputc(c);
continue;
}
c = fmt[++i] & 0xff;
if(c == 0)
break;
8010054c: 90 nop
consputc(c);
break;
}
}
if(locking)
8010054d: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
80100551: 74 10 je 80100563 <cprintf+0x19d>
release(&cons.lock);
80100553: 83 ec 0c sub $0xc,%esp
80100556: 68 c0 b5 10 80 push $0x8010b5c0
8010055b: e8 ba 46 00 00 call 80104c1a <release>
80100560: 83 c4 10 add $0x10,%esp
}
80100563: 90 nop
80100564: c9 leave
80100565: c3 ret
80100566 <panic>:
void
panic(char *s)
{
80100566: 55 push %ebp
80100567: 89 e5 mov %esp,%ebp
80100569: 83 ec 38 sub $0x38,%esp
int i;
uint pcs[10];
cli();
8010056c: e8 9f fd ff ff call 80100310 <cli>
cons.locking = 0;
80100571: c7 05 f4 b5 10 80 00 movl $0x0,0x8010b5f4
80100578: 00 00 00
cprintf("cpu%d: panic: ", cpu->id);
8010057b: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80100581: 0f b6 00 movzbl (%eax),%eax
80100584: 0f b6 c0 movzbl %al,%eax
80100587: 83 ec 08 sub $0x8,%esp
8010058a: 50 push %eax
8010058b: 68 de 80 10 80 push $0x801080de
80100590: e8 31 fe ff ff call 801003c6 <cprintf>
80100595: 83 c4 10 add $0x10,%esp
cprintf(s);
80100598: 8b 45 08 mov 0x8(%ebp),%eax
8010059b: 83 ec 0c sub $0xc,%esp
8010059e: 50 push %eax
8010059f: e8 22 fe ff ff call 801003c6 <cprintf>
801005a4: 83 c4 10 add $0x10,%esp
cprintf("\n");
801005a7: 83 ec 0c sub $0xc,%esp
801005aa: 68 ed 80 10 80 push $0x801080ed
801005af: e8 12 fe ff ff call 801003c6 <cprintf>
801005b4: 83 c4 10 add $0x10,%esp
getcallerpcs(&s, pcs);
801005b7: 83 ec 08 sub $0x8,%esp
801005ba: 8d 45 cc lea -0x34(%ebp),%eax
801005bd: 50 push %eax
801005be: 8d 45 08 lea 0x8(%ebp),%eax
801005c1: 50 push %eax
801005c2: e8 a5 46 00 00 call 80104c6c <getcallerpcs>
801005c7: 83 c4 10 add $0x10,%esp
for(i=0; i<10; i++)
801005ca: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
801005d1: eb 1c jmp 801005ef <panic+0x89>
cprintf(" %p", pcs[i]);
801005d3: 8b 45 f4 mov -0xc(%ebp),%eax
801005d6: 8b 44 85 cc mov -0x34(%ebp,%eax,4),%eax
801005da: 83 ec 08 sub $0x8,%esp
801005dd: 50 push %eax
801005de: 68 ef 80 10 80 push $0x801080ef
801005e3: e8 de fd ff ff call 801003c6 <cprintf>
801005e8: 83 c4 10 add $0x10,%esp
cons.locking = 0;
cprintf("cpu%d: panic: ", cpu->id);
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
for(i=0; i<10; i++)
801005eb: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801005ef: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
801005f3: 7e de jle 801005d3 <panic+0x6d>
cprintf(" %p", pcs[i]);
panicked = 1; // freeze other CPU
801005f5: c7 05 a0 b5 10 80 01 movl $0x1,0x8010b5a0
801005fc: 00 00 00
for(;;)
;
801005ff: eb fe jmp 801005ff <panic+0x99>
80100601 <cgaputc>:
#define CRTPORT 0x3d4
static ushort *crt = (ushort*)P2V(0xb8000); // CGA memory
static void
cgaputc(int c)
{
80100601: 55 push %ebp
80100602: 89 e5 mov %esp,%ebp
80100604: 83 ec 18 sub $0x18,%esp
int pos;
// Cursor position: col + 80*row.
outb(CRTPORT, 14);
80100607: 6a 0e push $0xe
80100609: 68 d4 03 00 00 push $0x3d4
8010060e: e8 de fc ff ff call 801002f1 <outb>
80100613: 83 c4 08 add $0x8,%esp
pos = inb(CRTPORT+1) << 8;
80100616: 68 d5 03 00 00 push $0x3d5
8010061b: e8 b4 fc ff ff call 801002d4 <inb>
80100620: 83 c4 04 add $0x4,%esp
80100623: 0f b6 c0 movzbl %al,%eax
80100626: c1 e0 08 shl $0x8,%eax
80100629: 89 45 f4 mov %eax,-0xc(%ebp)
outb(CRTPORT, 15);
8010062c: 6a 0f push $0xf
8010062e: 68 d4 03 00 00 push $0x3d4
80100633: e8 b9 fc ff ff call 801002f1 <outb>
80100638: 83 c4 08 add $0x8,%esp
pos |= inb(CRTPORT+1);
8010063b: 68 d5 03 00 00 push $0x3d5
80100640: e8 8f fc ff ff call 801002d4 <inb>
80100645: 83 c4 04 add $0x4,%esp
80100648: 0f b6 c0 movzbl %al,%eax
8010064b: 09 45 f4 or %eax,-0xc(%ebp)
if(c == '\n')
8010064e: 83 7d 08 0a cmpl $0xa,0x8(%ebp)
80100652: 75 30 jne 80100684 <cgaputc+0x83>
pos += 80 - pos%80;
80100654: 8b 4d f4 mov -0xc(%ebp),%ecx
80100657: ba 67 66 66 66 mov $0x66666667,%edx
8010065c: 89 c8 mov %ecx,%eax
8010065e: f7 ea imul %edx
80100660: c1 fa 05 sar $0x5,%edx
80100663: 89 c8 mov %ecx,%eax
80100665: c1 f8 1f sar $0x1f,%eax
80100668: 29 c2 sub %eax,%edx
8010066a: 89 d0 mov %edx,%eax
8010066c: c1 e0 02 shl $0x2,%eax
8010066f: 01 d0 add %edx,%eax
80100671: c1 e0 04 shl $0x4,%eax
80100674: 29 c1 sub %eax,%ecx
80100676: 89 ca mov %ecx,%edx
80100678: b8 50 00 00 00 mov $0x50,%eax
8010067d: 29 d0 sub %edx,%eax
8010067f: 01 45 f4 add %eax,-0xc(%ebp)
80100682: eb 34 jmp 801006b8 <cgaputc+0xb7>
else if(c == BACKSPACE){
80100684: 81 7d 08 00 01 00 00 cmpl $0x100,0x8(%ebp)
8010068b: 75 0c jne 80100699 <cgaputc+0x98>
if(pos > 0) --pos;
8010068d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100691: 7e 25 jle 801006b8 <cgaputc+0xb7>
80100693: 83 6d f4 01 subl $0x1,-0xc(%ebp)
80100697: eb 1f jmp 801006b8 <cgaputc+0xb7>
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
80100699: 8b 0d 00 90 10 80 mov 0x80109000,%ecx
8010069f: 8b 45 f4 mov -0xc(%ebp),%eax
801006a2: 8d 50 01 lea 0x1(%eax),%edx
801006a5: 89 55 f4 mov %edx,-0xc(%ebp)
801006a8: 01 c0 add %eax,%eax
801006aa: 01 c8 add %ecx,%eax
801006ac: 8b 55 08 mov 0x8(%ebp),%edx
801006af: 0f b6 d2 movzbl %dl,%edx
801006b2: 80 ce 07 or $0x7,%dh
801006b5: 66 89 10 mov %dx,(%eax)
if((pos/80) >= 24){ // Scroll up.
801006b8: 81 7d f4 7f 07 00 00 cmpl $0x77f,-0xc(%ebp)
801006bf: 7e 4c jle 8010070d <cgaputc+0x10c>
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801006c1: a1 00 90 10 80 mov 0x80109000,%eax
801006c6: 8d 90 a0 00 00 00 lea 0xa0(%eax),%edx
801006cc: a1 00 90 10 80 mov 0x80109000,%eax
801006d1: 83 ec 04 sub $0x4,%esp
801006d4: 68 60 0e 00 00 push $0xe60
801006d9: 52 push %edx
801006da: 50 push %eax
801006db: e8 f5 47 00 00 call 80104ed5 <memmove>
801006e0: 83 c4 10 add $0x10,%esp
pos -= 80;
801006e3: 83 6d f4 50 subl $0x50,-0xc(%ebp)
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801006e7: b8 80 07 00 00 mov $0x780,%eax
801006ec: 2b 45 f4 sub -0xc(%ebp),%eax
801006ef: 8d 14 00 lea (%eax,%eax,1),%edx
801006f2: a1 00 90 10 80 mov 0x80109000,%eax
801006f7: 8b 4d f4 mov -0xc(%ebp),%ecx
801006fa: 01 c9 add %ecx,%ecx
801006fc: 01 c8 add %ecx,%eax
801006fe: 83 ec 04 sub $0x4,%esp
80100701: 52 push %edx
80100702: 6a 00 push $0x0
80100704: 50 push %eax
80100705: e8 0c 47 00 00 call 80104e16 <memset>
8010070a: 83 c4 10 add $0x10,%esp
}
outb(CRTPORT, 14);
8010070d: 83 ec 08 sub $0x8,%esp
80100710: 6a 0e push $0xe
80100712: 68 d4 03 00 00 push $0x3d4
80100717: e8 d5 fb ff ff call 801002f1 <outb>
8010071c: 83 c4 10 add $0x10,%esp
outb(CRTPORT+1, pos>>8);
8010071f: 8b 45 f4 mov -0xc(%ebp),%eax
80100722: c1 f8 08 sar $0x8,%eax
80100725: 0f b6 c0 movzbl %al,%eax
80100728: 83 ec 08 sub $0x8,%esp
8010072b: 50 push %eax
8010072c: 68 d5 03 00 00 push $0x3d5
80100731: e8 bb fb ff ff call 801002f1 <outb>
80100736: 83 c4 10 add $0x10,%esp
outb(CRTPORT, 15);
80100739: 83 ec 08 sub $0x8,%esp
8010073c: 6a 0f push $0xf
8010073e: 68 d4 03 00 00 push $0x3d4
80100743: e8 a9 fb ff ff call 801002f1 <outb>
80100748: 83 c4 10 add $0x10,%esp
outb(CRTPORT+1, pos);
8010074b: 8b 45 f4 mov -0xc(%ebp),%eax
8010074e: 0f b6 c0 movzbl %al,%eax
80100751: 83 ec 08 sub $0x8,%esp
80100754: 50 push %eax
80100755: 68 d5 03 00 00 push $0x3d5
8010075a: e8 92 fb ff ff call 801002f1 <outb>
8010075f: 83 c4 10 add $0x10,%esp
crt[pos] = ' ' | 0x0700;
80100762: a1 00 90 10 80 mov 0x80109000,%eax
80100767: 8b 55 f4 mov -0xc(%ebp),%edx
8010076a: 01 d2 add %edx,%edx
8010076c: 01 d0 add %edx,%eax
8010076e: 66 c7 00 20 07 movw $0x720,(%eax)
}
80100773: 90 nop
80100774: c9 leave
80100775: c3 ret
80100776 <consputc>:
void
consputc(int c)
{
80100776: 55 push %ebp
80100777: 89 e5 mov %esp,%ebp
80100779: 83 ec 08 sub $0x8,%esp