TWI731515B - Computer system and boot controlling method for storage apparatus - Google Patents

Computer system and boot controlling method for storage apparatus Download PDF

Info

Publication number
TWI731515B
TWI731515B TW108146170A TW108146170A TWI731515B TW I731515 B TWI731515 B TW I731515B TW 108146170 A TW108146170 A TW 108146170A TW 108146170 A TW108146170 A TW 108146170A TW I731515 B TWI731515 B TW I731515B
Authority
TW
Taiwan
Prior art keywords
storage device
space
metadata
reserved space
extended
Prior art date
Application number
TW108146170A
Other languages
Chinese (zh)
Other versions
TW202125225A (en
Inventor
侯冠宇
傅子瑜
Original Assignee
宏碁股份有限公司
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 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW108146170A priority Critical patent/TWI731515B/en
Application granted granted Critical
Publication of TWI731515B publication Critical patent/TWI731515B/en
Publication of TW202125225A publication Critical patent/TW202125225A/en

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

A computer system and a boot controlling method for storage apparatus are provided. The computer system includes a storage apparatus and a firmware interface. The storage apparatus is configured with a reserved space, and the reserved space is used for storing metadata related to the boot setting of the rapid storage technology (RST) mode. In a boot procedure, the firmware interface accesses the metadata in the reserved space of the storage apparatus in response to the RST mode. In addition, firmware interface stores partition information in the space other than the reserved space in response to the advanced host controller interface (AHCI) mode. Accordingly, after the switching between the two modes, the boot procedure can be successful.

Description

電腦系統及用於儲存裝置的開機控制方法Computer system and boot control method for storage device

本發明是有關於一種儲存技術,且特別是有關於一種電腦系統及用於儲存裝置的開機控制方法。The present invention relates to a storage technology, and particularly relates to a computer system and a boot control method for a storage device.

全球唯一識別符(Globally Unique Identifiers,GUID)硬碟分割表(GUID Partition Table,GPT)是現今多數作業系統(Operating System,OS)所支援的硬碟分割區(partition)表的結構布局標準,且同時也符合統一可延伸韌體介面(Unified Extensible Firmware Interface,UEFI)標準(其可被用於替代個人電腦的基本輸入輸出系統(Basic Input/ Output System,BIOS))。此分割區表會切割出一塊32位元(bits)的空間用於儲存邏輯區塊位址(Logical Block Address,LBA)空間及主開機紀錄(Master Boot Record,MBR)。在MBR硬碟中,分割區資訊直接儲存於主開機紀錄(MBR)中(主開機紀錄中可能還儲存作業系統的啟動程式)。而在GPT硬碟中,分割區表的位置資訊儲存在GPT頭(header)中。基於相容性考慮,硬碟的第一個磁區仍供MBR存放,之後才是主要GPT頭(Primary GPT Header)。而為了減少分割區表損壞的風險,硬碟最後空間更儲存了分割區表的副本(例如,次要GPT頭(Secondary GPT Header))。Globally Unique Identifiers (GUID) hard disk partition table (GUID Partition Table, GPT) is the structure and layout standard of hard disk partition table supported by most operating systems (OS) today, and It also complies with the Unified Extensible Firmware Interface (UEFI) standard (which can be used to replace the Basic Input/Output System (BIOS) of a personal computer). This partition table will cut a 32-bit (bits) space for storing logical block address (LBA) space and master boot record (MBR). In the MBR hard disk, partition information is directly stored in the master boot record (MBR) (the master boot record may also store the operating system's startup program). In the GPT hard disk, the location information of the partition table is stored in the GPT header. Based on compatibility considerations, the first sector of the hard disk is still used for MBR storage, followed by the primary GPT header (Primary GPT Header). In order to reduce the risk of damage to the partition table, a copy of the partition table (for example, the Secondary GPT Header) is stored in the last space of the hard disk.

現今大部分個人電腦、伺服器等主流系統的BIOS都是採用UEFI標準。系統開機時,BIOS會讀寫的硬碟的主開機紀錄磁區。這代表系統對於磁區的存取需要格外小心。若不幸磁區內的檔案損毀,將會使得系統無法開機。電腦系統在正常使用下通常不會發生這樣的情況,尤其作業系統會特別保護這些磁區。因此,一般使用者並不得輕易探訪這些磁區。無可避免地,若是透過其他作業系統、或是其他系統檢視這顆硬碟,那麼所有磁區將一覽無遺,且使用者要對其進一步存取也非難事。Nowadays, the BIOS of most mainstream systems such as personal computers and servers adopt the UEFI standard. When the system is booted, the BIOS will read and write the master boot record sector of the hard disk. This means that the system needs to be extra careful in accessing magnetic sectors. Unfortunately, if the files in the sector are damaged, the system will not be able to boot. Normally, this situation does not happen to the computer system under normal use, and the operating system especially protects these sectors. Therefore, ordinary users should not easily visit these sectors. Inevitably, if the hard disk is viewed through other operating systems or other systems, then all sectors will be in a glance, and it is not difficult for users to access it further.

目前個人電腦系統支援的晶片組(Chipset)模式(mode)有AHCI模式、快速儲存技術(Rapid Storage Technology,RST)容錯式磁碟陣列(Redundant Array of Independent Disks,RAID)模式、RST Premium(與Optane)模式。後兩者是英代爾(Intel)供支援RAID及Optane記憶體/儲存器的模式,且透過BIOS程式碼嵌入其預先作業系統(PreOS)驅動程式(driver)即可支援這些功能。值得注意的是,RST模式下,PreOS驅動程式在BIOS初始化時,即會開始接管整個開機的主導權,並為了因應其裝置的特殊設計而對磁區的存取而有與AHCI模式不同的行為。At present, the chipset mode (mode) supported by personal computer systems includes AHCI mode, Rapid Storage Technology (RST) Redundant Array of Independent Disks (RAID) mode, RST Premium (and Optane) )mode. The latter two are Intel's support for RAID and Optane memory/storage modes, and these functions can be supported by embedding its pre-operating system (PreOS) driver through the BIOS code. It is worth noting that in the RST mode, the PreOS driver will start to take over the leadership of the entire boot when the BIOS is initialized, and will behave differently from the AHCI mode in order to access the sector in response to the special design of the device. .

圖1是習知技術兩種模式在開機程序中對儲存裝置存取的示意圖。請參照圖1,不同晶片組模式的開機分割區(Boot Partition)都是一樣的,開機分割區主要是遵照作業系統規範的統一格式。AHCI或RST驅動程式AHCI, RST並不會去創建自己的開機分割區格式,且開機BIOS初始化後即會自主地尋找主開機紀錄MBR及主要GPT資訊M_GPT。值得注意的是,圖1所示的RST模式相較於AHCI模式增加了一個Intel元資料的分割區。此分割區並不屬於GPT規範的格式,而是Intel要求設備製造商(Original Equipment Manufacturer,OEM)需要切割一塊分割區,以供RST模式開機的磁碟組裝資訊的元資料所儲存。因此,RST模式的開機流程應是在載入主開機程序前,且其驅動程式會先檢查元資料以確保硬碟的組裝狀態無誤,才會進行下一步開機動作。FIG. 1 is a schematic diagram of access to a storage device in the boot process in two modes of the prior art. Please refer to Figure 1. The Boot Partition of different chipset modes is the same, and the Boot Partition is mainly in accordance with the unified format of the operating system specifications. The AHCI or RST driver AHCI, RST does not create its own boot partition format, and after the boot BIOS is initialized, it will autonomously search for the master boot record MBR and the main GPT information M_GPT. It is worth noting that the RST mode shown in Figure 1 adds an Intel metadata partition compared to the AHCI mode. This partition does not belong to the format of the GPT specification, but Intel requires equipment manufacturers (Original Equipment Manufacturers, OEM) to cut a partition for the metadata of the disk assembly information to be stored in RST mode. Therefore, the boot process in RST mode should be before the main boot process is loaded, and the driver will check the metadata to ensure that the hard disk is assembled correctly before proceeding to the next boot action.

倘若元資料不存在或是損毀,那麼在RST模式下將會開機失敗。圖2是習知技術兩種模式在開機程序中對儲存裝置存取的流程圖。請參照圖2,開機且BIOS 初始化(步驟S201、S203、S211、S213)後,儲存裝置驅動程式檢查裝置資訊,且確定無誤後報告給BIOS可使用的邏輯區塊位址空間(步驟S205)。接著,BIOS會依據GPT規範讀取主開機紀錄以進行後續開機動作(步驟S207)。而RST模式與AHCI模式之間最大差異在於,RST驅動程式會檢查OEM特別預留以供元資料空間寫入與讀取硬碟間的組裝資訊(步驟S215),並待確認組裝資訊無誤後即將可存取空間回報給BIOS(步驟S217),BIOS才會讀取主開機紀錄(步驟S219)。然而,為了避免組裝資訊被系統讀取或改寫,RST驅動程式僅回報總體容量扣掉其元資料分割區的空間給BIOS。If the metadata does not exist or is damaged, the boot will fail in RST mode. FIG. 2 is a flowchart of access to the storage device in the boot process in two modes of the prior art. Referring to FIG. 2, after booting and BIOS initialization (steps S201, S203, S211, S213), the storage device driver checks the device information, and after confirming that it is correct, it reports to the logical block address space available to the BIOS (step S205). Next, the BIOS will read the master boot record according to the GPT specification to perform subsequent boot operations (step S207). The biggest difference between the RST mode and the AHCI mode is that the RST driver will check the OEM's special reserve for the metadata space to write and read the assembly information between the hard disk (step S215), and after confirming that the assembly information is correct The accessible space is reported to the BIOS (step S217), and the BIOS will read the master boot record (step S219). However, in order to avoid the assembly information being read or rewritten by the system, the RST driver only reports the total capacity minus the space of its metadata partition to the BIOS.

值得注意的是,倘若系統自RST模式切換成AHCI 模式,由於AHCI模式並不認得Intel元資料分割區,因此其驅動程式仍會正常回報系統完整的可讀取LBA空間。此時,BIOS會將次要GPT(Secondary GPT)資訊S_GPT寫入LBA最後位置,且造成Intel元資料被覆寫。之後,若再切換回RST模式,則系統將無法開機。因此,規定中記錄有,在採用特殊裝置(Optane或 RAID儲存器)的情況下,系統預設必須為RST模式且不得任意切換至AHCI 模式。否則,硬碟損毀的問題將不予負責。然而,供使用者使用的電腦產品通常會同時支援AHCI與RST模式。多數使用者會在未知情況下任意切換而造成無法開機的狀況,更導致使用者甚至將產品退回。It is worth noting that if the system is switched from the RST mode to the AHCI mode, the AHCI mode does not recognize the Intel metadata partition, so the driver will still report the system's complete and readable LBA space normally. At this time, the BIOS will write the secondary GPT (Secondary GPT) information S_GPT into the last position of the LBA, and cause the Intel metadata to be overwritten. After that, if you switch back to RST mode, the system will not be able to boot. Therefore, it is recorded in the regulations that when special devices (Optane or RAID storage) are used, the system defaults to RST mode and cannot switch to AHCI mode arbitrarily. Otherwise, the problem of hard disk damage will not be held responsible. However, computer products for users usually support both AHCI and RST modes. Most users will switch arbitrarily under unknown circumstances, resulting in a situation where they cannot be turned on, and even causing users to return the product.

有鑑於此,本發明實施利提供一種電腦系統及用於儲存裝置的開機控制方法,提供預留空間儲存供快速儲存技術模式使用的元資料,任意切換不同模式都不會影響開機。In view of this, the embodiments of the present invention provide a computer system and a boot control method for a storage device, providing reserved space for storing metadata used in a fast storage technology mode, and switching between different modes will not affect booting.

本發明實施例的電腦系統包括但不僅限於儲存裝置及韌體介面。儲存裝置配置有預留空間。此預留空間儲存元資料(metadata),且元資料相關於快速儲存技術模式下的開機設定。韌體介面耦接儲存裝置。在開機程序中,反應於快速儲存技術模式,韌體介面對儲存裝置存取預留空間中的元資料。而反應於進階主機控制器介面模式,韌體介面將分割區資訊儲存在儲存裝置中預留空間以外的空間。The computer system of the embodiment of the present invention includes but is not limited to a storage device and a firmware interface. The storage device is configured with reserved space. This reserved space stores metadata, and the metadata is related to the boot settings in the fast storage technology mode. The firmware interface is coupled to the storage device. In the boot process, reflecting the fast storage technology mode, the firmware interface accesses the metadata in the reserved space of the storage device. In response to the advanced host controller interface mode, the firmware interface stores the partition information in a space other than the reserved space in the storage device.

另一方面,本發明實施例用於儲存裝置的開機控制方法包括但不僅限於下列步驟:提供儲存裝置。此儲存裝置配置有預留空間,此預留空間儲存元資料,且此元資料相關於快速儲存技術模式下的開機設定。反應於快速儲存技術模式,對儲存裝置存取預留空間中的元資料。而反應於進階主機控制器介面模式,將分割區資訊儲存在儲存裝置中預留空間以外的空間。On the other hand, the boot control method for the storage device in the embodiment of the present invention includes but is not limited to the following steps: providing a storage device. The storage device is configured with reserved space, this reserved space stores metadata, and this metadata is related to the boot setting in the fast storage technology mode. Responding to the fast storage technology mode, access the metadata in the reserved space to the storage device. In response to the advanced host controller interface mode, the partition information is stored in a space other than the reserved space in the storage device.

基於上述,本發明實施例的電腦系統及用於儲存裝置的開機控制方法,為了快速儲存技術模式提供了不受進階主機控制器介面模式影響的預留空間,此開機設定相關的元資料即可儲存於此預留空間而不會被異常覆寫。藉此,任意在兩模式之間切換,電腦系統都能順利開機完成。Based on the above, the computer system and the boot control method for the storage device of the embodiment of the present invention provide a reserved space that is not affected by the advanced host controller interface mode for the fast storage technology mode. The metadata related to the boot setting is Can be stored in this reserved space without being overwritten abnormally. In this way, any switch between the two modes can complete the booting of the computer system smoothly.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail in conjunction with the accompanying drawings.

圖3是依據本發明一實施例的電腦系統100的元件方塊圖。請參照圖3,電腦系統100包括但不僅限於韌體介面130及儲存裝置150。FIG. 3 is a block diagram of components of a computer system 100 according to an embodiment of the invention. Please refer to FIG. 3, the computer system 100 includes but is not limited to a firmware interface 130 and a storage device 150.

韌體介面130可以是任何型態的固定或可移動隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、或快閃記憶體。韌體介面130可以是基本輸入輸出系統(Basic Input Output System,BIOS)、可延伸韌體介面(Extensible Firmware Interface,EFI)、統一可延伸韌體介面(UEFI)或記載韌體程式的其他類型介面系統。The firmware interface 130 can be any type of fixed or removable random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), or flash memory. The firmware interface 130 can be a Basic Input Output System (BIOS), an Extensible Firmware Interface (EFI), a Unified Extensible Firmware Interface (UEFI), or other types of interfaces that record firmware programs system.

