码迷,mamicode.com
首页 > 其他好文 > 详细

调试bootsect和setup和head到main

时间:2014-12-28 22:15:18      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:linux-0.11   调试教程   bootsect.s   setup.s   head.s   

<bochs:1> b 0x0:0x7c00
<bochs:2> c
(0) Breakpoint 1, 0x7c00 in ?? ()
Next at t=16165613
(0) [0x00007c00] 0000:7c00 (unk. ctxt): mov ax, 0x7c0             ; b8c007
<bochs:3> b 0x90200
<bochs:4> c
(0) Breakpoint 2, 0x90200 in ?? ()
Next at t=16396177
(0) [0x00090200] 9020:0000 (unk. ctxt): mov ax, 0x9000            ; b80090
<bochs:5> b 0x00
<bochs:6> c
(0) Breakpoint 3, 0x0 in ?? ()
Next at t=16659024
(0) [0x00000000] 0008:00000000 (unk. ctxt): mov eax, 0x10             ; b810000000
<bochs:7> u
00000000: (                    ): mov eax, 0x10             ; b810000000
<bochs:8> b 0x5400
<bochs:9> c
(0) Breakpoint 4, 0x5400 in ?? ()
Next at t=16660345
(0) [0x00005400] 0008:00005400 (unk. ctxt): push 0x0                  ; 6a00

<bochs:12> u /10
00005400: (                    ): push 0x0                  ; 6a00
00005402: (                    ): push 0x0                  ; 6a00
00005404: (                    ): push 0x0                  ; 6a00
00005406: (                    ): push 0x5412               ; 6812540000
0000540b: (                    ): push 0x664c               ; 684c660000
00005410: (                    ): jmp 0x5450                ; eb3e
00005412: (                    ): jmp 0x5412                ; ebfe
00005414: (                    ): push ebp                  ; 55
00005415: (                    ): outsb dx, byte ptr [esi]  ; 6e
00005416: (                    ): imul ebp, dword ptr ds:[esi+0x6f], 0x77 ; 6b6e6f77
<bochs:13> b 0x5450
<bochs:14> c
(0) Breakpoint 5, 0x5450 in ?? ()
Next at t=16660351
(0) [0x00005450] 0008:00005450 (unk. ctxt): mov ecx, 0x1400           ; b900140000


<bochs:17> u /30
00005450: (                    ): mov ecx, 0x1400           ; b900140000
00005455: (                    ): xor eax, eax              ; 31c0
00005457: (                    ): xor edi, edi              ; 31ff
00005459: (                    ): cld                       ; fc
0000545a: (                    ): rep stos dword ptr [edi], eax ; f3ab
0000545c: (                    ): mov dword ptr [ds:0x0], 0x1007 ; c7050000000007100000
00005466: (                    ): mov dword ptr [ds:0x4], 0x2007 ; c7050400000007200000
00005470: (                    ): mov dword ptr [ds:0x8], 0x3007 ; c7050800000007300000
0000547a: (                    ): mov dword ptr [ds:0xc], 0x4007 ; c7050c00000007400000
00005484: (                    ): mov edi, 0x4ffc           ; bffc4f0000
00005489: (                    ): mov eax, 0xfff007         ; b807f0ff00
0000548e: (                    ): std                       ; fd
0000548f: (                    ): stos dword ptr [edi], eax ; ab
00005490: (                    ): sub eax, 0x1000           ; 2d00100000
00005495: (                    ): jnl 0x548f                ; 7df8
00005497: (                    ): xor eax, eax              ; 31c0
00005499: (                    ): mov cr3, eax              ; 0f22d8
0000549c: (                    ): mov eax, cr0              ; 0f20c0
0000549f: (                    ): or eax, 0x80000000        ; 0d00000080
000054a4: (                    ): mov cr0, eax              ; 0f22c0
000054a7: (                    ): retn                      ; c3
000054a8: (                    ): add byte ptr ds:[eax], al ; 0000
000054aa: (                    ): inc dword ptr ds:[edi]    ; ff07
000054ac: (                    ): mov eax, 0x54             ; b854000000
000054b1: (                    ): add bh, bh                ; 00ff
000054b3: (                    ): pop es                    ; 07
000054b4: (                    ): mov eax, 0x2800005c       ; b85c000028
000054b9: (                    ): push esp                  ; 54
000054ba: (                    ): or byte ptr ds:[eax], al  ; 0800
000054bc: (                    ): add byte ptr ds:[esi+0x54280000], cl ; 008e00002854
<bochs:18> b 0x54a7
<bochs:19> c
(0) Breakpoint 6, 0x54a7 in ?? ()
Next at t=16677775
(0) [0x000054a7] 0008:000054a7 (unk. ctxt): retn                      ; c3
<bochs:20> s
Next at t=16677776
(0) [0x0000664c] 0008:0000664c (unk. ctxt): push ebp                  ; 55
<bochs:21> u /20
0000664c: (                    ): push ebp                  ; 55
0000664d: (                    ): mov ebp, esp              ; 89e5
0000664f: (                    ): movzx ecx, word ptr [ds:0x901fc] ; 0fb70dfc010900
00006656: (                    ): mov dword ptr [ds:0x1a964], ecx ; 890d64a90100
0000665c: (                    ): mov eax, 0x90080          ; b880000900
00006661: (                    ): mov edx, 0x1dd6c          ; ba6cdd0100
00006666: (                    ): mov ecx, dword ptr ds:[eax] ; 8b08
00006668: (                    ): mov dword ptr ds:[edx], ecx ; 890a
0000666a: (                    ): mov ecx, dword ptr ds:[eax+0x4] ; 8b4804
0000666d: (                    ): mov dword ptr ds:[edx+0x4], ecx ; 894a04
00006670: (                    ): mov ecx, dword ptr ds:[eax+0x8] ; 8b4808
00006673: (                    ): mov dword ptr ds:[edx+0x8], ecx ; 894a08
00006676: (                    ): mov ecx, dword ptr ds:[eax+0xc] ; 8b480c
00006679: (                    ): mov dword ptr ds:[edx+0xc], ecx ; 894a0c
0000667c: (                    ): mov ecx, dword ptr ds:[eax+0x10] ; 8b4810
0000667f: (                    ): mov dword ptr ds:[edx+0x10], ecx ; 894a10
00006682: (                    ): mov ecx, dword ptr ds:[eax+0x14] ; 8b4814
00006685: (                    ): mov dword ptr ds:[edx+0x14], ecx ; 894a14
00006688: (                    ): mov ecx, dword ptr ds:[eax+0x18] ; 8b4818
0000668b: (                    ): mov dword ptr ds:[edx+0x18], ecx ; 894a18
<bochs:22>

调试bootsect和setup和head到main

标签:linux-0.11   调试教程   bootsect.s   setup.s   head.s   

原文地址:http://blog.csdn.net/oldlinux/article/details/42219055

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!