TW201202944A - Method for detecting pluggable storage apparatus and electronic apparatus - Google Patents

Method for detecting pluggable storage apparatus and electronic apparatus Download PDF

Info

Publication number
TW201202944A
TW201202944A TW99123109A TW99123109A TW201202944A TW 201202944 A TW201202944 A TW 201202944A TW 99123109 A TW99123109 A TW 99123109A TW 99123109 A TW99123109 A TW 99123109A TW 201202944 A TW201202944 A TW 201202944A
Authority
TW
Taiwan
Prior art keywords
storage device
input pin
bit
pluggable
pluggable storage
Prior art date
Application number
TW99123109A
Other languages
Chinese (zh)
Inventor
Ying-Chih Lu
Yu-Hui Wang
Original Assignee
Inventec Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Corp filed Critical Inventec Corp
Priority to TW99123109A priority Critical patent/TW201202944A/en
Publication of TW201202944A publication Critical patent/TW201202944A/en

Links

Abstract

A method for detecting pluggable storage apparatus and an electronic apparatus are provided. A connection port is used to connect the electric apparatus with the pluggable storage apparatus. In the present invention, whether a hot plug event is generated from the pluggable storage apparatus is detected by an input pin. When the hot plug event is generated, a corresponding input pin bit is written into an input pin register of a chipset unit. And an event status bit is written into a status register of the chipset unit. Then, an interrupt signal is triggered according to the event status bit, so as to begin an interrupt handler. Under executing the interrupt handler, the connection port is disabled or enabled according to the input pin bit.

Description

201202944 1W厶1 · fW 34163twf.doc/n 六、發明說明: 【發明所屬之技術領域】 本發明是有關於一種使用可插拔儲存裝置的機制,且 特別是有關於一種偵測可插拔儲存裝置的方法及電子裝 置。 【先前技術】 • 在一電腦裝置的系統中,硬碟可說是極重要的外部儲 存設備’其形成了整個系統的資料儲存中心。一般來說, 系統運作時使用的程式和資料絕大部分都是儲存於硬碟 上。大致上來看,硬碟按其介面類型可分為傳統的並列先 進技術附件(Parallel Advanced Technology Attachment, PATA )硬碟及序列先進技術附件(Serial Advanced201202944 1W厶1 · fW 34163twf.doc/n VI. Description of the Invention: [Technical Field] The present invention relates to a mechanism for using a pluggable storage device, and more particularly to a method for detecting pluggable storage Device method and electronic device. [Prior Art] • In a computer-based system, a hard disk can be said to be an extremely important external storage device' which forms a data storage center for the entire system. In general, most of the programs and data used in the operation of the system are stored on a hard disk. In general, hard drives can be divided into traditional Parallel Advanced Technology Attachment (PATA) hard disk and serial advanced technology accessories according to their interface type (Serial Advanced).

Technology Attachment , SATA )硬碟。其中,SATA 硬碟 採用序列式傳輸,因此接腳(pin)數較少,纜線也可以較 長,使得安裝較為容易。因此,SATA硬碟漸漸成為市場 W 的主流》 一般而言,SATA硬碟透過SATA控制器而連接至電 腦系統,SATA控制器可以偵測是否有SATA硬碟插入。Technology Attachment, SATA) hard drive. Among them, the SATA hard disk uses serial transmission, so the number of pins is small and the cable can be long, which makes the installation easier. As a result, SATA hard drives are becoming the mainstream of the market. In general, SATA hard drives are connected to the computer through a SATA controller. The SATA controller can detect whether a SATA hard drive is inserted.

然而’基於碌計考量(例如便於廠商進行測試)之下,SATA 控制器會在沒有SATA硬碟連接時,回報一個實際上並不 存在的儲存裝置。因此,在作業系統運行之下,作業系統 會看到一個已連接的儲存裝置(實際上並未連接)卻無法 使用之。 201202944 „ 34163twf.doc/n 【發明内容】 本發明提供一種價測可插拔儲存裝置的方法,在產生 熱插拔事件時可自動禁能或致能連接埠。 本發明提供一種電子裝置 拔狀態來禁能或致能連接琿。 ,依據可插拔儲存裝置的插 本發明提出-種伽可插拔儲存裝置的方法,適用於 電子裝置。其中,電子裝置透過連接埠與可插拔儲存裝置 連接。在本方法中,透過輪人接聊來制可插拔儲存裝置 拔事件。當透過輸人接腳而偵測到可插拔儲 f裝=產生‘“、插拔事件時,依射插拔儲存裝置的插拔狀 二,寫入對應的輸人接腳位元至晶片組單元的輸入接腳暫 ^器^且,寫人事件狀態位元至晶片組單元的狀態暫存 器。接者,依據事件狀態位元觸發中斷訊號,藉以啟動中 斷^,式。在執行中斷處理程式之下,依據輸入接腳位 元來決疋致能或禁能連接埠。 在本發明之-實施例中,上述偵測可插拔健存裝置的 方法更包括執行開機自我測試(PGwer 〇n Sdf⑽)。於 開機自我測試執行中致能中斷機制,並且清除狀態暫存器 以及寫入事件致能位元至晶片組單元中的致能暫存器。結 束開機自我測試而啟動作業系統,以在執行作業系統之下 透過輸入接腳來制可插拔儲存裝置是否發生熱插拔事 件。 在^發明之一實施例中,上述依據可插拔儲存裝置的 插拔狀態,寫人對應的輸人接腳位元至⑼組料的輸入 201202944 1DU231. rw 34163twf.doc/n 接腳暫存H的步射,若可插_存裝置連接於電子裝 置,以第-數值作為輸入接腳位元而寫入至輸入接腳暫存 器。若可插拔儲存裝置未連接於電子裝置,以第二數值作 為輸入接腳位元而寫入至輸入接腳暫存器。 在本發明之一實施例中,上述依據輸入接腳位元決定 致能或禁能連接埠的步驟中,若輸入接腳位元為第一數 值,致能連接埠。另外,若輸入接腳位元為第二數值,禁 能連接埠。 ’、 ® 在本發明之一實施例中,上述在執行中斷處理程式之 下,依據輸入接腳位元來決定致能或禁能連接埠之後,更 可發送一命令至基板管理控制器(Baseboard management controller,BMC ) ’以記錄系統事件曰誌(System Evem Log,SEL)。 在本發明之一實施例中,上述在執行中斷處理程式之 下’依據輸入接腳位元來決定致能或禁能連接埠之後,更 可清除狀態暫存器,並且結束中斷處理程式。 • 在本發明之一實施例中,上述可插拔儲存裝置為序列 先進技術附件(Serial Advanced Technology Attachment, SATA)儲存裝置’輸入接腳為通用輸入(generai pUrp〇se input ’ GPI)接腳’連接埠為通用序列匯流排(Universal Serial Bus,USB)埠。其中序列先進技術附件儲存裝置是 藉由序列先進技術附件控制器與通用序列匯流排埠連接。 另外’上述中斷訊號為系統管理中斷(System Management Interrupt’ SMI)訊號,中斷處理程式為系統管理中斷處理 201202944 丨 X/VU <1 . ” 34163twf.doc/n 程式(SMI handler )。 本發明提出一種電子裝置,此電子裝置至少包括中央 處理單元以及晶片組單元。其中,晶片組單元包括輸入^ 腳、連接埠以及多個暫存器(至少包括輸入接腳暫^器以 及一狀態暫存器)。輸入接腳與一可插拔儲存裝置連接, 而輸入接腳用以偵測可插拔儲存裝置是否產生熱插拔事 件。連接埠與一儲存裝置控制器連接,而此儲存^置控制 器與可插拔儲存裝置連接。當中央處理單元透過輸入接腳 而偵測到可插拔儲存裝置產生熱插拔事件時,依據可插拔 儲存裝置的插拔狀態,寫入對應的輪入接腳位元至輸入接 腳暫存器,並且寫入事件狀態位元至.狀態暫存器。之後, 中央處理單元再依據事件狀態位元觸發一中斷訊號,藉以 啟動中斷處理程式,並且在執行中斷處理程式之下,依據 輸入接腳位元決定致能或禁能連接埠。 基於上述’本發明在產生熱插拔事件時,若可插拔儲 存裝置為連接於電子裝置則致能連接埠,若可插拔儲存裝 置未連接於電子裝置,則禁能連接埠。據此,作業系統便 不會找到不存在的可插拔儲存裝置。 為讓本發明之上述特徵和優點能更明顯易懂,下文特 舉實施例’並配合所附圖式作詳細說明如下。 【實施方式】 圖1是依照本發明一實施例的電子裝置的方塊圖。請 參照圖1 ’在本實施例中,電子裝置1〇〇包括中央處理單 201202944 34163twf.d〇c/n 晶片組單元12()以及基板管理控制胃i3Q。其中, ⑴k置WO藉由晶片組單元120中的輸入接腳121來偵 ^可拔儲存裝置14〇是否產生熱插拔事件。並且,電子 置100藉由晶片組單元12〇中的連接埠123與可插拔儲 子裝置140連接。詳細地說,可插拔式儲存裝置14〇透過 儲存裝置控制器ISO與連接埠1:2〇連接,以藉由此連接方 式來進行資料的傳輸。 % 在實作上,儲存裝置控制器15〇可以設置在可插拔儲 存裝置140,或者儲存裝置控制器150可以設置於電子裝 置100上,又或者儲存裝置控制器150為獨立的設備,在 此並不限制。 電子装置100的晶片組單元120中設置有輸入接腳暫 存器125、狀態暫存器127以及致能暫存器129。其中,輸 入接腳暫存器125所記錄的值用以表示可插拔儲存裝置 140的插拔狀態’例如可插拔儲存裝置丨4〇與連接埠IK 連接或可插拔儲存裝置14〇未與連接埠123連接。狀態暫 _ 存器127所記錄的值是用來表示輸入接腳121是否有自可 插拔儲存裝置140偵測到其產生熱插拔事件。致能暫存器 129所記錄的值則是表示中斷機制是否有被致能。在本實 施例中’中斷訊號例如為系統管理中斷(System Management Interrupt,SMI)訊號,中斷處理程式例如為 系統管理中斷處理程式(SMI handler)。 另外’在本實施例中,可插拔儲存裝置140為序列先 進技術附件(Serial Advanced Technology Attachment, 201202944 ινυ^ι.ι w 34163twf.doc/n SATA)儲存裝置,輸入接腳121為通用輸入(general purpose input,GPI)接腳,連接埠123為通用序列匯流排 (Universal Serial Bus,USB)埠。儲存裝置控制器 15^為 SATA控制器》 # 以下再舉一例來說明偵測可插拔儲存裝置的詳細步 驟。圖2疋依照本發明一實施·例的偵測可插拔儲存裝置的 方法流程圖。請同時參照圖1及圖2,在步驟S205中,電 子裝置100透過輸入接腳121來偵測可插拔儲存裝置14〇 是否產生熱插拔事件。 具體而言,電子裝置100在開機之後會由基本輸入輸 出系統(Basic Input Output System,BIOS )來執行開機自 我測試(Power On Self Test)。在執行開機自我測試的過 程中’ BIOS會將中斷機制致能。在本實施例中,BI〇s在 致能中斷機制之後,可在晶片組單元120的致能暫存器129 中寫入一事件致能位元(例如,1 ),表示此熱插拔事件之 中斷機制已經致能。並且,將狀態暫存器127中的值清除。 之後,結束POST而啟動作業系統,以在執行作業系統之 下透過輸入接腳121來偵測可插拔儲存裝置14〇是否發生 熱插拔事件。 而當透過輸入接腳121而偵測到可插拔儲存裝置14〇 產生熱插拔事件時’如步驟S2i〇所示,晶片組單元12〇 會依據可插拔儲存裝置14〇的插拔狀態而寫入對應的輸入 接腳位元至晶片組單元12〇中的輸入接腳暫存器丨25。另 一方面’在未偵測到可插拔儲存裝置14〇產生熱插拔事件 201202944 i_l.rw 34163twfd〇c/n 時’則不執行其他步驟。 本實施例利用晶片組單元12〇上的輸入接腳⑵來债 測可插拔儲存裝置14〇是否產生熱插拔事件。當制到產 生熱插拔事件時’表示使用者將可插拔儲存裝置140由電 子裝置100上卸除,或者使用者將可插拔儲存裝置140連 接至電子裝置1GG。另外’在本實施例中,若輸人接腳121 偵測到可插拔儲存裝置丨4〇連接於電子裝置1〇〇時,晶片 • '组單疋120會以0 (第一數值)作為輸入接腳位元而寫入 至輸入接腳暫存器125 ^若輸入接腳121 .偵測到可插拔儲 存裝置140未連接於電子裝置1〇〇,晶片組單元12〇會以i (第一數值)作為輸入接腳位元而寫入至輸入接腳暫器 125。 據此,當使用者將可插拔儲存裝置14〇自電子裝置1〇〇 上卸除,或是將可插拔儲存裝置140連接至電子裝置1〇〇 時,輸入接腳位元皆會改變。例如,輸入接腳位元由〇變 為1代表可插拔儲存裝置140為自電子裝置1〇〇上拔除。 • 另外,輸入接腳位元由1變為0代表可插拔儲存裝置140 為插接至電子裝置100上。 並且’ g透過輸入接腳121而彳貞測到可插拔儲存裝置 140產生熱插拔事件時,如步驟S215所示,晶片組單元 120寫入事件狀態位元至晶片組單元12〇的狀態暫存器 127。也就是說,當可插拔儲存裝置14〇產生了熱插拔事件 時’不官可插拔儲存裝置140的插拔狀態為何,晶片組單 元120皆會寫入事件狀態位元至狀態暫存器127。 201202944 iwuzjx.xw 34163twf.d〇c/n 接著,在步驟S220中,依據事件狀態位元觸發中斷 訊號,藉以啟動中斷處理程式。在此,晶片組單元12〇更 可依據事件致能位元以及事件狀態位元來決定是否觸發中 斷訊號。例如,利用一個及邏輯閘(ANDgate),其輸入 端為狀態暫存器127以及致能暫存器129,當兩者其中之 一為〇時,便無法觸發中斷訊號。由於在POST階段中, 在致旎中斷機制之後,即以1作為事件致能位元而寫入至 致能暫存器129中。因此,在本實施例中,當偵測到可插 拔儲存裝置140產生熱插拔事件,而以丨作為事件狀態位. 元,即表不晶片組單元120會觸發一中斷訊號來啟動中斷 處理程式。 之後,在步驟S225中,在執行中斷處理程式之下, 依據輸入接腳位元來決定致能或禁能連接埠123。並且, 更可發送命令(例如智慧平台管理介面(Intelligem piatf〇rm Management lnterface,IPMI)命令)至基板管理控制器 130,以記錄系統事件日誌(System洳加L〇g,孤)。 之後’清除狀態暫存器127,並且結束中斷處理程式。 底下再舉一例來說明。圖3是依照本發明另一實施例 的偵測可插拔儲存裝置的方法流程圖。在本實施例中,假 設產生熱插拔事件時,事件狀態位光為】。並且,假設當 產生熱插拔事件時,若可插拔儲存裝置與電子裝置連接, 輸入接腳位元為0;若插拔儲存裝置未與電子裝置連接, 輸入接腳位元為1。 請參照圖3 ’在步驟S3〇5令,檢查事件狀態位元以及 10 201202944 1 w-tj i. Πν 34163twf.doc/n 事件致能位元。當事件狀態位元以及事件致能位元其中一 者為0時,表示並未產生熱插拔事件,或者t斷機制並未 致能’因而結束此流程。 當事件狀態位元以及事件致能位元兩者皆為1時,表 示產生熱插拔事件,而觸發中斷訊號。在執行中斷處理程 式之下,執行步驟S310,檢查輸入接腳位元。當輸入接腳 位元為0時’表示可插拔儲存裝置14〇目前連接於電子裝 _ 置100上,如步驟S315所示,將連接埠123致能。接著, 在步驟S320中,傳送IMPI命令至基板管理控制器13〇以 **己錄糸統事件日諸’例如“Hot Plug-in event”。之後,如步 驟S335所示,清除狀態暫存器127。 , 另一方面,當輸入接腳位元為丨時,表示可插拔儲存 装置140目前並未連接於電子裝置100上,如步驟幻25 所示,將連接埠123禁能。接著,在步驟j§33〇中,傳送 IMPI命令至基板管理控制器13〇,以記錄系統事件日諸, 例如“Hot P1ug-〇ut event”。之後,如步驟S335所示眚除 • 狀態暫存器127。 月 在本實施例中,由於中斷訊號為系統管理中斷訊號, 而系統管理中斷訊號的優先權大於其他中斷訊號,因此會 先決定將連接埠123致能或禁能之後,再執行其他中斷訊 號。 舉例來說’當可插拔儲存裝置140插接至電子裝置1 〇〇 上時,儲存裴置控制器150會通知連接埠123目前有儲存 裴置連接。此時,以連接埠123為USB埠而言,其會產生 201202944 -- 34163twfdoc/n USB中斷。此USB帽會在SMI巾斷處理財之後才執 心而中央處理單元11G例如會利用中斷服務常式 (Interrupt Sendee R〇utine,ISR)來服務此腦中斷。倘 若可插拔贿裝置M0未連衫電子裝置⑽,祕連接 璋123為禁能,作業系統並不會找到可插拔儲存裝置14〇。 反之,倘若可插拔儲存裝置U〇連接至電子裝置1〇〇,由 於連接璋I23域能,儲存裝置控制器ls〇便能夠將可插 拔儲存裝置140回報給連接琿123 ’因此作業系統便可以 找到可插拔儲存裝置140。 綜上所述,猎由上述實施例的作法,可在產生熱插拔 事件時自動禁能或致此連接蜂。如此一來,當可插拔儲存 裝置沒有與電子裝置連接時,作業系統便無法看到此可插 拔儲存裝置,而可插拔儲存裝置與電子裝置連接時,作業 系統亦能夠看到此可插拔儲存裝置。 雖然本發明已以實施例揭露如上,然其並非用以限定 本發明,任何所屬技術領域中具有通常知識者,在不脫離 本發明之精神和範圍内,當可作些許之更動與潤飾,故本: 發明之保護範圍當視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 圖1是依照本發明一實施例的電子裝置的方塊圖。 圖2是依照本發明一實施例的债測可插拔儲存裝置的 方法流程圖。 圖3是依照本發明另一實施例的偵測可插拔儲存農置 201202944 iw-iji.fW 34163twf.doc/n 的方法流程圖。 【主要元件符號說明】 100 :電子裝置 110 :中央處理單元 120 :晶片組單元 121 :輸入接腳 123 :連接埠 125 :輸入接腳暫存器 127 :狀態暫存器 129 :致能暫存器 130 :基板管理控制器 140 :可插拔儲存裝置 150 :儲存裝置控制器 S205〜S225 .本發明一實施例的偵測可插拔儲存裝置 的方法各步驟 & S3〇5〜S335 :本發明另一實施例的偵測可插拔儲存裝 置的方法各步驟However, based on the considerations (for example, for testing by vendors), the SATA controller will return a storage device that does not actually exist when there is no SATA hard drive connection. Therefore, under the operating system, the operating system will see a connected storage device (actually not connected) but cannot use it. 201202944 „ 34163 twf.doc/n SUMMARY OF THE INVENTION The present invention provides a method for measuring a pluggable storage device that can be automatically disabled or enabled when a hot plug event is generated. The present invention provides an electronic device pull-out state. The invention relates to a method for inserting and detaching a storage device according to the plug-in storage device, which is suitable for an electronic device, wherein the electronic device passes through the connection port and the pluggable storage device In this method, the pluggable storage device is unplugged by the wheeled person. When the pluggable storage device is detected through the input pin, the device is inserted and the event is generated. Inserting and unplugging the storage device, writing the corresponding input pin bit to the input pin of the chipset unit, and writing the event status bit to the state register of the chipset unit. In succession, the interrupt signal is triggered according to the event status bit, thereby starting the interrupt ^. Under the execution of the interrupt handler, the enable or disable port is enabled depending on the input pin location. In an embodiment of the invention, the method of detecting the pluggable memory device further comprises performing a boot self test (PGwer 〇n Sdf (10)). The interrupt mechanism is enabled during boot self-test execution, and the status register is cleared and the event enable bit is written to the enable register in the chipset unit. The boot self-test is terminated to start the operating system to make the hot-swappable event of the pluggable storage device through the input pin under the execution operating system. In an embodiment of the invention, according to the plugging and unplugging state of the pluggable storage device, the input pin corresponding to the input pin is input to the (9) component. 201202944 1DU231. rw 34163twf.doc/n pin temporary storage The step of H is written to the input pin register if the plug-in device is connected to the electronic device and the first value is used as the input pin bit. If the pluggable storage device is not connected to the electronic device, the second value is written to the input pin register as an input pin. In an embodiment of the invention, in the step of determining whether to enable or disable the connection according to the input pin bit, if the input pin is the first value, the connection is enabled. In addition, if the input pin bit is the second value, the port is disabled. In one embodiment of the present invention, after the interrupt processing program is executed, the enable or disable connection is determined according to the input pin bit, and a command can be sent to the baseboard management controller (Baseboard). Management controller, BMC ) 'To record the System Evem Log (SEL). In an embodiment of the present invention, after the execution of the interrupt processing program determines the enable or disable connection according to the input pin bit, the status register is further cleared, and the interrupt processing program is terminated. In an embodiment of the present invention, the pluggable storage device is a Serial Advanced Technology Attachment (SATA) storage device' input pin is a general input (generai pUrp〇se input 'GPI) pin' The port is a Universal Serial Bus (USB). The serial advanced technology accessory storage device is connected to the universal serial bus by the serial advanced technology accessory controller. In addition, the above interrupt signal is a System Management Interrupt 'SMI signal, and the interrupt handler is a system management interrupt processing 201202944 丨X/VU <1 . ” 34163 twf.doc/n program (SMI handler). An electronic device includes at least a central processing unit and a chipset unit, wherein the chipset unit includes an input pin, a port, and a plurality of registers (including at least an input pin and a state register) The input pin is connected to a pluggable storage device, and the input pin is configured to detect whether the pluggable storage device generates a hot plug event. The port is connected to a storage device controller, and the storage device is controlled. The device is connected to the pluggable storage device. When the central processing unit detects that the pluggable storage device generates a hot plug event through the input pin, the corresponding wheel is written according to the pluggable state of the pluggable storage device. The pin is connected to the input pin register and the event status bit is written to the status register. After that, the central processing unit is based on the event status. The element triggers an interrupt signal to activate the interrupt handler, and, under the execution of the interrupt handler, determines whether to enable or disable the connection according to the input pin bit. Based on the above invention, when a hot plug event is generated, The pluggable storage device is connected to the electronic device to enable connection. If the pluggable storage device is not connected to the electronic device, the connection port is disabled. According to this, the operating system will not find the pluggable storage that does not exist. In order to make the above features and advantages of the present invention more comprehensible, the following detailed description of the embodiments will be described in detail below with reference to the accompanying drawings. FIG. 1 is an electronic device according to an embodiment of the invention. Referring to FIG. 1 'In this embodiment, the electronic device 1 中央 includes a central processing unit 201202944 34163 twf.d 〇 c / n chip set unit 12 () and a substrate management control stomach i3Q. Among them, (1) k placed WO Whether the hot-swap event is generated by the removable storage device 14 by the input pin 121 in the chip set unit 120. Moreover, the electronic device 100 is connected by the port 123 in the chip set unit 12 The pluggable storage device 140 is connected. In detail, the pluggable storage device 14 is connected to the port 1:2 via the storage device controller ISO to transmit data by means of the connection. In practice, the storage device controller 15 can be disposed in the pluggable storage device 140, or the storage device controller 150 can be disposed on the electronic device 100, or the storage device controller 150 is an independent device, and is not The chip set unit 120 of the electronic device 100 is provided with an input pin register 125, a status register 127, and an enable register 129. The value recorded by the input pin register 125 is used to indicate The pluggable state of the pluggable storage device 140, for example, the pluggable storage device 〇4〇 is connected to the port IK or the pluggable storage device 14 is not connected to the port 123. The value recorded by the status register 127 is used to indicate whether the input pin 121 has detected that it has generated a hot plug event from the pluggable storage device 140. The value recorded by the enable register 129 indicates whether the interrupt mechanism is enabled. In this embodiment, the interrupt signal is, for example, a System Management Interrupt (SMI) signal, and the interrupt handler is, for example, a system management interrupt handler (SMI handler). In addition, in the present embodiment, the pluggable storage device 140 is a serial advanced technology attachment (Serial Advanced Technology Attachment, 201202944 ινυ^ι.ι w 34163twf.doc/n SATA) storage device, and the input pin 121 is a universal input ( The general purpose input (GPI) pin is a universal serial bus (USB). The storage device controller 15^ is a SATA controller. # The following is an example to illustrate the detailed steps of detecting the pluggable storage device. 2 is a flow chart of a method of detecting a pluggable storage device in accordance with an embodiment of the present invention. Referring to FIG. 1 and FIG. 2 simultaneously, in step S205, the electronic device 100 detects whether the pluggable storage device 14A generates a hot plug event through the input pin 121. Specifically, the electronic device 100 performs a Power On Self Test by a Basic Input Output System (BIOS) after being turned on. The BIOS will enable the interrupt mechanism during the boot self-test. In this embodiment, after the BI interrupt is enabled, an event enable bit (eg, 1) can be written in the enable register 129 of the chipset unit 120 to indicate the hot plug event. The interrupt mechanism has been enabled. And, the value in the status register 127 is cleared. Thereafter, the POST is terminated and the operating system is started to detect whether the pluggable storage device 14 is hot plugged or not through the input pin 121 under the execution operating system. When the pluggable storage device 14 is detected through the input pin 121 to generate a hot plug event, as shown in step S2i, the chip set unit 12 is inserted and removed according to the pluggable storage device 14A. The corresponding input pin bit is written to the input pin register 丨25 in the chipset unit 12A. On the other hand, when no pluggable storage device 14 is detected and a hot plug event is generated 201202944 i_l.rw 34163twfd〇c/n, no other steps are performed. This embodiment utilizes the input pins (2) on the die set unit 12 to instruct the pluggable storage device 14 to generate a hot plug event. When the hot plug event is generated, it indicates that the user has removed the pluggable storage device 140 from the electronic device 100, or the user connects the pluggable storage device 140 to the electronic device 1GG. In addition, in the present embodiment, if the input pin 121 detects that the pluggable storage device 4 is connected to the electronic device 1 , the wafer • 'group unit 120 will be 0 (the first value) The input pin bit is written to the input pin register 125. If the input pin 121 is detected. It is detected that the pluggable storage device 140 is not connected to the electronic device 1 , the chip set unit 12 will be i ( The first value is written to the input pin interposer 125 as an input pin bit. Accordingly, when the user removes the pluggable storage device 14 from the electronic device 1 or connects the pluggable storage device 140 to the electronic device 1 , the input pin bit changes. . For example, the input pin bit is changed from 〇 to 1 to indicate that the pluggable storage device 140 is unplugged from the electronic device 1 . • In addition, the input pin bit is changed from 1 to 0 to indicate that the pluggable storage device 140 is plugged into the electronic device 100. And when the g-plugging storage device 140 generates a hot plug event through the input pin 121, the chip group unit 120 writes the event status bit to the state of the chip set unit 12 as shown in step S215. Register 127. That is to say, when the pluggable storage device 14 generates a hot plug event, the plugged and unplugged storage device 140 is inserted into the event state bit to the state temporary storage. 127. 201202944 iwuzjx.xw 34163twf.d〇c/n Next, in step S220, an interrupt signal is triggered according to the event status bit, thereby starting the interrupt handler. Here, the chipset unit 12 can further determine whether to trigger the interrupt signal according to the event enable bit and the event status bit. For example, an AND gate is used, the input of which is the state register 127 and the enable register 129. When one of the two is 〇, the interrupt signal cannot be triggered. Since in the POST phase, it is written to the enable register 129 after the interrupt mechanism, i.e., with 1 as the event enable bit. Therefore, in the embodiment, when the pluggable storage device 140 is detected to generate a hot plug event, and the 状态 is used as the event status bit, the table chip unit 120 triggers an interrupt signal to start the interrupt processing. Program. Thereafter, in step S225, under the execution of the interrupt processing routine, the enabling or disabling connection 123 is determined according to the input pin bit. Moreover, a command (such as an Intelligent Platform Management Interface (IPMI) command) can be sent to the baseboard management controller 130 to record the system event log (System 洳 L〇g, orphan). Thereafter, the status register 127 is cleared and the interrupt processing routine is ended. Let me give another example to illustrate. 3 is a flow chart of a method of detecting a pluggable storage device in accordance with another embodiment of the present invention. In this embodiment, it is assumed that the event status bit light is when the hot plug event is generated. Moreover, it is assumed that when a hot plug event is generated, if the pluggable storage device is connected to the electronic device, the input pin bit is 0; if the plug storage device is not connected to the electronic device, the input pin bit is 1. Referring to FIG. 3', in step S3〇5, the event status bit is checked and 10 201202944 1 w-tj i. 34ν 34163twf.doc/n event enable bit. When one of the event status bit and the event enable bit is 0, it indicates that no hot plug event has occurred, or the t break mechanism has not been enabled' thus ending the process. When both the event status bit and the event enable bit are 1, it indicates that a hot plug event is generated and an interrupt signal is triggered. Under the execution of the interrupt processing, step S310 is performed to check the input pin bit. When the input pin bit is 0, it indicates that the pluggable storage device 14 is currently connected to the electronic device 100, and as shown in step S315, the port 123 is enabled. Next, in step S320, the IMPI command is transmitted to the baseboard management controller 13 to record the "Hot Plug-in event". Thereafter, as shown in step S335, the status register 127 is cleared. On the other hand, when the input pin is 丨, it indicates that the pluggable storage device 140 is not currently connected to the electronic device 100. As shown in step 25, the port 123 is disabled. Next, in step j§33, the IMPI command is transmitted to the baseboard management controller 13A to record system event days, such as "Hot P1ug-〇ut event". Thereafter, the status register 127 is deleted as shown in step S335. In this embodiment, since the interrupt signal is a system management interrupt signal, and the priority of the system management interrupt signal is greater than other interrupt signals, it is determined that the connection port 123 is enabled or disabled before performing other interrupt signals. For example, when the pluggable storage device 140 is plugged into the electronic device 1 ,, the storage device controller 150 notifies the port 123 that there is currently a storage device connection. At this time, with the port 埠123 as the USB port, it will generate the 201202944 - 34163twfdoc/n USB interrupt. The USB cap will be intent after the SMI has been processed and the central processing unit 11G, for example, utilizes the Interrupt Sendee R&S (ISR) to service this brain interruption. If the pluggable device M0 is not connected to the electronic device (10), the secret connection 璋123 is disabled, and the operating system does not find the pluggable storage device 14〇. On the other hand, if the pluggable storage device U is connected to the electronic device 1 , the storage device controller ls can report the pluggable storage device 140 to the connection port 123 ' A pluggable storage device 140 can be found. In summary, the hunting method can be automatically disabled or connected to the bee when a hot plug event is generated by the above embodiment. In this way, when the pluggable storage device is not connected to the electronic device, the operating system cannot see the pluggable storage device, and when the pluggable storage device is connected to the electronic device, the operating system can also see the same. Plug in the storage device. Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. This: The scope of protection of the invention is subject to the definition of the scope of the patent application. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of an electronic device in accordance with an embodiment of the present invention. 2 is a flow chart of a method of a debt test pluggable storage device in accordance with an embodiment of the present invention. 3 is a flow chart of a method for detecting pluggable storage farm 201202944 iw-iji.fW 34163twf.doc/n according to another embodiment of the present invention. [Description of main component symbols] 100: electronic device 110: central processing unit 120: chipset unit 121: input pin 123: port 125: input pin register 127: state register 129: enable register 130: substrate management controller 140: pluggable storage device 150: storage device controller S205~S225. Method for detecting pluggable storage device according to an embodiment of the present invention & S3〇5~S335: the present invention Another method for detecting a pluggable storage device in another embodiment

Claims (1)

34163twf.doc/n 201202944 七、申請專利範困: L 一種偵測可插拔儲存裝置的方法,適用於一電子裝 置’其中該電子裝置透過_連接埠與該可插拔儲存裝置連 接’該方法包括: 透過一輸入接腳來偵測該可插拔儲存裝置是否產生一 熱插拔事件; ^透過該輪入接腳而偵測到該可插拔儲存裝置產生該 熱插拔事料,⑽該可插拔鱗裝$的插拔狀態 ’寫入 對應的一輸入接腳位元至一晶片組單元的一輸入接腳暫存 器; 寫入一事件狀態位元至該晶片組單元的一狀態暫存 器; 依據該事件狀態位元觸發一中斷訊號,藉以啟動一中 斷處理程式;以及 ^在執行該中斷處理程式之下,.依據該輸入接腳位元決 定致能或禁能該連接埠。 2.如申請專利範圍第i項所述之偵測可插拔儲存裝 置的方法,更包括: 執行一開機自我測試; =、於該開機自我測試執行中致能一中斷機制,並且清除 5狀暫存器以及寫入一事件致能位元至該晶片組單元中 的一致能暫存器;以及 結束該開機自我測試而啟動一作業系統,以在執行該 作業乐統之下透過該輪入接腳來偵測該玎插拔儲存裝置是 14 201202944 i.rw 34163twf.doc/n 否發生該熱插拔事件。 3. 如申請專利範圍第1項所述之偵測可插拔儲存裝 置的方法,其中依據該可插拔儲存裝置的插拔狀態,寫乂 對應的該輸入接腳位元至該晶片組單元的該輸入接腳 窃的步驟包括: 若該可插拔儲存裝置連接於該電子裝置,以一第一數 值作為該輸入接腳位元而寫入至該輸入接腳暫存器;以及 若該可插拔儲存裝置未連接於該電子裝置,以一第二 數值作為該輸入接腳位元而寫入至該輸入接腳暫存器。一 4. 如申請專利範圍3項所述之偵測可插拔儲存装置 :::步其中依據該輸入接腳位元來決定致能或禁能該連 及 若該輸入接腳位元為該第一數值,致能該連接埠 :以 若該輸入接卿位元為該第二數冑,禁能該連接埠。 置的5方;圍第3項所述之_可插拔儲存裝 1的方法,其中在執行該中斷處理鞋式之下,依 接聊位s來蚊魏或禁能該連料的步驟之後更包^: 日誌 發送一命令至—基板管理控織,以記錄-系統事件 =、如中請專利_第3項所述之細可插拔儲約 的方法’其中在執行該帽處理程式之下, 接腳位元來決定致能絲能該連接琿的步驟之後更= 清除該狀態暫存器;以及 201202944 iwiji.i w 34163twf.doc/n 結束該中斷處理程式。 7·如申請專利範圍第1項所述之偵測可插拔儲存裝 置的方法,其中該可插拔儲存裝置為序列先進技術附件^ 存裝置,該輸入接腳為通用輸入接腳,該連接埠為通用 序列匯流排璋。34163twf.doc/n 201202944 VII. Patent application: L A method for detecting a pluggable storage device, which is suitable for an electronic device 'where the electronic device is connected to the pluggable storage device through a connection port' The method includes: detecting, by an input pin, whether the pluggable storage device generates a hot plug event; and detecting the pluggable storage device by the wheel input pin to generate the hot plug event, (10) The pluggable state of the pluggable scale $ writes a corresponding input pin bit to an input pin register of a chip set unit; writes an event status bit to one of the chip set unit a status register; triggering an interrupt signal according to the event status bit to initiate an interrupt processing program; and ^ executing the interrupt processing program, determining or enabling the connection according to the input pin bit port. 2. The method for detecting a pluggable storage device as described in claim i, further comprising: performing a boot self test; = enabling an interrupt mechanism during the boot self test execution, and clearing 5 And registering an event enabling bit to a consistent energy register in the chipset unit; and terminating the power-on self-test to activate an operating system to perform the rounding through the operating system The pin is used to detect the plug and unplug storage device is 14 201202944 i.rw 34163twf.doc/n No such hot plug event occurs. 3. The method of detecting a pluggable storage device according to claim 1, wherein the corresponding input pin bit is written to the chipset unit according to the plugging and unplugging state of the pluggable storage device The step of the input pin stealing includes: if the pluggable storage device is connected to the electronic device, writing to the input pin register with a first value as the input pin bit; and if The pluggable storage device is not connected to the electronic device, and is written to the input pin register with a second value as the input pin bit. The detection pluggable storage device described in claim 3::: wherein the input pin is used to determine whether to enable or disable the connection and if the input pin is The first value enables the port: if the input bit is the second number, the port is disabled. The method of inserting the storage device 1 according to the third item, wherein after the step of executing the interrupt processing shoe, following the step of the mosquito bit or the ban of the lining Further package ^: log send a command to - substrate management control, to record - system event =, as described in the patent _ the third item of the fine pluggable storage method 'where the cap processing program is executed Next, the pin bit determines to enable the wire to connect to the port 更 after the step = clear the state register; and 201202944 iwiji.iw 34163twf.doc / n ends the interrupt handler. 7. The method of detecting a pluggable storage device according to claim 1, wherein the pluggable storage device is a serial advanced technology accessory device, and the input pin is a universal input pin, the connection埠 is a universal sequence bus. 8. 如申請專利範圍第7項所述之偵測可插拔儲存裝 置的方法,其中該序列先進技術附件儲存裝置是藉由一序 列先進技術附件控制器與該通用序列匯流排埠連接。 9. 如申請專利範圍第1項所述之偵測可插拔儲存裝 置的方法,其中該中斷訊號為系統管理中斷訊號,該中^ 處理程式為系統管理中斷處理程式。 10· —種電子裝置,包括: 一中央處理單元;以及 一晶片組單元,包括: 一輸入接腳,與一可插拔儲存裝置連接,該輸入 接腳偵測該可插拔儲存裝置是否產生一熱插拔事件;8. The method of detecting a pluggable storage device of claim 7, wherein the sequence of advanced technology accessory storage devices is coupled to the universal serial bus bar by a sequence of advanced technology accessory controllers. 9. The method of detecting a pluggable storage device according to claim 1, wherein the interrupt signal is a system management interrupt signal, and the processing program is a system management interrupt processing program. An electronic device comprising: a central processing unit; and a chipset unit, comprising: an input pin connected to a pluggable storage device, the input pin detecting whether the pluggable storage device is generated a hot plug event; 一連接埠,與一儲存裝置控制器連接,其中該儲 存裝置控制器與該可插拔儲存裝置連接;以及、 多個暫存器,包括-輸人接腳暫存器以及一狀態 暫存器; 當該中央處理單元透過該輸人接腳而偵測_ 裝置產生該熱插拔事件時’依據該可插拔儲存 態’寫入對應的-輪入接腳位元至該輸入接 子盗’並且寫人—事件狀態位元至該狀態暫存器;之 16 201202944 iuwzjx.jTW 34163twf.doc/n 後,依據該事件狀態位元觸發一中斷訊號,藉以啟動一中 斷處理程式,並且在執行該中斷處理程式之下,依據該輸 入接腳位元決定致能或禁能該連接埠。a connection port connected to a storage device controller, wherein the storage device controller is connected to the pluggable storage device; and, a plurality of registers, including an input pin register and a status register When the central processing unit detects through the input pin _ the device generates the hot plug event, 'write the corresponding - wheel input pin according to the pluggable storage state to the input pin thief 'and write the human-event status bit to the status register; 16 201202944 iuwzjx.jTW 34163twf.doc/n, trigger an interrupt signal according to the event status bit, thereby starting an interrupt handler and executing Under the interrupt handler, the connection pin is enabled or disabled according to the input pin bit. 1717
TW99123109A 2010-07-14 2010-07-14 Method for detecting pluggable storage apparatus and electronic apparatus TW201202944A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW99123109A TW201202944A (en) 2010-07-14 2010-07-14 Method for detecting pluggable storage apparatus and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99123109A TW201202944A (en) 2010-07-14 2010-07-14 Method for detecting pluggable storage apparatus and electronic apparatus