在一實施例中,韌體介面130儲存RST及AHCI驅動程式,以分別對儲存裝置150執行RST模式及AHCI模式下的運作。在另一實施例中,韌體介面130儲存預先作業系統驅動程式,以對儲存裝置150或其他裝置執行開機流程所需運作。In one embodiment, the firmware interface 130 stores RST and AHCI driver programs to perform operations in the RST mode and AHCI mode on the storage device 150, respectively. In another embodiment, the firmware interface 130 stores a pre-operating system driver to perform operations required for the boot process on the storage device 150 or other devices.

值得說明的是,前述運作可以是電腦系統100的處理器(未繪示)自韌體介面130載入對應程式碼至系統記憶體後執行,也可能是透過特定晶片處理,本發明實施例不加以限制。It is worth noting that the foregoing operation may be executed by the processor (not shown) of the computer system 100 after loading the corresponding program code from the firmware interface 130 into the system memory, or may be processed through a specific chip. The embodiment of the present invention does not Be restricted.

儲存裝置150耦接韌體介面130,儲存裝置150並可以是任何類型的傳統硬碟(Hard Disk Drive,HDD)、固態硬碟(Solid-State Drive,SSD)或類似元件或上述元件之組合的儲存器。The storage device 150 is coupled to the firmware interface 130. The storage device 150 can be any type of traditional hard disk (Hard Disk Drive, HDD), solid-state drive (SSD) or similar components or a combination of the above components Storage.

在本發明實施例中,儲存裝置150的儲存空間包括預留空間155。舉例而言,圖4是依據本發明一實施例的儲存裝置150的儲存空間SS的配置圖。請參照圖4,此預留空間RS可以是超額配置(Over-Provisioning,OP)、或其他類型的分割區,且可由儲存裝置150出廠時即預設或出廠後由使用者配置。In the embodiment of the present invention, the storage space of the storage device 150 includes a reserved space 155. For example, FIG. 4 is a configuration diagram of the storage space SS of the storage device 150 according to an embodiment of the present invention. Referring to FIG. 4, the reserved space RS may be an over-provisioning (OP) or other types of partitions, and may be preset by the storage device 150 when it leaves the factory or configured by the user after it leaves the factory.

預留空間155可被隱藏且/或作業系統的檔案系統或特定驅動程式對其存取行為將受限制。通常,使用者的一般檔案(例如,音樂、影片、文件等)不會儲存於預留空間155。預留空間155可儲存儲存裝置150的裝置資訊、組態設定、及/或快取內容等資料或檔案。後續實施例將進一步說明其用途。The reserved space 155 can be hidden and/or the file system of the operating system or a specific driver will restrict its access behavior. Generally, users' general files (for example, music, videos, documents, etc.) are not stored in the reserved space 155. The reserved space 155 can store data or files such as device information, configuration settings, and/or cache content of the storage device 150. Subsequent examples will further illustrate its use.

需說明的是,圖4所示預留空間RS位於儲存空間SS的最後分割區。然而,在其他實施例中,預留空間RS在儲存空間SS的位置可能會改變。It should be noted that the reserved space RS shown in FIG. 4 is located in the last partition of the storage space SS. However, in other embodiments, the position of the reserved space RS in the storage space SS may be changed.

為了方便理解本發明實施例的操作流程,以下將舉諸多實施例詳細說明本發明實施例中對儲存裝置150的開機流程。下文中,將搭配電腦系統100的各項元件及模組說明本發明實施例所述之方法。本方法的各個流程可依照實施情形而隨之調整,且並不僅限於此。In order to facilitate the understanding of the operation process of the embodiment of the present invention, a number of embodiments will be given below to describe in detail the boot process of the storage device 150 in the embodiment of the present invention. Hereinafter, various components and modules of the computer system 100 will be used to describe the method according to the embodiment of the present invention. Each process of the method can be adjusted accordingly according to the implementation situation, and it is not limited to this.

圖5是依據本發明一實施例用於儲存裝置150的開機控制方法的流程圖。本發明實施例將會分別說明兩種模式下針對儲存裝置150的開機程序。請參照圖5,反應於快速儲存技術(RST)模式,韌體介面130可對儲存裝置150存取預留空間155中的元資料(步驟SS)。具體而言,此元資料是相關於RST模式下的開機設定。例如,硬碟組裝資訊、或其他RST相關資訊。韌體介面130取得完整且正確的元資料後,RST模式下的開機程序才能順利完成(例如,接續回報啟動分割區、讀取分割表資訊等)。值得注意的是,本發明實施例的預留空間155的存取受到限制。此限制可能是僅供特定驅動程式、韌體程式、應用程式、或指令存取,或者是其他形式的限制、權限或保護。而在RST模式下,預留空間155可允許受韌體介面130存取以讀取RST相關的元資料。以下將說明的詳細流程。FIG. 5 is a flowchart of a boot control method for the storage device 150 according to an embodiment of the present invention. The embodiment of the present invention will separately describe the booting procedures for the storage device 150 in the two modes. Referring to FIG. 5, in response to the rapid storage technology (RST) mode, the firmware interface 130 can access the metadata in the reserved space 155 to the storage device 150 (step SS). Specifically, this metadata is related to the boot settings in RST mode. For example, hard disk assembly information, or other RST related information. After the firmware interface 130 obtains complete and correct metadata, the boot process in the RST mode can be successfully completed (for example, continue to report the boot partition, read the partition table information, etc.). It should be noted that access to the reserved space 155 in the embodiment of the present invention is restricted. This restriction may be for specific drivers, firmware programs, applications, or command access, or other forms of restrictions, permissions, or protection. In the RST mode, the reserved space 155 can be accessed by the firmware interface 130 to read the metadata related to the RST. The detailed flow will be explained below.

圖6是依據本發明一實施例針對RST模式的開機程序的流程圖。請參照圖6,電腦系統100開機(步驟S610,可能是透過開機鍵被按壓、遠端啟動或其他啟動方式)後,韌體介面130(以BIOS為例,但也可能是其他介面系統)初始以執行開機程序(步驟S620)。韌體介面130可判斷儲存裝置150是否支援延伸空間功能(步驟S630)。此延伸空間功能相關於存在預留空間155。在一實施例中,韌體介面130透過識別裝置(identify device)命令對儲存裝置150讀取對應參數,此對應參數包括延伸邏輯區塊位址功能(Extended LBA feature),且延伸邏輯區塊位址相關於是否支援延伸空間功能。FIG. 6 is a flowchart of a boot procedure for RST mode according to an embodiment of the present invention. Please refer to FIG. 6, after the computer system 100 is booted (step S610, which may be by pressing the boot button, remote booting, or other booting methods), the firmware interface 130 (using BIOS as an example, but may also be other interface systems) is initialized To execute the booting procedure (step S620). The firmware interface 130 can determine whether the storage device 150 supports the extended space function (step S630). This extended space function is related to the existence of reserved space 155. In one embodiment, the firmware interface 130 reads corresponding parameters from the storage device 150 through an identify device command. The corresponding parameters include the extended LBA feature and the extended logical block bit. The address is related to whether to support the extended space function.

舉例而言, 圖7是一範例說明識別裝置命令的對應參數。請參照圖7,在識別裝置命令的對應參數中,固定且未在現有規範定義的某一位置統一定義為延伸邏輯區塊位址功能ELF。若此位置上的延伸邏輯區塊位址功能ELF的值為0,則代表儲存裝置150未支援此功能(例如,未配置預留空間155或預留空間155中未儲存RST相關的元資料等)。若此位置有值(例如,1、3或其他數值),則代表儲存裝置150支援此功能(例如,已配置預留空間155或預留空間155中已儲存RST相關的元資料等),且此數值代表可供系統擴展的空間(例如,預留空間155的大小或元資料的大小等,且可能是以百萬位元組(Megabyte,MB)或其他空間單位計算)。For example, FIG. 7 is an example illustrating the corresponding parameters of the identification device command. Please refer to FIG. 7, among the corresponding parameters of the identification device command, a fixed location that is not defined in the existing specification is uniformly defined as an extended logical block address function ELF. If the value of the extended logical block address function ELF at this location is 0, it means that the storage device 150 does not support this function (for example, the reserved space 155 is not configured or the RST-related metadata is not stored in the reserved space 155, etc. ). If this location has a value (for example, 1, 3 or other values), it means that the storage device 150 supports this function (for example, the reserved space 155 has been configured or the RST-related metadata has been stored in the reserved space 155, etc.), and This value represents the space available for system expansion (for example, the size of the reserved space 155 or the size of metadata, etc., and may be calculated in megabytes (MB) or other space units).

需說明的是,在其他實施例中,延伸空間功能的指示也能是在識別裝置參數中的其他位置,且其上的數值定義可依據需求而改變。在另一實施例中,儲存裝置150的韌體也能定義有其他指令,以供韌體介面130詢問是否支援延伸空間功能。It should be noted that, in other embodiments, the indication of the extended space function can also be in other positions in the identification device parameters, and the value definitions thereon can be changed according to requirements. In another embodiment, the firmware of the storage device 150 can also be defined with other commands for the firmware interface 130 to inquire whether it supports the extended space function.

請參照圖6,若支援延伸空間功能,則韌體介面130對儲存裝置150發送存取指令。此存取指令可能是廠商特定指令(Vendor specific command),且韌體介面130的預先作業系統 (PreOS)可透過此存取命令要求儲存裝置150提取出可供存取的空間(或者,儲存裝置150出廠後即保留特定大小的空間(例如,10、20或50MB等))。儲存裝置150接收到此存取命令後,將依據此存取命令回應韌體介面130可供讀取的實體位址(即,元資料在儲存裝置150的儲存空間中所儲存的位置)。此作法能夠有效保護預留空間155僅供RST模式才有權限讀取。此存取命令可視為有權限讀取的關鍵。因此,儲存裝置150需要支援此存取命令,且當接收到此存取命令後,其韌體即會將儲存裝置150中可供存取的位置空間回應韌體介面130。接著,韌體介面130解析回報的對應參數(即,前述實體位址)(步驟S640),即可對此預留空間155存取。Referring to FIG. 6, if the extended space function is supported, the firmware interface 130 sends an access command to the storage device 150. The access command may be a vendor specific command (Vendor specific command), and the pre-operating system (PreOS) of the firmware interface 130 can request the storage device 150 to extract the accessible space (or, the storage device) through this access command. After the 150 leaves the factory, a certain size of space (for example, 10, 20, or 50 MB, etc.) is reserved). After the storage device 150 receives the access command, it responds to the physical address (ie, the location where the metadata is stored in the storage space of the storage device 150) that can be read by the firmware interface 130 according to the access command. This method can effectively protect the reserved space 155 to be read only in RST mode. This access command can be regarded as the key to authorized reading. Therefore, the storage device 150 needs to support this access command, and after receiving the access command, its firmware will respond to the firmware interface 130 with the accessible location space in the storage device 150. Then, the firmware interface 130 analyzes the reported corresponding parameters (ie, the aforementioned physical address) (step S640), and the reserved space 155 can be accessed.

需說明的是,在其他實施例中,預留空間155的實體位址亦可能是儲存在識別裝置命令的對應參數中、或其他位置。It should be noted that, in other embodiments, the physical address of the reserved space 155 may also be stored in the corresponding parameter of the identification device command, or other locations.

接著,韌體介面130可依據前述提取的實體位址自預留空間155中取得RST相關的元資料(步驟S650)。由於Intel定義的用於儲存元資料的空間大約為10MB左右,而預留空間155通常占所有儲存空間的7%~28%,因此預留空間155足夠儲存元資料,且不會造成額外的影響。以圖4的空間配置為例,預留空間RS可儲存RST相關的元資料MD。接著,依據元資料,開機分割區可被回報給韌體介面130(步驟S660)。Then, the firmware interface 130 can obtain the RST-related metadata from the reserved space 155 according to the extracted physical address (step S650). The space defined by Intel for storing metadata is about 10MB, and the reserved space 155 usually occupies 7% to 28% of all storage space, so the reserved space 155 is sufficient to store metadata without causing additional impact . Taking the space configuration of FIG. 4 as an example, the reserved space RS can store the metadata MD related to the RST. Then, according to the metadata, the boot partition can be reported to the firmware interface 130 (step S660).

藉此,產品廠商不需要再為RST模式而自儲存裝置150的儲存空間中額外切出一塊空間供其存取元資料。當系統為RST模式時,驅動程式可自主創建用於儲存其元資料的空間。當然,唯一的存取權限可僅供RST相關驅動程式。當預留空間155受限制存取時,即可避免使用者的誤用而損毀其元資料。In this way, the product manufacturer does not need to cut an extra space from the storage space of the storage device 150 in the RST mode for it to access the metadata. When the system is in RST mode, the driver can independently create space for storing its metadata. Of course, the only access permission can be only for RST related drivers. When the reserved space 155 is restricted to access, the user's misuse and damage to its metadata can be avoided.

另一方面,請參照圖5,反應於AHCI模式,韌體介面130將分割區資訊儲存在儲存裝置150中預留空間155以外的空間(步驟S530)。具體而言,在AHCI模式下,韌體介面130的AHCI驅動程式不/禁能判斷儲存裝置150是否支援延伸空間功能(例如,不檢查延伸邏輯區塊位址功能),更不會進一步寫入資料於預留空間155、或自預留空間155存取RST相關的元資料。因此,諸如次要GTP資訊、或其他分割區相關資訊不會覆蓋到預留空間155內的資料。此外,在AHCI模式下,儲存裝置150回報給韌體介面130其可供存取的空間將會排除預留空間155。因此,韌體介面130僅會將分割區資訊記錄在預留空間155以外的位置。On the other hand, referring to FIG. 5, in response to the AHCI mode, the firmware interface 130 stores the partition information in a space other than the reserved space 155 in the storage device 150 (step S530). Specifically, in the AHCI mode, the AHCI driver of the firmware interface 130 cannot/disable to determine whether the storage device 150 supports the extended space function (for example, does not check the extended logical block address function), and will not further write The data is accessed in the reserved space 155 or from the reserved space 155 to access the metadata related to the RST. Therefore, information such as secondary GTP information or other partition-related information will not cover the data in the reserved space 155. In addition, in the AHCI mode, the space that the storage device 150 reports to the firmware interface 130 will exclude the reserved space 155. Therefore, the firmware interface 130 only records partition information in locations other than the reserved space 155.

以圖4的空間配置為例,韌體介面130會在儲存空間中最後的LBA寫入次要GPT資訊(Secondary GPT information)S_GPT。即,可寫入空間(預留空間RS以外的空間)中的最後一個位置。藉此,即便自AHCI模式切換回RST模式,預留空間RS所儲存的資料(例如,元資料MD)因未被次要GPT資訊S_GPT覆蓋而能順利被讀取。Taking the space configuration of FIG. 4 as an example, the firmware interface 130 will write the secondary GPT information (Secondary GPT information) S_GPT in the last LBA in the storage space. That is, the last position in the writable space (the space other than the reserved space RS). In this way, even if the AHCI mode is switched back to the RST mode, the data (for example, the metadata MD) stored in the reserved space RS can be read smoothly because it is not covered by the secondary GPT information S_GPT.

綜上所述,本發明實施例的電腦系統及用於儲存裝置的開機控制方法,在儲存裝置的預留空間中儲存RST模式相關的元資料。此預留空間可允許受RST驅動程式或特定存取指令要求存取所儲存的元資料,但AHCI驅動程式並不會任意對此預留空間存取。藉此,使用者可任意地在RST及AHCI模式之間切換,都能順利完成開機程序。In summary, the computer system and the boot control method for the storage device according to the embodiments of the present invention store metadata related to the RST mode in the reserved space of the storage device. This reserved space can be requested by the RST driver or specific access commands to access the stored metadata, but the AHCI driver does not arbitrarily access this reserved space. In this way, the user can switch between RST and AHCI modes arbitrarily, and can successfully complete the boot process.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the relevant technical field can make some changes and modifications without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be subject to those defined by the attached patent application scope.

AHCI:AHCI驅動程式 RST:RST驅動程式 MBR:主開機紀錄 M_GPT:主要GPT資訊 S_GPT:次要GPT資訊 S201~S207、S211~S217、S510~S530、S610~S660:步驟 100:電腦系統 130:韌體介面 150:儲存裝置 155、RS:預留空間 SS:儲存空間 MD:元資料 ELF:延伸邏輯區塊位址功能AHCI: AHCI driver RST: RST driver MBR: Master Boot Record M_GPT: Main GPT information S_GPT: Secondary GPT information S201~S207, S211~S217, S510~S530, S610~S660: steps 100: computer system 130: Firmware interface 150: storage device 155, RS: reserved space SS: storage space MD: Metadata ELF: extended logical block address function

圖1是習知技術兩種模式在開機程序中對儲存裝置存取的示意圖。 圖2是習知技術兩種模式在開機程序中對儲存裝置存取的流程圖。 圖3是依據本發明一實施例的電腦系統的元件方塊圖。 圖4是依據本發明一實施例的儲存裝置的儲存空間的配置圖。 圖5是依據本發明一實施例用於儲存裝置的開機控制方法的流程圖。 圖6是依據本發明一實施例針對快速儲存技術模式的開機程序的流程圖。 圖7是一範例說明識別裝置命令的對應參數。 FIG. 1 is a schematic diagram of access to a storage device in the boot process in two modes of the prior art. FIG. 2 is a flowchart of access to the storage device in the boot process in two modes of the prior art. FIG. 3 is a block diagram of components of a computer system according to an embodiment of the invention. FIG. 4 is a configuration diagram of a storage space of a storage device according to an embodiment of the present invention. FIG. 5 is a flowchart of a boot control method for a storage device according to an embodiment of the present invention. FIG. 6 is a flowchart of a boot procedure for a fast storage technology mode according to an embodiment of the present invention. Fig. 7 is an example illustrating the corresponding parameters of the command of the recognition device.

S510~S530:步驟 S510~S530: steps

Claims (10)

一種電腦系統,包括: 一儲存裝置,配置有一預留空間,其中該預留空間儲存一元資料(metadata),且該元資料相關於一快速儲存技術(Rapid Storage Technology,RST)模式下的開機設定;以及 一韌體介面,耦接該儲存裝置,其中,在一開機程序中, 反應於該快速儲存技術模式,該韌體介面對該儲存裝置存取該預留空間中的該元資料;以及 反應於一進階主機控制器介面(Advanced Host Controller Interface,AHCI)模式,該韌體介面將該儲存裝置的一分割區(partition)資訊儲存在該儲存裝置中該預留空間以外的空間。 A computer system including: A storage device configured with a reserved space, wherein the reserved space stores metadata, and the metadata is related to the boot setting in a Rapid Storage Technology (RST) mode; and A firmware interface, coupled to the storage device, where, in a boot process, In response to the fast storage technology mode, the firmware interface accesses the metadata in the reserved space to the storage device; and In response to an Advanced Host Controller Interface (AHCI) mode, the firmware interface stores a partition information of the storage device in a space other than the reserved space in the storage device. 如申請專利範圍第1項所述的電腦系統,其中該韌體介面發送一存取指令,且該儲存裝置依據該存取指令回應該元資料在該儲存裝置中的位置。For the computer system described in claim 1, wherein the firmware interface sends an access command, and the storage device responds to the location of the metadata in the storage device according to the access command. 如申請專利範圍第1項所述的電腦系統,其中該韌體介面判斷該儲存裝置是否支援一延伸空間功能,且該韌體介面反應於支援該延伸空間功能而對該預留空間存取,其中該延伸空間功能相關於存在該預留空間。For example, the computer system described in claim 1, wherein the firmware interface determines whether the storage device supports an extended space function, and the firmware interface responds to supporting the extended space function to access the reserved space, The function of the extended space is related to the existence of the reserved space. 如申請專利範圍第3項所述的電腦系統,其中該韌體介面透過識別裝置(identify device)命令讀取對應參數,該對應參數包括一延伸邏輯區塊位址(Logical Block Address,LBA)功能(Extended LBA feature),且該延伸邏輯區塊位址相關於是否支援該延伸空間功能。The computer system described in item 3 of the scope of patent application, wherein the firmware interface reads corresponding parameters through an identify device command, and the corresponding parameters include an extended logical block address (LBA) function (Extended LBA feature), and the extended logical block address is related to whether the extended space function is supported. 如申請專利範圍第3項所述的電腦系統,其中 反應於該進階主機控制器介面模式,該韌體介面不判斷該儲存裝置是否支援該延伸空間功能。 Such as the computer system described in item 3 of the scope of patent application, in which In response to the advanced host controller interface mode, the firmware interface does not determine whether the storage device supports the extended space function. 一種用於儲存裝置的開機控制方法,包括: 提供一儲存裝置,其中該儲存裝置配置有一預留空間,該預留空間儲存一元資料,且該元資料相關於一快速儲存技術模式下的開機設定; 反應於該快速儲存技術模式,對該儲存裝置存取該預留空間中的該元資料;以及 反應於一進階主機控制器介面模式,將該儲存裝置的一分割區資訊儲存在該儲存裝置中該預留空間以外的空間。 A boot control method for a storage device, including: Provide a storage device, wherein the storage device is configured with a reserved space, the reserved space stores metadata, and the metadata is related to the boot setting in a fast storage technology mode; In response to the fast storage technology mode, access the metadata in the reserved space to the storage device; and In response to an advanced host controller interface mode, a partition information of the storage device is stored in a space other than the reserved space in the storage device. 如申請專利範圍第6項所述的用於儲存裝置的開機控制方法,其中對該儲存裝置存取該預留空間中的該元資料的步驟包括: 發送一存取指令;以及 依據該存取指令回應該元資料在該儲存裝置中的位置。 The boot control method for a storage device as described in item 6 of the scope of patent application, wherein the step of accessing the metadata in the reserved space to the storage device includes: Send an access command; and According to the access command, the location of the metadata in the storage device is responded. 如申請專利範圍第6項所述的用於儲存裝置的開機控制方法,其中對該儲存裝置存取該預留空間中的該元資料的步驟包括: 判斷該儲存裝置是否支援一延伸空間功能; 反應於支援該延伸空間功能而對該預留空間存取,其中該延伸空間功能相關於存在該預留空間。 The boot control method for a storage device as described in item 6 of the scope of patent application, wherein the step of accessing the metadata in the reserved space to the storage device includes: Determine whether the storage device supports an extended space function; The reserved space is accessed in response to supporting the function of the extended space, wherein the function of the extended space is related to the existence of the reserved space. 申請專利範圍第8項所述的用於儲存裝置的開機控制方法,其中判斷該儲存裝置是否支援該延伸空間功能的步驟包括: 透過識別裝置命令讀取對應參數,該對應參數包括一延伸邏輯區塊位址功能,且該延伸邏輯區塊位址相關於是否支援該延伸空間功能。 The boot control method for a storage device described in item 8 of the scope of patent application, wherein the step of determining whether the storage device supports the extended space function includes: The corresponding parameter is read through the identification device command, the corresponding parameter includes an extended logical block address function, and the extended logical block address is related to whether the extended space function is supported. 申請專利範圍第8項所述的用於儲存裝置的開機控制方法,更包括: 反應於該進階主機控制器介面模式,不判斷該儲存裝置是否支援該延伸空間功能。 The boot control method for storage device described in item 8 of the scope of patent application further includes: In response to the advanced host controller interface mode, it is not determined whether the storage device supports the extended space function.
TW108146170A 2019-12-17 2019-12-17 Computer system and boot controlling method for storage apparatus TWI731515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108146170A TWI731515B (en) 2019-12-17 2019-12-17 Computer system and boot controlling method for storage apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108146170A TWI731515B (en) 2019-12-17 2019-12-17 Computer system and boot controlling method for storage apparatus

