#include <stdio.h>
struct {
unsigned short limit;
unsigned int base;
} __attribute__ ((packed)) idtr;
int main(int argc, char * argv[])
{
asm ("sidt %0" : "=m" (idtr));
printf("IDTR base=0x%X limit=0x%X\n",(int)idtr.base, (int)idtr.limit);
}
2008年11月04日
[仮想化] GCCのインラインアセンブラからSIDT命令を実行 (Red Pillを実行)
Red Pillの方式でやると,セグメンテーション違反を起こす事があるので,インラインアセンブラから実行する方法.
この記事へのコメント
コメントを書く
この記事へのトラックバック

