電腦架構整理

CPU (Central Processing Unit)

L1 與 L2 Cache :
目前電腦內部以距離 CPU 核心的層數來分, 有 L1、L2 兩種 Cache:
L1 Cache 作為 CPU 內部指令集與資料的快取區
L2 Cache 則是 CPU 與記憶體之間的快取區

RAM, Random Access Memory

前端匯流排(FSB,Front Side Bus)是指中央處理器資料匯流排的專門術語,此匯流排負責中央處理器和北橋晶片間的資料傳遞。

Bridge = Hub
MCH – Memory Controller Hub
ICH – I/O Controller Hub
DMI – Direct Media Interface

AGP (Accelerated Graphics Port) is a special I/O port which is designed exclusively for video cards.
DIME (DIrect Memory Execute). This allows the video card memory to be extended using standard RAM on the motherboard. 
RAMDAC device is a chip on the video card which looks after the “translation” of digital data into analogue signals, when the card is connected to an analogue screen. 
ECC (Error Checking & Correction) ECC 稱為錯誤自動檢查與更正, 這也是一種資料檢查的技術, 可以檢查資料是否正確
PCI stands for Peripheral Component Interconnect. 
隨插即用(Plug and Play,簡稱PnP)是一種電腦硬體的一般術語,指在電腦上加上一個新的外部裝置時,能自動偵測與配置系統的資源,而不需要重新組態或手動安裝驅動程式。
Extended System Configuration Data (ESCD) This is a small data area which is stored in the motherboard’s a nonvolatile storage. 

Interrupts

Software interrupts are used to call a large number of BIOS routines.
Hardware interrupts are what we are now going to discuss, because these are what the I/O devices use.

DMA stands for Direct Memory Access
Memory-mapped I/O 
通用序列匯流排(英語:Universal Serial Bus,縮寫USB)
USB版本速率稱號頻寬速度
USB 3.0超高速
SuperSpeed
5Gbps約500MB/s
(5000Mbit/s)
USB 2.0高速
Hi-Speed
480Mbps約60MB/s
(60,000KB/s)
USB 1.1全速
Full Speed
12Mbps約1.5MB/s
(1,500KB/s)
USB 1.0低速
Low Speed
1.5Mbps187.5KB/s
(192000B/s)
獨立磁碟冗餘陣列(RAID, Redundant Array of Independent Disks)
RAID 0RAID 1RAID 5
Serial ATA(SATA, Serial Advanced Technology Attachment),亦稱序列ATA,是串列SCSI(SAS:Serial Attached SCSI)的孿生兄弟,兩者的排線相容,SATA硬碟可接上SAS介面。它是一種電腦匯流排,主要功能是用作主機板和大量儲存裝置(如硬碟及光碟機)之間的數據傳輸之用。
SATA ports.jpg
SATA版本頻寬速度
SATA 3.06Gb/s600MB/s
SATA 2.03Gb/s300MB/s
SATA 1.01.5Gb/s150MB/s
和Parallel ATA相比,新的Serial ATA使用差動信號系統(differential-signal-amplified-system)。這種系統能有效的將雜訊從正常訊號中濾除,良好的雜訊濾除能力使得SATA只要使用低電壓操作即可,和Parallel ATA高達5V的傳輸電壓相比,SATA只要0.5V(500mv) 的峰對峰值電壓即可操作於更高的速度之上。比較正確的說法是:峰對峰值『差模電壓』。
和Parallel ATA的5V驅動電壓相比,0.5V的SATA系統節省電力,其驅動IC的生產成本也較為便宜。
有種排線附有小金屬片可以卡住插座,比較不會發生不小心將排線拔出的問題。
CPU
Mode – real mode, big real mode (flat mode), protected mode.

要能夠使用 32bit 的 segment,首先需要進入保護模式,最簡單的方法是:
cli
mov eax,cr0
or al,1
mov cr0,eax
sti

CPU Registers
1.一般暫存器:AX、BX、CX、DX
2.索引暫存器:SI、DI
3.堆疊、基底暫存器:SP、BP
4.指位/指標暫存器(指位器):IP

5.節段或區段暫存區:CS、DS、ES、SS、FS、GS

  程式區段 CS:如 IP 所執行位址都是CS程式區段的內容

        資料區段 DS:如 mov ax,[bx] 間接定址法所指都是資料段的資料

  額外區段 ES:如 mov ax,es:[di] 利用間接定址法取其他區段記憶體資料時

        堆疊區段 SS:如 SP 堆疊資料,都是指在堆疊段的

  額外區段 FS:80386以上電腦新增區段暫存器

  額外區段 GS:80386以上電腦新增區段暫存器
6.旗標暫存器:FLAG

15141312111009080706050403020100
    OFDFIFTFSFZF AF PF CF

AF:輔助進位旗標
CF:進位旗標
OF:溢位旗標
SF:符號(負號)旗標
PF:奇偶旗標
ZF:零值旗標
DF:方向旗標
IF:中斷旗標
TF:單步旗標

7.386以上電腦新增擴充之暫器

  EAX、ECX、EDX、EBX:為ax,bx,cx,dx的延伸,各為32位元

  ESI、EDI、ESP、EBP:為si,di,sp,bp的延伸,32位元

  EFLAG、EIP:為FLAG與IP之延伸,32位元
  FS、GS:新增的節段暫存器,16位元

Memory Map

DMA (8237A-5)

System Timer (8254-2)

Programmable Interrupts Controller (8259A)

1. 週邊設備通知8237(DREQ – DMA Request), 希望獲得DMA服務
2. 8237發出HRQ – Hold Request 通知CPU交出System BUS 的控制權, 以便執行DMA動作
3. CPU發出HLDA – Hold Acknowledge 通知8237, CPU已交出 System BUS 的控制權
4. 8237發出DACK – DMA Acknowledge 通知周邊已允許執行DMA傳送

Advanced Programmable Interrupt Controller (APIC)
高级可编程中断控制器.   
 APIC 是装置的扩充组合用来驱动 Interrupt 控制器。在目前的建置中,系统的每一个部份都是经由 APIC Bus 连接的。
NMI
Mask Off (Disable NMI) – port 70h, bit7 = 1.
Mask On (Enable NMI) – port 70h, bit7 = 0.
NMI is masked off at power on time.
KBC
CMOS
BDA – BIOS Data Area
EBDA – Extended BDA
PCI
PCI access, using CF8h and CFCh 10%:
1) Read word, Bus=2, Device=5, Function=3, Register=56h
2) Write Dwrod, Bus=1, Dvice=3, Function=2, Register24h. Data=12345678h
1.)
push dx
Mov dx, 0cf8h
mov eax, 80022b54h
out dx, eax
mov dx, 0cfch
in eax, dx
shr eax, 16 ;AX is output
pop dx
Or
push dx
Mov dx, 0cf8h
mov eax, 80022b56h
out dx, eax
mov dx, 0cfeh
in ax, dx ;AX is output
pop dx
2.)
push eax
push dx
mov eax, 80011a24h
mov dx, 0CF8h
out dx, eax
mov dx, 0cfch
mov eax, 12345678h
out dx, eax
pop dx
pop eax
PCIe
未經允許不得轉載:GoMCU » 電腦架構整理