Publications (2)

Publication Number Publication Date
TWI731515B true TWI731515B (en) 2021-06-21
TW202125225A TW202125225A (en) 2021-07-01

Family

ID=77517336

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108146170A TWI731515B (en) 2019-12-17 2019-12-17 Computer system and boot controlling method for storage apparatus

Country Status (1)

Country Link
TW (1) TWI731515B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI299450B (en) * 2005-03-04 2008-08-01 Super Talent Electronics Inc A multi mode host and device having multiple communication protocols, a single mode device, and methods of initializing the host or device using an electrical receptacle or plug in order to perform data communications
TWI359568B (en) * 2007-05-08 2012-03-01 Nat Semiconductor Corp Data conversion diagnostic bit in a data converter
TWI571738B (en) * 2015-08-13 2017-02-21 瑞昱半導體股份有限公司 Storage device, method capable of accelerating booting procedure and storage controller
TW201734800A (en) * 2016-03-17 2017-10-01 微星科技股份有限公司 Method for setting redundant array of independent disks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI299450B (en) * 2005-03-04 2008-08-01 Super Talent Electronics Inc A multi mode host and device having multiple communication protocols, a single mode device, and methods of initializing the host or device using an electrical receptacle or plug in order to perform data communications
TWI359568B (en) * 2007-05-08 2012-03-01 Nat Semiconductor Corp Data conversion diagnostic bit in a data converter
TWI571738B (en) * 2015-08-13 2017-02-21 瑞昱半導體股份有限公司 Storage device, method capable of accelerating booting procedure and storage controller
TW201734800A (en) * 2016-03-17 2017-10-01 微星科技股份有限公司 Method for setting redundant array of independent disks

Also Published As

Publication number Publication date
TW202125225A (en) 2021-07-01

Similar Documents

Publication Publication Date Title
US6948165B1 (en) Method for installing an application program, to be executed during each bootload of a computer system for presenting a user with content options prior to conventional system startup presentation, without requiring a user's participation to install the program
US6691213B1 (en) Computer system and method for accessing a protected partition of a disk drive that lies beyond a limited address range of a host computer's BIOS
US6772281B2 (en) Disk drive for selectively satisfying a read request from a host computer for a first valid data block with a second valid data block
US6480932B1 (en) Computer system having a host computer coupled to a disk drive with a drive-selected-application partition for storing data for execution by the host computer in response to drive-determined conditions
US7702894B2 (en) System and method for loading programs from HDD independent of operating system
US6963951B2 (en) Partition recovery method
JP4371771B2 (en) Power management block used in non-volatile memory system
US8266611B2 (en) Hard disk drive with disk embedded DOS boot image and firmware download method
KR20050015972A (en) Apparatus and method for controlling booting of computer system
JP2006236193A (en) Starting program execution method, device, storage medium and program
US8433847B2 (en) Memory drive that can be operated like optical disk drive and method for virtualizing memory drive as optical disk drive
US6728830B1 (en) Method and apparatus for modifying the reserve area of a disk drive
US20040044886A1 (en) Partition recovery method
US8370612B2 (en) Computer system with built-in hidden two operating devices
US7822937B2 (en) Method and apparatus for modifying reserve area of disk drive or memory
CN101788913B (en) Computer system with double operating devices and monitoring method thereof
US9946479B2 (en) Direct hinting for a memory device
TWI731515B (en) Computer system and boot controlling method for storage apparatus
JP5072702B2 (en) Storage device control device, storage device, and storage device control method
CN115756620A (en) Method and system for starting NVME (network video management entity) hard disk of server and related equipment
JP4735765B2 (en) Linux program startup system
US7975136B1 (en) Hardware-independent detection of SAN logical volumes
WO2014091629A1 (en) Storage-device management program, and management method for electronic device and storage device
KR20050032902A (en) Data backup and recovery method
KR20060095133A (en) Method for operating system program stored in non-volatile memory