作者lungswu (啊啊啊啊啊啊啊啊啊啊啊)
看板LinuxDev
标题Re: [问题] debugger
时间Fri May 2 21:19:36 2008
现在的X86 CPU执行模式可分为real mode, preotect mode
X86 CPU会有real mode是为了跟古早前8086/8088相容而设计出来。
所以古早的DOS还能在现代的X86系列PC上执行。
286之後而有portect mode,利用MMU实践virtual memory及process间的独立。
IA-32时代之後,protect mode下更细分为ring 0,1,2,3
就X86 PC版Linux而言,只要Linux一执行就已经进入protect mode。
一般AP於protect mode的ring3下执行,kernel mode於protect mode的ring 0下执行。
ring 1,2现在反而很少用(或者没用到)。
以上是嘴炮讲古,离我的记忆有些久远,有错误烦请纠正。
至於要trace linux kernel,如果经济上可以,建议:
还不如买个ARM系列的版子加上ICE,更可以轻松的了解Linux kernel。
※ 引述《n3oanderson (T. J.)》之铭言:
: I assume you are going to debug kernel, for GNU/ Linux is not 'real mode'
: only. User space programme runs in protected mode whereas kernel in real mode
: ( So far as I known). To debug kernel, there are several options you can
: choose, including kprobe, kgdb and kdb. Each has their own advantage. You can
: have a look it online.
: ※ 引述《SILee (打卡上班的日子)》之铭言:
: : 作者: SILee (打卡上班的日子) 看板: ASM
: : 标题: [问题] debugger
: : 时间: Thu Apr 10 22:38:57 2008
: : 请问在Linux下有支援real mode program的x86 debugger或emulator吗?
: : GDB似乎无法run real mode program
: : 目前我都只能用VirtualBox看程式跑出来的结果对不对
: : 但是没办法直接看到register和memory的值实在很麻烦
: : thanks!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.73.175.18
1F:→ final01:有那麽轻松吗!! XD 05/03 01:38
2F:→ iincho:这要很多银弹才行啊..XD 05/06 11:42
3F:推 Bencrie:印象中386才有Protected mode,286好像不太完整。 05/15 15:26