COM文件调试;实模式跳转到保护模式,在保护模式打印一个字符串。
调试结果是:
单步执行到保护模式下的打印字符串,当执行完lodsb后一句时,出现出错提示。
请看错误提示:
<bochs:17>
Next at t=106268085
(0) [0x00032484] 0018:0000001c (unk. ctxt): cld ; fc
<bochs:18>
Next at t=106268086
(0) [0x00032485] 0018:0000001d (unk. ctxt): lodsb al, byte ptr ds:[esi] ; ac
<bochs:19>
00106268086e[CPU0 ] read_virtual_checks(): read beyond limit
00106268086e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00106268086e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
00106268086i[CPU0 ] CPU is in protected mode (active)
00106268086i[CPU0 ] CS.d_b = 32 bit
00106268086i[CPU0 ] SS.d_b = 16 bit
00106268086i[CPU0 ] | EAX=60000c28 EBX=00000000 ECX=00090000 EDX=00000000
00106268086i[CPU0 ] | ESP=00000100 EBP=00000000 ESI=00000103 EDI=000001e4
00106268086i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf ZF af PF cf
00106268086i[CPU0 ] | SEG selector base limit G D
00106268086i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00106268086i[CPU0 ] | CS:0018( 0003| 0| 0) 00032468 0000003c 0 1
00106268086i[CPU0 ] | DS:0020( 0004| 0| 0) 00000000 00000035 0 0
00106268086i[CPU0 ] | SS:3224( 0005| 0| 0) 00032240 0000ffff 0 0
00106268086i[CPU0 ] | ES:3224( 0005| 0| 0) 00032240 0000ffff 0 0
00106268086i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00106268086i[CPU0 ] | GS:0028( 0005| 0| 0) 000b8000 0000ffff 0 0
00106268086i[CPU0 ] | EIP=0000001d (0000001d)
00106268086i[CPU0 ] | CR0=0x60000011 CR2=0x00000000
00106268086i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
(0).[106268086] [0x00032485] 0018:0000001d (unk. ctxt): lodsb al, byte ptr ds:[esi] ; ac
00106268086e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
00106268086i[SYS ] bx_pc_s