shoelace源代码分析,bochs调试过程,setup.s 中do_move

<bochs:1> b 0x90200
<bochs:2> c
(0) Breakpoint 1, 0x90200 in ?? ()
Next at t=78352693
(0) [0x00090200] 9020:0000 (unk. ctxt): mov ax, 0x9000            ; b80090
<bochs:3> u /100
00090200: (                    ): mov ax, 0x9000            ; b80090
00090203: (                    ): mov ds, ax                ; 8ed8
00090205: (                    ): mov ah, 0x3               ; b403
00090207: (                    ): xor bh, bh                ; 30ff
00090209: (                    ): int 0x10                  ; cd10
0009020b: (                    ): mov word ptr [ds:0x0], dx ; 89160000


<bochs:4> b 0x90281
<bochs:5> c
(0) Breakpoint 2, 0x90281 in ?? ()
Next at t=78357376
(0) [0x00090281] 9020:0081 (unk. ctxt): mov es, ax                ; 8ec0
<bochs:6> x 10 0x10000
C:\Program Files\Bochs-2.1.1\bochsdbg:6: syntax error at '0x10000'
<bochs:7> x /10 0x10000
[bochs]:
0x00010000 <bogus+       0>:    0x000010b8      0x8ed88e00      0x8ee08ec0      0x25b20fe8
0x00010010 <bogus+      16>:    0x000192a4      0x000056e8      0x0081e800      0x10b80000
0x00010020 <bogus+      32>:    0x8e000000      0x8ec08ed8
<bochs:8> x /10 0x0000
[bochs]:
0x00000000 <bogus+       0>:    0xf000ff53      0xf000ff53      0xf000ff53      0xf000ff53
0x00000010 <bogus+      16>:    0xf000ff53      0xf000ff53      0xf000ff53      0xf000ff53
0x00000020 <bogus+      32>:    0xf000fea5      0xf000e987
<bochs:9> b 0x90298
<bochs:10> c
(0) Breakpoint 2, 0x90281 in ?? ()
Next at t=78390153
(0) [0x00090281] 9020:0081 (unk. ctxt): mov es, ax                ; 8ec0
<bochs:11> x /10 0x0000
[bochs]:
0x00000000 <bogus+       0>:    0x000010b8      0x8ed88e00      0x8ee08ec0      0x25b20fe8
0x00000010 <bogus+      16>:    0x000192a4      0x000056e8      0x0081e800      0x10b80000
0x00000020 <bogus+      32>:    0x8e000000      0x8ec08ed8

<bochs:12>


在0x90281既是do_move处下断点,此时0x10000处有system,0x0处没有。

do_move之后,0x0处有了system。下面是对应的do_move的代码。


00090281: (                    ): mov es, ax                ; 8ec0
00090283: (                    ): add ax, 0x1000            ; 050010
00090286: (                    ): cmp ax, 0x9000            ; 3d0090
00090289: (                    ): jz 0x298                  ; 740d
0009028b: (                    ): mov ds, ax                ; 8ed8
0009028d: (                    ): sub di, di                ; 29ff
0009028f: (                    ): sub si, si                ; 29f6
00090291: (                    ): mov cx, 0x8000            ; b90080
00090294: (                    ): rep movs word ptr [di], word ptr [si] ; f3a5
00090296: (                    ): jmp 0x281                 ; ebe9

00090298: (                    ): mov ax, 0x9020            ; b82090
0009029b: (                    ): mov ds, ax                ; 8ed8
0009029d: (                    ): lidt [ds:0x12c]           ; 0f011e2c01
000902a2: (                    ): lgdt [ds:0x132]           ; 0f01163201
000902a7: (                    ): call 0x309                ; e85f00



dozones()函数地址    0x64327

scanzone()函数地址           0x62518


<bochs:10> b 0x62518
<bochs:11> c
(0) Breakpoint 2, 0x62518 in ?? ()
Next at t=37613377
(0) [0x00062518] 6000:2518 (unk. ctxt): push bp                   ; 55
<bochs:12> info r
eax            0x0              0
ecx            0xd0000          851968
edx            0x84d8           34008
ebx            0xdbf6           56310
esp            0xdbc2           0xdbc2
ebp            0xdbd6           0xdbd6
esi            0x771            1905
edi            0x84d8           34008
eip            0x2518           0x2518
eflags         0x2c6            710
cs             0x6000           24576
ss             0x6000           24576
ds             0x6000           24576
es             0x6000           24576
fs             0x0              0
gs             0x0              0
<bochs:13> x /10 0x6dbc2
[bochs]:
0x0006dbc2 <bogus+       0>:    0xdbf6434b      0x00070000      0x000025b2

你可能感兴趣的:(shoelace源代码分析,bochs调试过程,setup.s 中do_move)