device dirver

JUAN425發表於2014-08-15

驅動程式, 又稱驅動。 英文名字為device driver(裝置驅動器), 或者直接成為driver,  是一個computer Program, 用於操作或者控制a particular types of devices that is attached to a computer。 一個驅動, 為硬體裝置(hardware devices)提供了一個軟體介面(software interface)。  這樣就可以使得我們的作業系統或者其他的computer Program 能夠access hardware functions without needing to know precise details of the hardware being used。

driver 通過computer bus(計算機匯流排) 連線控制著硬體裝置。 

作業系統的位置如下:





driver (驅動程式)當然是Linux系統中kernel的一部分了。   



從user 的角度看(即我們的視角), 我們能夠看到的是一個device(裝置)連線到我們的計算機上, 在Linux作業系統中就是(對映為)一個File(檔案)。 

事實上 , 這個device檔案talk to a device driver。  然後send information to the eventual hardware。 

例如, 使用者開啟下面的device0的檔案, 於是開始reading information or writing information  from this device.  ie, when this device is invoked,  it will return an invokation of the device driver, 然後這個驅動開始“speaks to the hardware”, and does whatever the user applies。 



另外, kernel中有很多的driver, 不同的driver通過major number區分。 同一個driver可以連線多個device File(每個device 對映到Linux就是一個device, 也即一個device), 這些連線到同一driver的device 通過minor number 區分的:

 


相關文章