Skip to content

Instantly share code, notes, and snippets.

@lovesegfault
Created August 30, 2016 22:28
Show Gist options
  • Select an option

  • Save lovesegfault/149914d0497a41b9f9be89fa308455ab to your computer and use it in GitHub Desktop.

Select an option

Save lovesegfault/149914d0497a41b9f9be89fa308455ab to your computer and use it in GitHub Desktop.
build/x86_64/DaedalOS-x86_64.bin: file format elf64-x86-64
Disassembly of section .text:
0000000000100000 <header_start>:
100000: d6 (bad)
100001: 50 push %rax
100002: 52 push %rdx
100003: e8 00 00 00 00 callq 100008 <header_start+0x8>
100008: 18 00 sbb %al,(%rax)
10000a: 00 00 add %al,(%rax)
10000c: 12 af ad 17 00 00 adc 0x17ad(%rdi),%ch
100012: 00 00 add %al,(%rax)
100014: 08 00 or %al,(%rax)
...
0000000000100018 <header_end>:
100018: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
10001f: 00
0000000000100020 <make_color>:
100020: 89 f0 mov %esi,%eax
100022: c1 e0 04 shl $0x4,%eax
100025: 09 f8 or %edi,%eax
100027: c3 retq
100028: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
10002f: 00
0000000000100030 <make_vgaentry>:
100030: 89 f0 mov %esi,%eax
100032: 66 40 0f be ff movsbw %dil,%di
100037: c1 e0 08 shl $0x8,%eax
10003a: 09 f8 or %edi,%eax
10003c: c3 retq
10003d: 0f 1f 00 nopl (%rax)
0000000000100040 <strlen>:
100040: 31 c0 xor %eax,%eax
100042: 80 3f 00 cmpb $0x0,(%rdi)
100045: 74 15 je 10005c <strlen+0x1c>
100047: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
10004e: 00 00
100050: 48 83 c0 01 add $0x1,%rax
100054: 80 3c 07 00 cmpb $0x0,(%rdi,%rax,1)
100058: 75 f6 jne 100050 <strlen+0x10>
10005a: f3 c3 repz retq
10005c: f3 c3 repz retq
10005e: 66 90 xchg %ax,%ax
0000000000100060 <terminal_initialize>:
100060: 48 c7 05 ed 4f 00 00 movq $0x0,0x4fed(%rip) # 105058 <terminal_row>
100067: 00 00 00 00
10006b: 48 c7 05 d2 4f 00 00 movq $0x0,0x4fd2(%rip) # 105048 <terminal_column>
100072: 00 00 00 00
100076: b8 00 80 0b 00 mov $0xb8000,%eax
10007b: c6 05 be 4f 00 00 07 movb $0x7,0x4fbe(%rip) # 105040 <terminal_color>
100082: 48 c7 05 c3 4f 00 00 movq $0xb8000,0x4fc3(%rip) # 105050 <terminal_buffer>
100089: 00 80 0b 00
10008d: 0f 1f 00 nopl (%rax)
100090: 48 8d 90 a0 00 00 00 lea 0xa0(%rax),%rdx
100097: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
10009e: 00 00
1000a0: b9 20 07 00 00 mov $0x720,%ecx
1000a5: 48 83 c0 02 add $0x2,%rax
1000a9: 66 89 48 fe mov %cx,-0x2(%rax)
1000ad: 48 39 d0 cmp %rdx,%rax
1000b0: 75 ee jne 1000a0 <terminal_initialize+0x40>
1000b2: 48 3d a0 8f 0b 00 cmp $0xb8fa0,%rax
1000b8: 75 d6 jne 100090 <terminal_initialize+0x30>
1000ba: f3 c3 repz retq
1000bc: 0f 1f 40 00 nopl 0x0(%rax)
00000000001000c0 <terminal_setcolor>:
1000c0: 40 88 3d 79 4f 00 00 mov %dil,0x4f79(%rip) # 105040 <terminal_color>
1000c7: c3 retq
1000c8: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
1000cf: 00
00000000001000d0 <terminal_putentryat>:
1000d0: 48 8d 04 89 lea (%rcx,%rcx,4),%rax
1000d4: c1 e6 08 shl $0x8,%esi
1000d7: 66 40 0f be ff movsbw %dil,%di
1000dc: 09 fe or %edi,%esi
1000de: 48 c1 e0 04 shl $0x4,%rax
1000e2: 48 01 c2 add %rax,%rdx
1000e5: 48 8b 05 64 4f 00 00 mov 0x4f64(%rip),%rax # 105050 <terminal_buffer>
1000ec: 66 89 34 50 mov %si,(%rax,%rdx,2)
1000f0: c3 retq
1000f1: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
1000f6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
1000fd: 00 00 00
0000000000100100 <terminal_scroll>:
100100: 48 8b 3d 49 4f 00 00 mov 0x4f49(%rip),%rdi # 105050 <terminal_buffer>
100107: 41 b8 50 00 00 00 mov $0x50,%r8d
10010d: 48 c7 c6 60 ff ff ff mov $0xffffffffffffff60,%rsi
100114: 48 8d 87 a0 00 00 00 lea 0xa0(%rdi),%rax
10011b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
100120: 48 8d 88 a0 00 00 00 lea 0xa0(%rax),%rcx
100127: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
10012e: 00 00
100130: 0f b7 10 movzwl (%rax),%edx
100133: 48 83 c0 02 add $0x2,%rax
100137: 66 89 54 30 fe mov %dx,-0x2(%rax,%rsi,1)
10013c: 48 39 c8 cmp %rcx,%rax
10013f: 75 ef jne 100130 <terminal_scroll+0x30>
100141: 49 83 c0 50 add $0x50,%r8
100145: 49 81 f8 d0 07 00 00 cmp $0x7d0,%r8
10014c: 75 d2 jne 100120 <terminal_scroll+0x20>
10014e: 0f b6 0d eb 4e 00 00 movzbl 0x4eeb(%rip),%ecx # 105040 <terminal_color>
100155: 48 8d 87 00 0f 00 00 lea 0xf00(%rdi),%rax
10015c: 48 8d 97 a0 0f 00 00 lea 0xfa0(%rdi),%rdx
100163: c1 e1 08 shl $0x8,%ecx
100166: 83 c9 20 or $0x20,%ecx
100169: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
100170: 66 89 08 mov %cx,(%rax)
100173: 48 83 c0 02 add $0x2,%rax
100177: 48 39 c2 cmp %rax,%rdx
10017a: 75 f4 jne 100170 <terminal_scroll+0x70>
10017c: 48 c7 05 d1 4e 00 00 movq $0x18,0x4ed1(%rip) # 105058 <terminal_row>
100183: 18 00 00 00
100187: 48 c7 05 b6 4e 00 00 movq $0x0,0x4eb6(%rip) # 105048 <terminal_column>
10018e: 00 00 00 00
100192: c3 retq
100193: 0f 1f 00 nopl (%rax)
100196: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
10019d: 00 00 00
00000000001001a0 <terminal_putchar>:
1001a0: 40 80 ff 0a cmp $0xa,%dil
1001a4: 74 6a je 100210 <terminal_putchar+0x70>
1001a6: 48 8b 0d ab 4e 00 00 mov 0x4eab(%rip),%rcx # 105058 <terminal_row>
1001ad: 0f b6 35 8c 4e 00 00 movzbl 0x4e8c(%rip),%esi # 105040 <terminal_color>
1001b4: 66 40 0f be ff movsbw %dil,%di
1001b9: 48 8b 15 88 4e 00 00 mov 0x4e88(%rip),%rdx # 105048 <terminal_column>
1001c0: 48 8d 04 89 lea (%rcx,%rcx,4),%rax
1001c4: c1 e6 08 shl $0x8,%esi
1001c7: 09 f7 or %esi,%edi
1001c9: 48 c1 e0 04 shl $0x4,%rax
1001cd: 48 8b 35 7c 4e 00 00 mov 0x4e7c(%rip),%rsi # 105050 <terminal_buffer>
1001d4: 48 01 d0 add %rdx,%rax
1001d7: 48 83 c2 01 add $0x1,%rdx
1001db: 48 83 fa 50 cmp $0x50,%rdx
1001df: 66 89 3c 46 mov %di,(%rsi,%rax,2)
1001e3: 74 0b je 1001f0 <terminal_putchar+0x50>
1001e5: 48 89 15 5c 4e 00 00 mov %rdx,0x4e5c(%rip) # 105048 <terminal_column>
1001ec: c3 retq
1001ed: 0f 1f 00 nopl (%rax)
1001f0: 48 83 c1 01 add $0x1,%rcx
1001f4: 48 c7 05 49 4e 00 00 movq $0x0,0x4e49(%rip) # 105048 <terminal_column>
1001fb: 00 00 00 00
1001ff: 48 83 f9 19 cmp $0x19,%rcx
100203: 48 89 0d 4e 4e 00 00 mov %rcx,0x4e4e(%rip) # 105058 <terminal_row>
10020a: 74 27 je 100233 <terminal_putchar+0x93>
10020c: f3 c3 repz retq
10020e: 66 90 xchg %ax,%ax
100210: 48 8b 05 41 4e 00 00 mov 0x4e41(%rip),%rax # 105058 <terminal_row>
100217: 48 c7 05 26 4e 00 00 movq $0x0,0x4e26(%rip) # 105048 <terminal_column>
10021e: 00 00 00 00
100222: 48 83 c0 01 add $0x1,%rax
100226: 48 83 f8 19 cmp $0x19,%rax
10022a: 48 89 05 27 4e 00 00 mov %rax,0x4e27(%rip) # 105058 <terminal_row>
100231: 75 d9 jne 10020c <terminal_putchar+0x6c>
100233: 31 c0 xor %eax,%eax
100235: e9 c6 fe ff ff jmpq 100100 <terminal_scroll>
10023a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
0000000000100240 <terminal_writestring>:
100240: 31 c0 xor %eax,%eax
100242: 80 3f 00 cmpb $0x0,(%rdi)
100245: 74 33 je 10027a <terminal_writestring+0x3a>
100247: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
10024e: 00 00
100250: 48 83 c0 01 add $0x1,%rax
100254: 80 3c 07 00 cmpb $0x0,(%rdi,%rax,1)
100258: 75 f6 jne 100250 <terminal_writestring+0x10>
10025a: 4c 8d 14 07 lea (%rdi,%rax,1),%r10
10025e: 49 89 f9 mov %rdi,%r9
100261: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
100268: 41 0f be 39 movsbl (%r9),%edi
10026c: e8 2f ff ff ff callq 1001a0 <terminal_putchar>
100271: 49 83 c1 01 add $0x1,%r9
100275: 4d 39 ca cmp %r9,%r10
100278: 75 ee jne 100268 <terminal_writestring+0x28>
10027a: f3 c3 repz retq
10027c: 0f 1f 40 00 nopl 0x0(%rax)
0000000000100280 <kernel_main>:
100280: 53 push %rbx
100281: b8 00 80 0b 00 mov $0xb8000,%eax
100286: 48 83 ec 10 sub $0x10,%rsp
10028a: 48 c7 05 c3 4d 00 00 movq $0x0,0x4dc3(%rip) # 105058 <terminal_row>
100291: 00 00 00 00
100295: 48 c7 05 a8 4d 00 00 movq $0x0,0x4da8(%rip) # 105048 <terminal_column>
10029c: 00 00 00 00
1002a0: c6 05 99 4d 00 00 07 movb $0x7,0x4d99(%rip) # 105040 <terminal_color>
1002a7: 48 c7 05 9e 4d 00 00 movq $0xb8000,0x4d9e(%rip) # 105050 <terminal_buffer>
1002ae: 00 80 0b 00
1002b2: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
1002b8: 48 8d 90 a0 00 00 00 lea 0xa0(%rax),%rdx
1002bf: 90 nop
1002c0: b9 20 07 00 00 mov $0x720,%ecx
1002c5: 48 83 c0 02 add $0x2,%rax
1002c9: 66 89 48 fe mov %cx,-0x2(%rax)
1002cd: 48 39 c2 cmp %rax,%rdx
1002d0: 75 ee jne 1002c0 <kernel_main+0x40>
1002d2: 48 81 fa a0 8f 0b 00 cmp $0xb8fa0,%rdx
1002d9: 75 dd jne 1002b8 <kernel_main+0x38>
1002db: bb 03 00 00 00 mov $0x3,%ebx
1002e0: 41 bb 41 00 00 00 mov $0x41,%r11d
1002e6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
1002ed: 00 00 00
1002f0: 48 89 e7 mov %rsp,%rdi
1002f3: 44 88 1c 24 mov %r11b,(%rsp)
1002f7: c6 44 24 01 0a movb $0xa,0x1(%rsp)
1002fc: c6 44 24 02 00 movb $0x0,0x2(%rsp)
100301: e8 3a ff ff ff callq 100240 <terminal_writestring>
100306: 41 83 c3 01 add $0x1,%r11d
10030a: 41 80 fb 7b cmp $0x7b,%r11b
10030e: 75 e0 jne 1002f0 <kernel_main+0x70>
100310: 83 eb 01 sub $0x1,%ebx
100313: 75 cb jne 1002e0 <kernel_main+0x60>
100315: 48 83 c4 10 add $0x10,%rsp
100319: 5b pop %rbx
10031a: c3 retq
10031b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
0000000000100320 <long_mode_start>:
100320: e8 5b ff ff ff callq 100280 <kernel_main>
100325: fa cli
100326: f4 hlt
100327: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
10032e: 00 00
0000000000100330 <start>:
100330: bc 40 50 10 00 mov $0x105040,%esp
100335: e8 b7 00 00 00 callq 1003f1 <check_multiboot>
10033a: e8 be 00 00 00 callq 1003fd <check_cpuid>
10033f: e8 d1 00 00 00 callq 100415 <check_long_mode>
100344: e8 1d 00 00 00 callq 100366 <set_up_page_tables>
100349: e8 54 00 00 00 callq 1003a2 <enable_paging>
10034e: 0f 01 15 18 10 10 00 lgdt 0x101018(%rip) # 20136d <terminal_row+0xfc315>
100355: 66 b8 10 00 mov $0x10,%ax
100359: 8e d0 mov %eax,%ss
10035b: 8e d8 mov %eax,%ds
10035d: 8e c0 mov %eax,%es
10035f: ea (bad)
100360: 20 03 and %al,(%rbx)
100362: 10 00 adc %al,(%rax)
100364: 08 00 or %al,(%rax)
0000000000100366 <set_up_page_tables>:
100366: b8 00 30 10 00 mov $0x103000,%eax
10036b: 83 c8 03 or $0x3,%eax
10036e: a3 00 20 10 00 b8 00 movabs %eax,0x104000b800102000
100375: 40 10
100377: 00 83 c8 03 a3 00 add %al,0xa303c8(%rbx)
10037d: 30 10 xor %dl,(%rax)
10037f: 00 b9 00 00 00 00 add %bh,0x0(%rcx)
0000000000100385 <set_up_page_tables.map_p2_table>:
100385: b8 00 00 20 00 mov $0x200000,%eax
10038a: f7 e1 mul %ecx
10038c: 0d 83 00 00 00 or $0x83,%eax
100391: 89 04 cd 00 40 10 00 mov %eax,0x104000(,%rcx,8)
100398: 41 81 f9 00 02 00 00 cmp $0x200,%r9d
10039f: 75 e4 jne 100385 <set_up_page_tables.map_p2_table>
1003a1: c3 retq
00000000001003a2 <enable_paging>:
1003a2: b8 00 20 10 00 mov $0x102000,%eax
1003a7: 0f 22 d8 mov %rax,%cr3
1003aa: 0f 20 e0 mov %cr4,%rax
1003ad: 83 c8 20 or $0x20,%eax
1003b0: 0f 22 e0 mov %rax,%cr4
1003b3: b9 80 00 00 c0 mov $0xc0000080,%ecx
1003b8: 0f 32 rdmsr
1003ba: 0d 00 01 00 00 or $0x100,%eax
1003bf: 0f 30 wrmsr
1003c1: 0f 20 c0 mov %cr0,%rax
1003c4: 0d 00 00 00 80 or $0x80000000,%eax
1003c9: 0f 22 c0 mov %rax,%cr0
1003cc: c3 retq
00000000001003cd <error>:
1003cd: c7 05 00 80 0b 00 45 movl $0x4f524f45,0xb8000(%rip) # 1b83d7 <terminal_row+0xb337f>
1003d4: 4f 52 4f
1003d7: c7 05 04 80 0b 00 52 movl $0x4f3a4f52,0xb8004(%rip) # 1b83e5 <terminal_row+0xb338d>
1003de: 4f 3a 4f
1003e1: c7 05 08 80 0b 00 20 movl $0x4f204f20,0xb8008(%rip) # 1b83f3 <terminal_row+0xb339b>
1003e8: 4f 20 4f
1003eb: a2 .byte 0xa2
1003ec: 0a .byte 0xa
1003ed: 80 0b 00 orb $0x0,(%rbx)
1003f0: f4 hlt
00000000001003f1 <check_multiboot>:
1003f1: 3d 89 62 d7 36 cmp $0x36d76289,%eax
1003f6: 75 01 jne 1003f9 <check_multiboot.no_multiboot>
1003f8: c3 retq
00000000001003f9 <check_multiboot.no_multiboot>:
1003f9: b0 30 mov $0x30,%al
1003fb: eb d0 jmp 1003cd <error>
00000000001003fd <check_cpuid>:
1003fd: 9c pushfq
1003fe: 58 pop %rax
1003ff: 89 c1 mov %eax,%ecx
100401: 35 00 00 20 00 xor $0x200000,%eax
100406: 50 push %rax
100407: 9d popfq
100408: 9c pushfq
100409: 58 pop %rax
10040a: 51 push %rcx
10040b: 9d popfq
10040c: 39 c8 cmp %ecx,%eax
10040e: 74 01 je 100411 <check_cpuid.no_cpuid>
100410: c3 retq
0000000000100411 <check_cpuid.no_cpuid>:
100411: b0 31 mov $0x31,%al
100413: eb b8 jmp 1003cd <error>
0000000000100415 <check_long_mode>:
100415: b8 00 00 00 80 mov $0x80000000,%eax
10041a: 0f a2 cpuid
10041c: 3d 01 00 00 80 cmp $0x80000001,%eax
100421: 72 10 jb 100433 <check_long_mode.no_long_mode>
100423: b8 01 00 00 80 mov $0x80000001,%eax
100428: 0f a2 cpuid
10042a: f7 c2 00 00 00 20 test $0x20000000,%edx
100430: 74 01 je 100433 <check_long_mode.no_long_mode>
100432: c3 retq
0000000000100433 <check_long_mode.no_long_mode>:
100433: b0 32 mov $0x32,%al
100435: eb 96 jmp 1003cd <error>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment