Windows実行可能ファイルがSYSENTERを利用し、AMD64 ISAを実装するプロセッサで実行された場合、どうなりますか?私はこのトピック(OS、ハードウェア/ソフトウェアの相互作用)の初心者でも初心者でもありますが、読んだことから、SYSCALLはIntelのSYSENTERと同等のAMD64であることがわかりました。うまくいけば、この質問は理にかなっています。
3 に答える
サポートされていない場所でSYSENTERを使用しようとすると、「無効なオペコード」例外が発生する可能性があります。この状況は異常であることに注意してください。通常、Windows実行可能ファイルにはカーネルモードに入る命令が直接含まれていません。
They got rid of a bunch of unused functionality when they developed AMD64 extensions. One of the main ones is the elimination of the cs, ds, es, and ss segment registers. Normally loading segment registers is an extremely expensive operation (the CPU has to do permission checks, which could involve multiple memory accesses). Entering kernel mode requires loading new segment register values.
The SYSENTER instruction accelerates this by having a set of "shadow registers" which is can copy directly to the (internal, hidden) segment descriptors without doing any permission checks. The vast majority of the benefit is lost with only a couple of segment registers, so most likely the reasoning for removing the support for the instructions is that using regular instructions for the mode switch is faster.
私の知る限り、AM64プロセッサは、このような問題を処理するためにさまざまなタイプのモードを使用しています。
SYSENTERは正常に動作しますが、それほど高速ではありません。
さまざまなモードについて始めるのに非常に便利なサイト: ウィキペディア