0

私はいつもレジスターをCPU registers. 他のデバイスまたはハードウェアにも、デコーダ ハードウェア、ディスプレイ デバイス、DMA コントローラなどの独自のレジスタがありますか?

もしそうなら、それらのデバイスレジスタに保存されている値は、必要な場合にどのように cpu レジスタに渡されinstruction executionますか? 可能であれば、実際の例で説明してもらえますか?

4

2 に答える 2

2

Some devices have dedicated registers and others don't. Some of those other ones have register-like components that get lumped into the "register" category even though they shouldn't really be there.

I/O between the device and the rest of the system can happen in a number of ways, including port based IO (a system similar to, but seperate from, typical memory access), memory based IO (use of specific addresses as control addresses, into and from which data can be moved to and from the device), or direct memory access (in which the device is capable of autonomously accessing system memory through the memory bus).

A friend of mine wrote a Port IO based SATA HDD driver, however most modern OSs use DMA for those because it's less CPU intensive.

Devices like graphics cards, which contain their own processing units, contain true registers used for processing. They, to the best of my knowledge, are not available directly to the processor, but the processor can (presumably through a combination of port based IO and DMA) provide executable data to the GPU which it can then execute, and it can store the output of its computations on the onboard device memory, which can be accessed through DMA.

于 2012-08-29T20:15:15.830 に答える
0

絶対。単語レジスタの定義を調べます。サウンドカードまたはチップには、たとえば音量を制御するために使用される1つまたは複数のレジスタがあります。単一のメモリまたは I/O トランザクションで書き込まれる個々のレジスタ。

ほとんどのペリフェラルにはレジスタがあり、一部のペリフェラルにはメモリ バンクがあります。一部のメモリは、レジスタを使用して一度に 1 つの項目にアクセスする (オフセット レジスタにオフセットを書き込む、データ レジスタを使用してデータを書き込むまたは読み取る、繰り返し) か、またはメモリのバンクが何らかの方法でホストのメモリ空間にマップされます。再びサウンド カードやビデオ カードについて考えてみましょう。幅、高さ、深さ、周波数などのさまざまなものを制御するために個々のレジスタが使用されます。サウンド カードの場合、ミキサー制御などはレジスタを介して行われます。ビデオ データ、ピクセル、文字、テクスチャなどをビデオ メモリまたは GPU に移動して何かを実行することは、ホスト アドレス空間にマップされたメモリ バンクを介して実行できます。

また、CPU (プロセッサ) のレジスタは、多くの場合、アドレスとデータ バス、および読み取り/書き込み制御信号を備えた SRAM を使用して実装されていることも興味深いでしょう。

于 2012-08-30T03:47:31.960 に答える