TW201005643A - Backup system of embedded system for storing booting files in different storage sections and method thereof - Google Patents

Backup system of embedded system for storing booting files in different storage sections and method thereof Download PDF

Info

Publication number
TW201005643A
TW201005643A TW97127538A TW97127538A TW201005643A TW 201005643 A TW201005643 A TW 201005643A TW 97127538 A TW97127538 A TW 97127538A TW 97127538 A TW97127538 A TW 97127538A TW 201005643 A TW201005643 A TW 201005643A
Authority
TW
Taiwan
Prior art keywords
file
backup
boot data
data file
boot
Prior art date
Application number
TW97127538A
Other languages
Chinese (zh)
Inventor
Ben-Ru Liao
Original Assignee
Moxa Inc
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 Moxa Inc filed Critical Moxa Inc
Priority to TW97127538A priority Critical patent/TW201005643A/en
Publication of TW201005643A publication Critical patent/TW201005643A/en

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

A backup system of an embedded system for storing booting files in different storage sections and a method thereof are provided, By generating plurality file systems, defining one of the file systems as a backup file system, storing a backup booting file in the backup file system, and using the backup booting file to boot the embedded system when a normally booting file is unable to boot, the system and the method can therefore solve the problem that a user breaks the backup booting file if the backup booting file stores in a free accessing file system, and further achieve the effect of storing plurality booting files in different file systems for specific embedded systems.

Description

