实模式跳转到保护模式,在保护模式打印一个字符串。

本文档记录了从实模式切换到保护模式过程中遇到的问题,主要是在保护模式下执行lodsb指令后触发错误,错误信息显示为门描述符无效。调试结果显示CPU处于保护模式,且涉及的数据段、指令和寄存器状态被详细列出。作者计划进一步分析并解决问题。
摘要由CSDN通过智能技术生成

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

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值