有實際的usb通訊協議嗎?

我們大多數人從不考慮我們的USB裝置,我們只是把它們插進去,然後忘記它們。但是,如果你是一個好奇的型別誰想知道更多的USB如何工作?今天的超級使用者問答帖子回答了一位好奇的讀者的問題。...

有實際的u**通訊協議嗎?

我們大多數人從不考慮我們的USB裝置,我們只是把它們**去,然後忘記它們。但是,如果你是一個好奇的型別誰想知道更多的USB如何工作?今天的超級使用者問答帖子回答了一位好奇的讀者的問題。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

圖片由埃維爾卡·科瓦爾斯基(Flickr)提供。

問題

超級使用者讀者**eeb想知道是否真的有USB通訊協議:

According to Wikipedia, USB:

  • Defines the cables, connectors, and communicati*** protocols used in a bus for connection, communication, and power supply between computers and electronic devices.

But is there an actual USB Communication Protocol? My understanding is that:

  1. You connect a USB device to a machine (Ubuntu or any kind of Linux for example).
  2. Linux finds the device driver for that device somehow (bonus if you know!) and loads it.
  3. The device is now connected under /dev/theDevice.
  4. User space apps can now read and write to /dev/theDevice and the driver handles the low-level input and output to the underlying device/hardware.

As far as I can tell, a USB Communication Protocol does not appear anywhere in this flow. If my understanding is correct, the USB is just the cable and electrical connection between the PC and the device.

Am I wrong here? Does USB actually implement some kind of low-level protocol that underscores the flow above? If so, what is it and how does it work at a 30,000 foot view?

有實際的USB通訊協議嗎?

答案

超級使用者貢獻者RedGrittyBrick和projectdp為我們提供了答案。首先,紅磚:

Yes (see USB protocols).

As I understand it, the USB spec defines a complex set of layered protocols and device profiles.

For example, USB devices can conform to high-level templates like mass-storage, keyboard, human interface device, etc. and be managed by a generic device driver. Some USB devices can communicate at a lower level such that the operating system’s low level USB support can recognize that device-specific higher level drivers are needed.

接著是projectdp的回答:

Question

Is there a low-level USB communication protocol in action and what is it?

Answer

Yes, there is. The USB specification includes the USB protocol which defines the way the bus is used on a bit level. This would be the low-level protocol that underlies the higher level protocols (i.e. mass-storage, HID, etc.).

For specifics on how the USB protocol works, this OSDev wiki is helpful. Here is another interesting description using sequence diagrams to describe the various data transacti*** per the USB protocol.

Bonus Question

How does Linux find and load the device driver for that device?

Bonus Answer

On Linux when using a USB-enabled kernel, a working USB device will be detected via the hardware and kernel due to the USB specification. On the hardware side, the detection is done by the USB Host Controller. Then in the kernel the Host Controller Driver takes over and translates the low-level bits on the wire to USB protocol formatted information. This information then gets populated in the u**core driver in the kernel.

I paraphrased from this excellent Opensourceforu article, which has much more detail and clarity about your question in the Linux context.

請務必透過下面共享的執行緒連結檢視其餘的生動討論!


有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-11 01:11
  • 閱讀 ( 47 )
  • 分類:網際網路

你可能感興趣的文章

抿(sip)和h323型(h323)的區別

sip與h323 大約15年前,SIP和H323這兩種通訊協議幾乎是在同一時間引入的,但是SIP和H323在其範圍上存在一些差異,因此也導致了一些其他的差異。SIP和H323都是用於基於internet協議(IP)的網路上的多媒體呼叫和會議的通訊協議。...

  • 發佈於 2020-11-03 03:29
  • 閲讀 ( 40 )

關於提高網速的5個誤區及其原因

...站資料和其他快取用於儲存通常訪問的資料。反過來,這實際上加快了您的網際網路瀏覽體驗,因為載入頻繁訪問的頁面所需的資源更少。 ...

  • 發佈於 2021-03-15 04:11
  • 閲讀 ( 60 )

什麼是藍芽?10常見問題,問答

...了它,但它仍然需要其他公司跨裝置採用藍芽。這個名字實際上來自一家合作伙伴公司英特爾,英特爾的僱員吉姆·卡爾達克建議。 ...

  • 發佈於 2021-03-23 15:59
  • 閲讀 ( 50 )

ssh是什麼?它代表什麼?

...工作的?在考慮SSH連線的細節之前,讓我們先弄清楚shell實際上是什麼。 ...

  • 發佈於 2021-03-28 08:50
  • 閲讀 ( 54 )

不要驚慌,但是所有的usb裝置都有一個巨大的安全問題

...上,當您將裝置連線到計算機時,裝置上的韌體允許裝置實際執行。例如,一個典型的USB快閃記憶體驅動器韌體將管理檔案的來回傳輸。USB鍵盤的韌體將鍵盤上的物理按鍵轉換為透過USB連線傳送到計算機的數字按鍵資料。 這個...

  • 發佈於 2021-04-07 17:01
  • 閲讀 ( 41 )

fat32、exfat和ntfs之間有什麼區別?

...微軟的Xbox One以外,其他裝置可能不支援NTFS。 限制:沒有實際的檔案大小或分割槽大小限制。 理想用途:將其用於Windows系統驅動器和其他僅與Windows一起使用的內部驅動器。 檔案分配表32(fat32) FAT32是Windows可用的三個檔...

  • 發佈於 2021-04-08 05:12
  • 閲讀 ( 59 )

谷歌希望透過spdy和tcp方案來加速網際網路的發展

...來自於連線速度慢或者瀏覽器的渲染時間不好。有些時間實際上被一些相當基本的網路和通訊協議佔用了,這些協議已經使用了相當長的一段時間。谷歌希望用兩個不同的方案來啟動這些微小的延遲。第一個是SPDY(發音為“speed...

  • 發佈於 2021-04-21 04:29
  • 閲讀 ( 34 )

微軟新推出的“xbox wireless”允許PC支援不帶加密狗的xbox控制器

...Centre Y710 Cube遊戲PC。
 微軟使用專有的無線通訊協議(而非Wi-Fi Direct)將Xbox One控制器連線到遊戲機,因此PC**商將無法簡單地透過軟體實現這一功能。相反,微軟與聯想合作,將Xbox無線介面卡整合到IdeaCentreY710Cube...

  • 發佈於 2021-05-07 01:51
  • 閲讀 ( 28 )

tim berners lee稱網際網路隱私回滾“令人噁心”

...他們自己瞭解的更多。因為我們在生活中所做的很多事情實際上都是透過那些左鍵點選來完成的,這可能是可笑的。你有權私下去看醫生,那隻是你和醫生之間的事。同樣,你也必須能夠上網。” Berners Lee於1991年8月1日建立了...

  • 發佈於 2021-05-10 14:00
  • 閲讀 ( 30 )

pptp公司(pptp)和l2tp型(l2tp)的區別

...許點對點協議(PPP)會話在多個網路和鏈路上傳輸。L2TP實際上取自微軟和思科的L2F或第二層轉發技術的PPTP。因此,LT2P具有PPTP的特性,因為它結合了PPTP的控制通道和資料通道,並且在更快的傳輸協議UDP上執行。 由於UDP在實時交...

  • 發佈於 2021-06-23 04:05
  • 閲讀 ( 37 )
Deng57812
Deng57812

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