201005643 九、發明說明: 【發明所屬之技術領域】 一種開機備援系統及其方法,特別係指一種將嵌入式 系統之開機資料檔儲存於不同儲存區段中之備援系統及 其方法。 【先前技術】 嵌入式系統,是一種完全嵌入電子裝置内部,為特定 ❹ 應用没計的專用電腦系統。與個人電腦這樣的通用電腦系 統不同,嵌入式系統通常執行的是帶有特定要求的預先定 義的任務。在大部分的情況下,嵌入式系統通常需要能夠 長時間的正確運行’所以它們的軟體的開發和測試都要比 個人電腦上的軟體更為仔細。 在敢入式系統中,為了避免無法正常開機,運行在嵌 入式系統的作業系統通常都會有開機的備援機制,目前, 在不需要依靠額外的裝置進行備援的條件下,嵌入式系統 〇 的開機備援機制大致上分為兩種,一種是將備援的開機資 料檔以及一般使用的開機資料檔存放在不同的實體的儲 存媒體上,例如以記憶體儲存一般使用的開機資料標,並 以其他的儲存媒體儲存備援的開機資料檔,備援的開機資 料檔在一般使用的開機資料檔無法開機時被讀取,藉以完 成開機程序,使得電子裝置可以順利開機。 開機備援的另一種機制則是在一個儲存媒體中同時 儲存一般使用的開機資料檔以及備援的開機資料檔,在這 個機制中,一般使用的開機資料檔以及備援的開機資料檔 5 201005643 可能存放於同一個磁區,也可能存放於不同的磁區,但不 論一般使用的開機資料檔以及備援的開機資料檔是否存 放在同一個磁區中,在一般使用的開機資料稽無法完成開 機程序時,嵌入式系統會直接由備援的開機資料檔所存放 在儲存媒體中的位址,直接將備援的開機資料檔讀取出 來’藉以完成開機程式’使得嵌入式系統可以順利開機。 雖然目前已經有了上述幾種備援的方式,但由於部分 特定的嵌入式系統的作業系統在已公開的官方資料中,並 ;又有辦法使用兩個以上的磁區’所以無法將備援的開機資 料檔存放在與一般使用的開機資料檔不同的磁區,因此, 若儲存媒體需要提供給使用者自由使用,則勢必要將備援 的開機資料檔與一般使用的開機資料檔都存放於使用者 可以自由存取的磁區之中。 由於目前大部分嵌入式系統所使用的儲存媒體為快 間§己憶體(Flash) ’而要存取快閃記憶體中的資料時,需 要以一個區塊(block)為單位,也就是說,即使要存取的 資料只有一個位元組(byte),也還是會對整個區塊進行讀 寫。若如「第1圖」所示,假設快閃記憶體1〇〇中分為許 多個區塊’當一般使用的開機資料檔存放在第二區塊112 以及第三區塊113中時,但第三區塊113僅有較前面的區 段113a存放開機資料檀’若使用者可以自由存取存放有 一般使用的開機資料槽’則使用者的資料將有可能被存放 在弟二區塊113的較後面的區段113b,此時,第:r區塊 113中的負料會先被項取到§己憶體中,並在記憶體中將使 6 201005643 用者的資料更新,接著第三區塊113中的資料會被全數清 除’之後’記憶體中經過更新的資料會被寫回第三區塊113 中’藉以完成使用者的資料的寫入。 在上述寫入使用者的資料至第三區塊113的過程中, 若在清除第三區塊113中的資料後,嵌入式系統發生斷電 等異常狀況’使得更新後的資料沒有寫入第三區塊Π3 中’如此,將會造成一般使用的開機資料檔不完整,使得 ❾ 内嵌式系統無法正常開機,同樣的,若備援的開機資料檔 也存放在同一個磁區中,也會有開機資料檔不完整的問 題’使得一般使用者開機資料檔以及備援的開機資料檔都 無法開機。 综上所述’可知先前技術中長期以來一直存在備援開 機資料檔存放於使用者可以自由存取的儲存區段時,可能 • 會被使用者損毀而無法進行開機備援的問題,因此有必要 . 提出改進的技術手段,來解決此一問題。 ® 【發明内容】 有鑒於先前技術存在的備援開機資料檔存放於使用 者可以自由存取的儲存區段時,可能會被使用者損毀而無 法進行開機備援的問題,本發明遂揭露一種將嵌入式系統 之開機資料檔儲存於不同儲存區段中之備援系統及其方 法,其中: 本發明所揭露之將欲入式系統之開機資料標儲存於 不同儲存區段中之備援系統,其包括有:快閃記憶體;槽 案系統生成模組,用以以對應快閃記憶體之複數個存取範 7 201005643 圍參數執行快閃記憶體驅動程式(Flash Media Driver, FMD) ’藉以生成分別存取快閃記憶體中之不同儲存區段 之檔案系統,其中儲存區段對應於存取範圍參數;檔案系 統定義模組,用以定義檔案系統其中之一為備援檔案系 統,及定義非備援檔案系統之檔案系統為主要檔案系統; 系統開機模組,用以透過主要檔案系統讀取第一開機資料 樓,並以第一開機資料檔開機,及於偵測到無法以第一開 機資料檔正常開機時,透過備援檔案系統讀取第二開機資 料檔’並以第二開機資料檔開機,其透過檔案系統生成模 組生成多個檔案系統,並由檔案系統定義模組定義存放第 二開機資料檔的備援檔案系統,來解決先前技術所存在的 問題。 本發明所揭露之將嵌入式系統之開機資料檔儲存於 不同儲存區段中之備援方法,其包括有下列步驟:以對應 快閃記億體之複數個存取範圍參數執行快閃記憶體驅動 程式’藉以生成分別存取快閃記憶體中之不同儲存區段之 樓案系統’其中儲存區段對應於存取範圍參數;設定檔案 系統其中之一為備援檔案系統;設定非備援檔案系統之檔 案系統為主要檔案系統;透過主要檔案系統讀取第一開機 資料槽’並以第一開機資料樓開機;偵測無法以第一開機 資料檔正常開機時,透過備援檔案系統讀取第二開機資料 檔’並以第二開機資料檔開機’其透過在生成多個檔案系 統後,設定存放第二開機資料檔的備援檔案系統,並在無 法使用第一開機資料檔開機時,以備援檔案系統的第二開 8 201005643 機貝料檔開機,來解決先前技術所存在的問題。 、本發明所m統與方法如上,其與先·術之間 的差異在於本發明可提供内巍式系統生成多個槽案系 統,並以定義其中—個檔齡、統為備援檔錄統存放第二 開,資料檔’藉以將備援用的第二開機資繼與-般使用 ,的第—_資韻魏於不同職祕巾。透過上述的技 術手段’本發明可崎成提供蚊嵌人絲統以不同的槽 e 案系統儲存多個開機資料檔的技術功效。 【實施方式】 以下將配合圖式及實施例來詳細說明本發明之詳細 特徵與實施方式,内容足以使任何熟習侧技藝者輕易地 理解本發明解決技術問題所應用的技術手段並據以實 施,及理解實現本發明可達成的功效。 本發明所提的嵌入式系統包含但不限於車用電腦、電 視機上盒(Set Top Box)、生產線上的控制設備、公共場 ❹ 所的寅訊站、智慧型手機(Smart Phone )或個人數位助理 (PDA)等’有些裝置甚至沒有任何人機介面。 以下先以「第2A圖」本發明所提之將嵌入式系統之 開機資料稽儲存於不同儲存區段中之備援系統之系統架 構圖來說明本發明的系統運作。如「第2A圖」所示,本 發明之系統含有快閃記憶體丨〇 〇、檔案系統生成模組2 j 〇、 槽案系統定義模組220以及系統開機模組230。 快閃記憶體100負責儲存提供包含有本發明的作業系 統200開機所需的第一開機資料檔以及第二開機資料檔。 9 201005643 一般而言,快閃記憶體100中還儲存有Bootloader,Boot 1〇ader會儲存在快閃記憶體100的第一個區塊(Block)中。 快閃圮憶體1 〇〇會以Hive-Based之技術儲存第一開機 資料標以及第二開機資料檔,第-開機資料檔以及第二開 機資料樓係執行有本發明之谈人式系統在_時所必須 要載入的檔案。 槽案糸先生成模組21 〇負責執行B〇〇t i〇a(jer _的快閃 ❹ 記憶體驅動程式’藉以生成存取快閃記憶體100的檔案系 統’其中,職系統生成模組210在生成檔案系統的過程 中,會讀取至少-組存取範圍參數作為設定值,藉以限制 被生成的槽案系統在快閃記憶體1〇〇中所能存取的儲存區 段。 上述的存取範圍參數用來定義被生成的標案系統可 雜的範圍’包含但秘於起始位址以及區段長度,起始 位址用來设疋檔案系統可以存取的起點,區段長度與起始 ❹ 姆相加之後,可喊錯㈣統可以縣的終點。例 如’某組存取範圍參數所包含的起始位址為_〇〇〇1,區 段長度為512ΚBytes,則表示以這組存取範圍參數所生成 的檔案系統所存取的儲存區段為快閃記憶體1〇〇中 0x3麵1至0x400000的位址。本發明所提之存取範圍參 數並不以區段長度與起始位址為限,其他如起始位址與結 束位址等’凡可定-段區間的資料都可讀本發明所 使用。 在本發明中,為了要提供備援的機制,因此檔案系統 201005643 生成模組210需要生成兩個以上的檔案系統,藉以在不同 槽案系統可存取的儲存區段中存放在一般情況下開機的 第一開機資料檔以及備援用的第二開機資料檔,所以,檔 案系統生成模組210至少兩組所讀取的存取範圍參數至少 會有兩組。 若檔案系統生成模組210所生成的檔案系統超過兩 個’則並非所有的檔案系統可存取的儲存區段都會存放開 機貧料檔,也就是說,本發明只需要有兩個檔案系統可存 取的儲存區段可以分別存放第一開機資料檔與第二開機 資料標即可,並不-定需要在所有的職系統可存取的儲 存區段中都存放開機資料檔。 檔案系統定義模組220負責由檔案系統生成模組21〇 所生成的㈣系統巾定義其巾—麵㈣統為備援檔案 系統’並定義非備當案***的其他標案系統為主要擋案 系統。其中,檔案系統定義模組22〇可以由存取範圍參數 中的定義、檔齡統所存取的位址、檔斜統所存取的儲 存區段的大小等方式,觸财祕生賴組⑽所生成 的檔案系财’何麵要被定祕備援檔案祕。一般而 言’存取侧參數巾會包含—個奴值,用來定義存取範 圍^數所定義的存取範圍是否為備援檔織統,但本發明 所提之絲備援顯系統之方式並不以觸存取範圍I 數為限。 月'J述之備援檔案系統所能存取的儲存區段中儲存有 提供備援的第二開機資料檔,由於備援槽耗統是因為備 11 201005643 援機制骑在’因輯m定錢組22〇還會將備援權 案系統的屬性設定為唯讀、隱藏、或唯讀並隱藏等,藉以 讓使用者無法制備錢㈣統而存取備觀的第二開 機資料檔。 月(j述之主要檔案系統則除了提供給使用者自由存取 t外’也儲存了一般開機時所使用的第一開機資料槽。若 4田案系統生成模組加所生成的職祕超過兩個,由於 ❹ 備援播案系統理論上只需要-個,因此主要稽案系統將會 有兩個以上,不過本發明巾只f有其巾-個主要檔案系統 可存取的儲存區段中存放有第一開機資料檔,即可提供系 統開機模組230進行開機。 系統開機模組230負責透過主要檔案系統讀取第一開 機貧料槽’並伽第m韻進行賴,而當系統開 機模組230偵測到以第一開機資料檔並無法完成正常開機 的程序時,會透過備援檔案系統讀取第二開機資料檔,並 ❷ 使用第二開機資料檔進行開機程序,使得備援的機制順利 完成。 為了讓檔案系統生成模組210所生成的各個檔案系統 可以同時運行而不發生問題,所以需要修改習知之嵌入式 系統的作業系統的部分程式碼,也就是說,本發明會修改 習知之快閃記憶體驅動程式,修改後的快閃記憶體驅動程 式中’函式名稱為 FMD—Init、FMD_EraseBl〇ck、 FMD—OEMloControl 以及 FMD_WriteSector 等有執行資料 寫入的函式會被加入同步化(Synchronization)的程式片 12 201005643 =讀案系統生成模組21G所生成的各個檔案系統都 =有同步單元2111’如「第2BK」所示’同步單元2111 案系統寫人資料至賴案系統可料的儲存區 &amp;中日^’進行寫入鎖定(write lock)、寫入資料、解除寫 入鎖定等同步化的處理’藉以避免齡系統在存取資料時 產生死結(DeadL〇ck)或檔案寫入錯誤等問題。 接著以一個實施例來解說本發明的運作系統與方 法丄並請參照「第3圖」本發明所提之將嵌人式系統之開 機貝料檔儲存於不同儲存區段中之備援方法之方法流程 圖。假設在本實施例中,快閃記憶體的儲存空間為2M Bytes。 e201005643 IX. Description of the invention: [Technical field of invention] A boot backup system and method thereof, in particular, a backup system for storing an boot data file of an embedded system in different storage sections and a method thereof. [Prior Art] An embedded system is a dedicated computer system that is completely embedded in an electronic device and is not used for a specific application. Unlike general-purpose computer systems such as personal computers, embedded systems typically perform pre-defined tasks with specific requirements. In most cases, embedded systems often need to be able to run correctly for long periods of time. So their software is developed and tested more carefully than software on a personal computer. In the dare-in system, in order to avoid the failure to boot properly, the operating system running in the embedded system usually has a backup mechanism for booting. Currently, the embedded system is not required to rely on additional devices for backup. The boot-on backup mechanism is roughly divided into two types. One is to store the backup boot data file and the commonly used boot data file on different physical storage media, for example, the boot data file generally used for memory storage. And the other storage media stores the backup boot data file, and the backup boot data file is read when the commonly used boot data file cannot be turned on, so that the boot program is completed, so that the electronic device can be booted smoothly. Another mechanism for booting backup is to store the commonly used boot data file and the backup boot data file in a storage medium. In this mechanism, the commonly used boot data file and the backup boot data file 5 201005643 It may be stored in the same magnetic area, or it may be stored in different magnetic areas. However, regardless of whether the commonly used boot data file and the backup boot data file are stored in the same magnetic area, the commonly used boot data cannot be completed. When the program is booted, the embedded system will directly store the address of the backup boot data file in the storage medium, and directly read the backup boot data file to "enable the boot program" to enable the embedded system to boot smoothly. . Although there are several ways of redundancy mentioned above, the operating system of some specific embedded systems is in the official information that has been published, and there are ways to use more than two magnetic zones. The boot data file is stored in a different magnetic area than the commonly used boot data file. Therefore, if the storage medium needs to be provided to the user for free use, it is necessary to store the backup boot data file and the commonly used boot data file. In the magnetic area that the user can freely access. Since most of the embedded media currently use the storage medium to access the data in the flash memory, it needs to be in units of blocks. Even if there is only one byte (byte) to access the data, the entire block will be read and written. As shown in "Figure 1," it is assumed that the flash memory 1 is divided into a plurality of blocks. When the commonly used boot data file is stored in the second block 112 and the third block 113, The third block 113 only stores the boot data in the upper section 113a. If the user can freely access and store the boot data slot that is generally used, the user's data may be stored in the second block 113. The later section 113b, at this time, the negative material in the r:r block 113 will be taken into the § memory by the item, and the data of the user of the 2010201043 will be updated in the memory, and then The data in the three blocks 113 will be cleared by the full number 'after' the updated data in the memory will be written back to the third block 113 'to complete the writing of the user's data. In the process of writing the user's data to the third block 113, if the data in the third block 113 is cleared, the embedded system is in an abnormal state such as power failure, so that the updated data is not written. In the third block Π3, this will cause the general use of the boot data file to be incomplete, so that the embedded system cannot be booted normally. Similarly, if the backup boot data file is also stored in the same magnetic area, There will be a problem that the boot data file is incomplete, so that the general user boot data file and the backup boot data file cannot be turned on. In summary, it can be seen that in the prior art, there has been a problem that the backup boot data file has been stored in a storage section that the user can freely access, and may be damaged by the user and cannot be turned on. Therefore, Necessary. Suggest improved technical means to solve this problem. ® [Summary of the Invention] In view of the fact that the backup boot data file stored in the prior art is stored in a storage section that the user can freely access, the user may be damaged and unable to perform boot backup. The backup system and method for storing the boot data file of the embedded system in different storage sections, wherein: the backup system for storing the boot data of the desired system in different storage sections disclosed in the present invention The method includes: a flash memory; a slot system generation module for executing a flash memory driver (FMD) with a plurality of access parameters corresponding to the flash memory; 201005643 The file system is respectively configured to access different storage segments in the flash memory, wherein the storage segment corresponds to an access range parameter; and the file system definition module defines one of the file systems as a backup file system. And defining the file system of the non-backup file system as the main file system; the system boot module for reading the first boot data through the main file system Building, and booting with the first boot data file, and detecting that the first boot data file cannot be booted normally, reading the second boot data file through the backup file system and booting with the second boot data file, The file system generation module generates a plurality of file systems, and the file system definition module defines a backup file system for storing the second boot data file to solve the problems of the prior art. The backup method for storing the boot data file of the embedded system in different storage sections according to the present invention includes the following steps: performing flash memory drive with a plurality of access range parameters corresponding to the fast flash memory The program 'creates a building system that accesses different storage sections in the flash memory respectively', wherein the storage section corresponds to the access range parameter; one of the setting file systems is a backup file system; and the non-reserved file is set The file system of the system is the main file system; the first boot data slot is read through the main file system and is turned on by the first boot data building; the detection cannot be read by the backup file system when the first boot data file cannot be booted normally. The second boot data file 'starts with the second boot data file'. After generating multiple file systems, the backup file system for storing the second boot data file is set, and when the first boot data file cannot be used, The second open 8 201005643 machine file file of the backup file system is turned on to solve the problems of the prior art. The difference between the method and the method of the present invention is as follows, and the difference between the first embodiment and the first method is that the intrinsic system can provide a plurality of slot system, and define one of the ages and the system as a backup file. The second storage is stored, and the data file 'by the second power supply for backup is used in the same way as the general use. Through the above technical means, the present invention can provide a technical effect of providing a plurality of boot data files in a different slot system. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The detailed features and embodiments of the present invention will be described in detail below with reference to the drawings and embodiments, which are sufficient to enable the skilled artisan to understand the technical means to which the present invention solves the technical problems. And understanding the achievable effects of the present invention. The embedded system proposed by the present invention includes, but is not limited to, a vehicle computer, a Set Top Box, a control device on a production line, a communication station in a public place, a smart phone, or an individual. Digital assistants (PDAs), etc. 'Some devices don't even have any human interface. The system operation of the present invention will be described below with reference to the system architecture of the backup system for storing the boot data of the embedded system in different storage sections in the "2A". As shown in Fig. 2A, the system of the present invention includes a flash memory 丨〇, a file system generation module 2 j 〇, a slot system definition module 220, and a system boot module 230. The flash memory 100 is responsible for storing the first boot data file and the second boot data file required to boot the operating system 200 including the present invention. 9 201005643 In general, the bootloader is also stored in the flash memory 100, and the Boot 1〇ader is stored in the first block of the flash memory 100. The flash memory module 1 will store the first boot data label and the second boot data file in the Hive-Based technology. The first boot data file and the second boot data system execute the talker system with the present invention. The file that must be loaded when _. Mr. Stub is a module 21 〇 responsible for executing B〇〇 ti〇a (jer _ flash ❹ memory driver 'to generate a file system for accessing flash memory 100 </ RTI> In the process of generating the file system, at least the group access range parameter is read as a set value, thereby limiting the storage section that the generated slot system can access in the flash memory. The access range parameter is used to define the range of the generated standard system that can be miscellaneously included but is secretive to the starting address and the length of the segment. The starting address is used to set the starting point that the file system can access, and the length of the segment. After adding the initial ummu, you can call the wrong (4) system to the end of the county. For example, 'a group of access range parameters contain a starting address of _〇〇〇1, and a section length of 512 Κ Bytes, The storage section accessed by the file system generated by the set of access range parameters is the address of 0x3 face 1 to 0x400000 in the flash memory 1〇〇. The access range parameter proposed by the present invention is not in the section. The length and start address are limited, others are the start address The data of the end address and the like can be read by the present invention. In the present invention, in order to provide a backup mechanism, the file system 201005643 generation module 210 needs to generate more than two file systems. The first boot data file that is normally turned on and the second boot data file for backup are stored in a storage section accessible by different slot systems, so the file system generation module 210 reads at least two groups. There are at least two sets of access range parameters. If the file system generated by the file system generation module 210 exceeds two's, then not all file system accessible storage sections will store the booting poor file, that is to say The invention only needs to have two file system accessible storage sections to store the first boot data file and the second boot data label respectively, and does not need to be stored in all the storage systems of the job system. The boot data file is stored in the segment. The file system definition module 220 is responsible for the (4) system towel generated by the file system generation module 21, and defines the towel-surface (four) system as a backup file. The system's other standard system that defines the non-prepared system is the main file system. Among them, the file system definition module 22 can be defined by the access range parameter, the address and file accessed by the file age system. The size of the storage section accessed by the oblique system, etc., the file system generated by the financial secret squad (10) is to be secreted by the secretary. In general, the access side parameter towel will contain a slave value, which is used to define whether the access range defined by the access range is a backup file, but the method of the wire backup system of the present invention does not use the touch access range I number. The second boot data file that provides backup is stored in the storage section that can be accessed by the backup file system of the month, because the backup slot is consumed because of the backup 11 201005643 aid mechanism riding in the m will also set the property of the backup rights system to read-only, hidden, or read-only and hidden, so that the user can not prepare the money (4) to access the second boot data file. . In the month (the main file system described in j is provided for the user to freely access t), the first boot data slot used in general booting is also stored. If the 4 database system generates the module plus the generated secrets exceeds Two, because the backup support system only needs one in theory, there will be more than two main audit systems, but the invention has only a towel - a storage section accessible by the main file system. The first boot data file is stored therein, and the system boot module 230 can be provided for booting. The system boot module 230 is responsible for reading the first boot poor tank through the main file system and gamma m rhyme, and when the system When the boot module 230 detects that the first boot data file cannot complete the normal booting process, the boot file system reads the second boot data file through the backup file system, and uses the second boot data file to start the boot program, so that the booting program 230 The mechanism of the aid is successfully completed. In order to allow the file system generated by the file system generation module 210 to run simultaneously without problems, it is necessary to modify the operating system of the conventional embedded system. Part of the code, that is, the present invention will modify the conventional flash memory driver, the modified flash memory driver 'function name is FMD-Init, FMD_EraseBl〇ck, FMD-OEMloControl and FMD_WriteSector, etc. The function for executing data writing is added to the synchronized program 12 201005643 = each file system generated by the reading system generation module 21G has a synchronization unit 2111' as shown in "2BK". The synchronization unit 2111 writes the data of the system to the storage area of the system, and the processing of the write lock, the write data, the write lock, and the like are synchronized. In the case of accessing data, problems such as DeadL〇ck or file writing errors are generated. Next, an operation system and method of the present invention will be explained by way of an embodiment, and please refer to "3rd drawing". A flow chart of a method for storing a boot file of a human system in different storage sections. It is assumed that in this embodiment, the storage space of the flash memory is 2M Byt Es.e

若使用者所使用的嵌入式系統中包含本發明,則當嵌 入式系統在開機時,檔案系統生成模組210會先载入快閃 記憶體驅動程式,並讀取所有的存取範圍參數,例如有第 一存取範圍參數以及第二存取範圍參數兩組,假設第一存 取範圍參數包含起始位址以及區段長度,其中起始位址為 「0x0」、區段長度為1792K Bytes ;第二存取範圍參數包 含的起始位址為「0x10)001」、區段長度為256K Bytes , 且第二存取範圍參數還包含了表示存取範圍為備援檔案 系統的設定值。 在檔案系統生成模組210讀取兩組存取範圍參數之 後,檔案系統生成模組會分別以兩組的存取範圍參數來執 行快閃記憶體驅動程式(步驟511 ),藉以生成兩個檔案系 統(步驟512) ’其中,如「第4圖」所示,依據第一存取 13 201005643 範圍參數所生成的;H祕可以存取_記憶體⑽中 的第-儲存區段110,而依據第二存取範圍參數所生成的 槽案系統則僅能夠存取第二儲存區段丨2〇。 在檔案系統生成模組21〇生成檔案系統(步驟512) 之後,檔案系統定義模組220會依據第二存取範圍參數中 - 的設定值設定存取第二儲存區段120的檔案系統為備援檔 案系統,並且設定存取第一儲存區段110 (也就是非備援 Ο 檔案系統)的檔案系統為主要檔案系統(步驟520)。 為了避免使用者存取備援檔案系統中的第二開機資 料檔而造成備援用的第二開機資料檔損毁,因此檔案系統 定義模組220在定義出第二儲存區段丨20為備援檔案系統 後,更會將備援檔案系統之屬性為唯讀、隱藏、或唯讀並 隱藏,使得使用者無法存取第二儲存區段120,藉以保護 . 第二開機資料檔。 . 在檔案系統定義模組220將備援檔案系統及主要檔案 _ 系統設定完成(步驟520)之後,系統開機模組230會透 過主要檔案系統讀取儲存在第一儲存區段上的第一開機 資料檔’並使用第一開機資料檔開機(步驟530)。同時, 系統開機模組230會在使用第一開機資料檔開機時,债測 開機程式是否成功的完成(步驟550)。 假設系統開機模組230無法使用第一開機資料檔完成 開機程序,例如使用者前次使用欲入式系統時’在更新第 三區塊113時斷電,造成第一開機資料檔損毁,則系統開 機模組230肯定無法完成開機程序,因此’系統開機模組 201005643 、將θ偵測出使用第一開機資料檀開機失敗,因此改透 =援彳s案系_取儲存在第二儲存區段〗2时的第二開 機負料^ ’並使用第二職資料勸饿(步驟獨),藉以 順利完成開機程序。 本么月的快閃記憶體驅動程式中,更可以包含同步單 - /元使得心案系統生成模組210執行快閃記憶體驅動程式 f所產生的主要槽義統都可以進行寫人的同步化,也就 ❹ 是在寫人^料(更新的第-關資料檔或是使用者資料 等i到第-儲存區段110中的某個區塊時,會先對該區塊 進行寫入較,之後才會將龍S人區塊巾,在資料寫入 後才解除寫入鎖定,透過同步化的方式可以避免主要檔案 系統在更新第一開機資料樓或寫入資料Η夺產S Dead Lock 或寫入錯誤等問題。同樣的’檔案系統生成模組2ι〇執行 ‘相_㈣記憶體驅動程式所生成的備_㈣統再更 _ 新備援的第二開機資料檔時,也會進行寫入的同步化。 综上所述’可知本發明與先前技術之間的差異在於内 k式系統會生成多個檔案系統,並以定義其中一個稽案系 統為備援檔案系統存放第二開機資料檔,藉以將備援用的 第二開機資料檔與一般使用的第一開機資料檔存放於不 同檔案系統中,使得無法以第一開機資料檔開機時,使用 第二開機資料檔開機,藉由此一技術手段可以解決先前技 術所存在的開機資料檔存放於使用者可以自由存取的儲 存區《k時’可肥會被使用者損毀而無法進行開機備援的問 題’進而達成提供特定嵌人式祕以不同㈣案系統儲存 15 201005643 多個開機資料檔的功效。 再者’本發日狀將_資料檔齡於不_存區段中 之備援方法’可實觀硬體、軟體或硬體絲體之組 雖然本發晴揭露之實施方式如上,惟所述之内容並 非用以直接限定本發明之專利保護範圍。任何本發明所屬 技制戰巾具有通常知識者,在賴離本發明所揭露之精 =和顧之内’在實施_式上及㈣上所為之更動或潤 Ο 飾’均屬本發明之專娜護翻。耻本發明之專利保護 範圍仍須以本說明書所附之申請專利範圍所界定者為準。 【圖式簡單說明】 第1圖係習知之快閃記憶體儲存結構示意圖。 :第2A圖係本發明所提之將嵌入式系統之開機資料檔 儲存於不同儲存區段中之備援系統架構圖。 ‘ 第2B圖係本發明所提之將嵌入式系統之開機資料檔 儲存於不同儲存區段中之備援系統架構圖。 ❹ 第3圖係本發明所提之將嵌入式系統之開機資料禮儲 存於不同儲存區段中之備援方法流程圖。 第4圖係本發明實施例所提之主要檔案系統與備援檔 案系統存取之儲存區段示意圖。 【主要元件符號說明】 100 快閃記憶體 110 第一儲存區段 120 第二儲存區段 112 第二區塊 16 113 第三區塊 113a 前區段 113b 後區段 200 作業系統 210 檔案系統生成模組 2111 同步單元 220 檔案系統定義模組 230 系統開機模組 步驟511 以對應快閃記憶體之存取範圍參數執行快 201005643 閃記憶體驅動程式 步驟512生成分別存取快閃記憶體中之不同儲存區 段之檔案系統 步驟520設定檔案系統其中之一為備援檔案系統並 設定非備援檔案系統之檔案系統為主要檔 案系統 步驟530透過主要檔案系統讀取第一開機資料檔並 以第一開機資料檔開機 步驟550偵測第一開機資料檔是否正常開機 步驟560透過備援檔案系統讀取第二開機資料檔並 以第二開機資料檔開機 17If the embedded system of the user includes the present invention, when the embedded system is powered on, the file system generation module 210 first loads the flash memory driver and reads all the access range parameters. For example, there are two groups of the first access range parameter and the second access range parameter, and the first access range parameter includes a start address and a segment length, where the start address is “0x0” and the segment length is 1792K. Bytes; the second access range parameter includes a starting address of "0x10) 001", a segment length of 256K Bytes, and the second access range parameter further includes a set value indicating that the access range is a backup file system. . After the file system generation module 210 reads the two sets of access range parameters, the file system generation module executes the flash memory driver with two sets of access range parameters (step 511), thereby generating two files. System (step 512) 'where, as shown in "Fig. 4", generated according to the first access 13 201005643 range parameter; H secret can access the first storage section 110 in the memory (10), and The slot system generated by the second access range parameter can only access the second storage section 丨2〇. After the file system generation module 21 generates the file system (step 512), the file system definition module 220 sets the file system for accessing the second storage segment 120 to be prepared according to the set value of the second access range parameter. The file system is assisted, and the file system accessing the first storage section 110 (i.e., the non-backup file system) is set as the primary file system (step 520). In order to prevent the second boot data file of the backup from being damaged by the user accessing the second boot data file in the backup file system, the file system definition module 220 defines the second storage area 丨20 as the backup file. After the system, the attributes of the backup file system are read-only, hidden, or read-only and hidden, so that the user cannot access the second storage section 120, thereby protecting the second boot data file. After the file system definition module 220 completes the backup file system and the main file system (step 520), the system boot module 230 reads the first boot stored in the first storage segment through the main file system. The data file ' is booted using the first boot data file (step 530). At the same time, the system boot module 230 will successfully check whether the boot program is successfully completed when the first boot data file is booted (step 550). It is assumed that the system boot module 230 cannot use the first boot data file to complete the boot process. For example, when the user uses the desired system in the previous time, the power is turned off when the third block 113 is updated, causing the first boot data file to be damaged, and the system is The boot module 230 is definitely unable to complete the boot process, so the 'system boot module 201005643, θ detects the use of the first boot data, the boot fails, so the change = the aid s case _ is stored in the second storage segment 〗 2 when the second boot negative material ^ 'and use the second job information to advise hungry (steps alone), in order to successfully complete the boot process. In this month's flash memory driver, the synchronization single-/element can be included so that the main system generated by the system of the heart-system generation module 210 executing the flash memory driver f can be synchronized by the writer. , that is, when writing a person (updated first-close data file or user data, etc.) to a certain block in the first storage section 110, the block is written first. After that, the Dragon S-zone block towel will be unlocked after the data is written. By synchronizing, the main file system can be prevented from updating the first boot data building or writing data to capture the S Dead Lock. Or write errors, etc. The same 'file system generation module 2 〇 〇 ' ' ( ( ( ( ( ( ( ( ( ( 记忆 记忆 记忆 记忆 记忆 生成 生成 生成 生成 生成 生成 新 新 新 新Synchronization of writing. In summary, the difference between the present invention and the prior art is that the internal k-type system generates multiple file systems, and defines one of the auditing systems as a backup file system to store the second boot. Data file, which will be used for backup The second boot data file and the commonly used first boot data file are stored in different file systems, so that when the first boot data file cannot be booted, the second boot data file can be booted, and the prior art can be solved by using a technical means. The existing boot data file is stored in the storage area that the user can freely access, and the problem that the fat can be destroyed by the user and cannot be turned on and backed up is further solved. 15 201005643 The efficacy of multiple boot data files. In addition, 'this is the day of the _ data file age in the non-storage section of the backup method' can be a group of hard, soft or hard body The embodiment of the invention is as described above, but the content is not intended to directly limit the scope of patent protection of the present invention. Any technical towel to which the present invention pertains has the general knowledge, and the essence and the method disclosed in the present invention are Within the implementation of the _ type and (four) for the change or run the decoration 'all are the special care of the present invention. Shame the scope of patent protection of the invention must still be attached to the application of this specification The definition of the patent scope shall prevail. [Simplified description of the drawings] Fig. 1 is a schematic diagram of a conventional flash memory storage structure. FIG. 2A is a diagram of the present invention for storing the boot data file of the embedded system in different storage. The backup system architecture diagram in the section. '2B is a redundant system architecture diagram of the present invention for storing the boot data file of the embedded system in different storage sections. ❹ Figure 3 is the present invention. A flowchart of a backup method for storing the booting information of the embedded system in different storage sections. FIG. 4 is a schematic diagram of a storage section of the main file system and the backup file system accessed by the embodiment of the present invention. [Main component symbol description] 100 flash memory 110 first storage section 120 second storage section 112 second block 16 113 third block 113a front section 113b rear section 200 operating system 210 file system generation Module 2111 synchronization unit 220 file system definition module 230 system boot module step 511 to execute the flash memory body access range parameter fast 201005643 flash memory driver step Step 512: Generate a file system for respectively accessing different storage segments in the flash memory. Step 520: Set one of the file systems to the backup file system and set the file system of the non-backup file system as the primary file system. The file system reads the first boot data file and starts the first boot data file with the first boot data file. Step 550 detects whether the first boot data file is normal. Step 560 reads the second boot data file through the backup file system and uses the second boot data file. Boot 17

Claims (1)

201005643 十、申請專利範園: 1. 一種將肷入式系統之開機資料槽儲存於不同儲存區段 中之備援方法’係應用於一嵌入式系統上,該備援方 法包含下列步驟: 以對應一快閃記憶體(Hash)之複數個存取範圍 參數執行一快閃記憶體驅動程式(Hash Media Driver, FMD); Q 生成分別存取該快閃記憶體中之不同儲存區段之 各標案系統,其中該些儲存區段對應於該些存取範圍 參數; 設定該些檔案系統其中之一為一備援檔案系統; 設定非該備援檔案系統之該些檔案系統為主要檔 案系統, 透過該主要檔案系統讀取一第一開機資料檔,並 以該第一開機資料檔開機;及 ❷ 偵測無法以該第一開機資料檔正常開機時,透過 該備援檔案系統讀取一第二開機資料檔,並以該第二 開機資料檔開機。 2. 如申請專利範圍第丨項所述之將嵌入式系統之開機資 料檔儲存於不同儲存區段中之備援方法,其中該生成 各該槽案系統之步驟係分別依據該些存取範圍參數所 包合之一起始位址及—區段長度生成存取該些儲存區 段之該些檔案系統。 3. 如申請專·圍第1項所述之減人式祕之開機資 18 201005643 料檔儲存於不同儲存區段中之備援方法,其中該設定 該些檔案系統其中之一為該備援檔案系統之步驟更包 含設定該備援檔案系統之屬性為唯讀、隱藏、或唯讀 並隱藏之步驟。 4. 一種將嵌入式系綠之開機資料檔儲存於不同儲存區段 中之備援系統,係應用於一嵌入式系統上,該備援系 統包含: ^ 一快閃記憶體; ❹ 一檔案系統生成模組,用以以對應該快閃記憶體 之複數個存取範圍參數執行一快閃記憶體驅動程式, 藉以生成分別存取該快閃記憶體中之不同儲存區段之 各檔案系統’其中該些儲存區段對應於該些存取範圍 參數; 播案糸統疋義模組’用以定義該些標案系統其 中之一為一備援標案系統,及定義非該備援檔案系統 ❿ 之該些檔案系統為主要檔案系統;及 一系統開機模組,用以透過該主要檔案系統讀取 一第一開機資料檔,並以該第一開機資料檔開機,及 於偵測到無法以該第一開機資料檔正常開機時,透過 该備援檔案系統讀取一第二開機資料檔,並以該第二 開機資料檔開機。 5·如申請專利範圍第4項所述之將嵌入式系統之開機資 料檔儲存於不同儲存區段中之備援系統’其中該些存 取範圍參數包含一起始位置及一區段長度。 19 201005643 6. 如申請專利範圍第*項所述之將嵌入式系統之開機資 料棺儲存於不同儲存區段中之備援系統,其中該檔案 系統定義模組更用以將該備援檔案系統的屬性設定為 唯讀、隱藏、或唯讀並隱藏。 7. 如申請專利範圍第4項所述之將嵌入式系統之開機資 料槽儲存於不同儲存區段中之備援系統’其中該第一 開機資料檔及該第二開機資料檔係以Hive-Based之技 術儲存於該快閃記憶體中。 8. 如申請專利範圍第4項所述之將嵌入式系統之開機資 料檔儲存於不同儲存區段中之備援系統,其中該快閃 記憶體驅動程式更包含一同步單元,用以提供該主要 檔案系統/該備援播案系統同步化寫入資料至該快閃記 憶體中。201005643 X. Applying for a patent garden: 1. A backup method for storing the boot data slot of the break-in system in different storage sections is applied to an embedded system. The backup method includes the following steps: Performing a Hash Media Driver (FMD) corresponding to a plurality of access range parameters of a flash memory; Q generating respectively accessing different storage segments in the flash memory a file system, wherein the storage segments correspond to the access range parameters; setting one of the file systems to be a backup file system; and setting the file systems other than the backup file system as the primary file system Reading a first boot data file through the main file system and booting with the first boot data file; and detecting that the first boot data file cannot be booted normally, reading through the backup file system The second boot data file is booted with the second boot data file. 2. The backup method for storing the boot data file of the embedded system in different storage sections as described in the scope of the patent application, wherein the steps of generating each of the slot systems are respectively based on the access ranges One of the starting address and the length of the segment included in the parameter generates the file systems for accessing the storage segments. 3. If you apply for the backup method described in item 1 of the sub-category, the file is stored in different storage sections, and one of the file systems is set to be the backup. The steps of the file system further include the steps of setting the attributes of the backup file system to read only, hidden, or read only and hidden. 4. A backup system for storing an embedded system green boot data file in different storage sections, applied to an embedded system, the backup system comprising: ^ a flash memory; ❹ a file system Generating a module for executing a flash memory driver with a plurality of access range parameters corresponding to the flash memory, thereby generating respective file systems for respectively accessing different storage segments in the flash memory The storage sections correspond to the access range parameters; the broadcast system is configured to define one of the reference systems as a backup standard system, and define the backup file The system of the system is a primary file system; and a system boot module for reading a first boot data file through the primary file system, booting with the first boot data file, and detecting When the first boot data file cannot be booted normally, a second boot data file is read through the backup file system, and the second boot data file is booted. 5. The backup system for storing the booting file of the embedded system in different storage sections as described in claim 4, wherein the access range parameters include a starting location and a segment length. 19 201005643 6. The backup system for storing the boot data of the embedded system in different storage sections as described in the scope of the patent application, wherein the file system definition module is further used for the backup file system. The properties are set to read-only, hidden, or read-only and hidden. 7. The backup system for storing the boot data slot of the embedded system in different storage sections as described in claim 4, wherein the first boot data file and the second boot data file are Hive- The technology of Based is stored in the flash memory. 8. The backup system for storing the boot data file of the embedded system in a different storage section as described in claim 4, wherein the flash memory driver further comprises a synchronization unit for providing the The primary file system/the backup broadcast system synchronizes the write data into the flash memory. 2020
TW97127538A 2008-07-18 2008-07-18 Backup system of embedded system for storing booting files in different storage sections and method thereof TW201005643A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97127538A TW201005643A (en) 2008-07-18 2008-07-18 Backup system of embedded system for storing booting files in different storage sections and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97127538A TW201005643A (en) 2008-07-18 2008-07-18 Backup system of embedded system for storing booting files in different storage sections and method thereof

Publications (1)

Publication Number Publication Date
TW201005643A true TW201005643A (en) 2010-02-01

Family

ID=44826385

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97127538A TW201005643A (en) 2008-07-18 2008-07-18 Backup system of embedded system for storing booting files in different storage sections and method thereof

Country Status (1)

Country Link
TW (1) TW201005643A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI650646B (en) * 2017-12-01 2019-02-11 和碩聯合科技股份有限公司 Cable data machine and its operation method
TWI813869B (en) * 2020-03-27 2023-09-01 宜鼎國際股份有限公司 Data storage device and method for maintaining normal boot operation of data storage device
TWI831379B (en) * 2022-06-14 2024-02-01 瑞昱半導體股份有限公司 Boot data reading system, boot data reading method, and processor circuit

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI650646B (en) * 2017-12-01 2019-02-11 和碩聯合科技股份有限公司 Cable data machine and its operation method
US10732887B2 (en) 2017-12-01 2020-08-04 Pegatron Corporation Cable modem and operating method thereof
TWI813869B (en) * 2020-03-27 2023-09-01 宜鼎國際股份有限公司 Data storage device and method for maintaining normal boot operation of data storage device
TWI831379B (en) * 2022-06-14 2024-02-01 瑞昱半導體股份有限公司 Boot data reading system, boot data reading method, and processor circuit

Similar Documents

Publication Publication Date Title
TWI375962B (en) Data writing method for flash memory and storage system and controller using the same
TWI471726B (en) Managing cache data and metadata
JP4901095B2 (en) Fail-safe way to apply custom software image updates to non-volatile storage
EP2329360B1 (en) Managing cache data and metadata
TW200929224A (en) Data writing method for flash memory and controller thereof
CN105164657A (en) Selective backup of program data to non-volatile memory
TWI296778B (en) Method and system for maintaining smbios
KR20110097937A (en) Ruggedized memory device
BR112012031912B1 (en) method implemented by computer, computer system and storage medium
JP2012128643A (en) Memory system
JP2014503895A (en) System reset
TW201110129A (en) Method for accessing a flash memory and associated memory device
CN111989656A (en) Configurable recovery state
TW201211758A (en) Memory buffer having accessible information after a program-fail
CN103678145A (en) Data storage device and flash memory control method
US20100115004A1 (en) Backup system that stores boot data file of embedded system in different strorage sections and method thereof
CN101785239A (en) Key based hidden partition system
EP2329367B1 (en) Performing an in-place update of an operating storage device
TW201005643A (en) Backup system of embedded system for storing booting files in different storage sections and method thereof
CN101923500A (en) Backup and update method and device of bootstrap program in embedded equipment
CN111868698B (en) Free space through
US8055853B2 (en) Data storage system and data storage program for atomic transactions
TWI559227B (en) Computer system having two built-in operating devices that can be dynamically powered on or powered off
CN104090829A (en) Method for realizing logical volume metadata backup storage
TW201227294A (en) Dada writing method, memory controller and memory storage apparatus