Publications (1)

Publication Number Publication Date
TW201202944A true TW201202944A (en) 2012-01-16

Family

ID=46756268

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99123109A TW201202944A (en) 2010-07-14 2010-07-14 Method for detecting pluggable storage apparatus and electronic apparatus

Country Status (1)

Country Link
TW (1) TW201202944A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI561993B (en) * 2014-05-23 2016-12-11 Universal Global Scient Ind Co A control device
TWI561975B (en) * 2015-10-20 2016-12-11 Mitac Computing Technology Corp Method for detecting hot-swap occurrence
TWI615718B (en) * 2016-12-19 2018-02-21 英業達股份有限公司 Computer system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI561993B (en) * 2014-05-23 2016-12-11 Universal Global Scient Ind Co A control device
TWI561975B (en) * 2015-10-20 2016-12-11 Mitac Computing Technology Corp Method for detecting hot-swap occurrence
TWI615718B (en) * 2016-12-19 2018-02-21 英業達股份有限公司 Computer system

Similar Documents

Publication Publication Date Title
TWI436204B (en) Testing system and method for usb hub
TWI632462B (en) Switching device and method for detecting i2c bus
TWI279707B (en) Hot plug module, method of adding/removing the same to/from a running computing device, computing device, midplane of a computing device and machine readable medium for interrupt processing
US9378846B2 (en) Non-mounted storage test device based on FPGA
US20150106660A1 (en) Controller access to host memory
WO2011150409A2 (en) Solution for full speed, parallel dut testing
US20140095948A1 (en) Memory testing in a data processing system
US20160246612A1 (en) Network bios management
US20060294149A1 (en) Method and apparatus for supporting memory hotplug operations using a dedicated processor core
TW201202942A (en) Virtualizing a host USB adapter
TWI512490B (en) System for retrieving console messages and method thereof and non-transitory computer-readable medium
WO2018188283A1 (en) Information processing method and electronic device
WO2019072111A1 (en) Fpga device and cloud system based on fpga device
US20150067424A1 (en) Processor tap support for remote services
WO2021098485A1 (en) Method and system for power-on and power-off control of pcie device
US20170109248A1 (en) Sharing bus port by multiple bus hosts
WO2018218954A1 (en) Verification platform and verification method, and computer storage medium
TW201439751A (en) Graphic card inspection system and method thereof
US20070214347A1 (en) Method and apparatus for performing staged memory initialization
TW201202944A (en) Method for detecting pluggable storage apparatus and electronic apparatus
CN109086081B (en) Method, system and medium for instantly prompting in-place change of SATA (Serial advanced technology attachment) and NVMe (network video recorder) equipment
TWI630485B (en) Extensible host controller and operation method thereof
US20050182867A1 (en) Systems and methods for signaling write status
TWI573424B (en) Network configuration managing method, server system and non-transitory computer readable storage medium
TW201734800A (en) Method for setting redundant array of independent disks