抑2959 A7 五、發明說明(1 ) [發明領域] 本發明係有關於電腦記憶體應用方面的技術,特別是 有關於一種快閃記憶體存取控制方法,其可適用於一種具 有外接快閃記憶體的電腦裝置上,例如為掌上型個人電腦 (Handheld Personal Computer,HPC)上,用以控制該電腦 裝置對其外接之快閃記憶體的資料存取動作。 [發明背景] 4上型個人電腦為一種可攜帶式之小型電腦裝置。由 於其體積小,因此一般係使用快閃記憶體(flash mem〇ry) 來作為可讀寫之永久性資料儲存裝置。此快閃記憶體一般 係用以儲存預設之程式及資料,例如包括系統硬體設定參 數、用戶資料、硬體保護密碼、系統註冊管理程式、全球 識別碼(Universally Unique Identifier,UUID),等等。傳 統上此外接之快閃δ己憶體係透過一串列式介面連接至掌 上型個人電腦。 經濟部智慧財產局員工消費合作社印製 然而以串列式介面來進行資料存取之缺點在於其需佔 用特定之輸出入(I/O)空間,且需要使用特殊的硬體電路 來實施,因此不僅會增加系統之負擔,且使得存取速度較 忮。此外,亦會使得系統斷電保護性不足,因此於斷電時, 常會致使已存入之參數資料流失。 [發明概述] 鑒於以上所述習知技術之缺點,本發明之主要目的便 是在於提供一種新的快閃記憶體存取控制方法,其不需要 佔用系統特定之輸出入(1/0)空間,且不需要使用特殊的 G氏張尺度適用中國國家·^準(CNS)A4規格·(21() χ 297公爱) 1 15894 五、發明說明(2 ) 硬體電路來實施。 本發明之另—目的在於提供—種新的快閃記憶體存取 控制方法,其較習知技術具有更快之存取速度。 本發明的又-目的在於提供一種新的快閃記憶體存取 控制方法,其較習知技術具有更佳之系統斷電保護性,不 會在於斷電時致使已存入之參數資料流失。 根據以上所述之目的,本發明提供了一種新賴之快閃 >記憶體存取控制m快·㈣存取㈣方法適用於 使用外接快閃記憶體的電滕裝置上,帛以控制該電腦裝置 對該快閃記憶體之資料存取動作。 此快閃記憶體存取控制方法包含以下步驟: (1) 執行一虛擬位址申請程序,用以按照該快閃記憶 體的圮憶容量,申請其所需之虛擬位址空間; (2) 若申請成功,則執行一映射程序,用以將該快閃 記憶體之實體位址空間映射至申請到之虛擬位址空間; ► (3)若接收到一存取要求信號,則執行對應之存取程 序; 經濟部智慧財產局員工消費合作社印製 (3-1)若為一寫入請求,則執行下列之寫入程序: (3-la)將欲寫入之資料寫入至該快閃記憶體; (3-lb)執行一寫入資料比對程序,用以比對寫入 前之資料與寫入後之資料,藉以檢查出寫入之資料是否有 錯誤; (3-2)右為一讀取請求,則執行下列之讀取程序: (3-2a)將欲讀取之資料從該快閃記憶體令讀取出 本紙張尺度適用中國國家標準(CNS)A4規格(21〇 297公釐) 2 15894 A72959 A7 V. Description of the Invention (1) [Field of the Invention] The present invention relates to the technology of computer memory application, in particular to a flash memory access control method, which can be applied to an external flash memory. The computer device of the memory is, for example, a handheld personal computer (HPC), which is used to control the computer device's data access operation to the external flash memory. [Background of the Invention] The 4-type personal computer is a portable small computer device. Because of its small size, flash memory is generally used as a permanent data storage device that can be read and written. This flash memory is generally used to store preset programs and data, such as system parameter settings, user data, hardware protection password, system registration management program, universally unique identifier (UUID), etc. Wait. Traditionally, this external flash δ-memory system is connected to a handheld personal computer through a serial interface. Printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs. However, the disadvantage of using a serial interface for data access is that it requires specific I / O space and requires special hardware circuits to implement it. Not only will increase the burden on the system, but also make access speed slower. In addition, the power failure protection of the system will be insufficient, so when the power is off, the stored parameter data will often be lost. [Summary of the Invention] In view of the shortcomings of the conventional techniques described above, the main object of the present invention is to provide a new flash memory access control method, which does not need to occupy system specific input / output (1/0) space. And does not require the use of a special G-scale scale applicable to China's national standard (CNS) A4 specifications (21 () χ 297 public love) 1 15894 5. Description of the invention (2) Hardware circuit for implementation. Another object of the present invention is to provide a new flash memory access control method, which has faster access speed than the conventional technology. Another object of the present invention is to provide a new flash memory access control method, which has better system power-off protection than the conventional technology, and will not cause the stored parameter data to be lost during power-off. According to the above-mentioned object, the present invention provides a new flash memory access control method. The fast memory access method is applicable to an electric flash device using an external flash memory to control the flash memory. The computer device accesses data in the flash memory. The flash memory access control method includes the following steps: (1) executing a virtual address application process to apply for the virtual address space required by the flash memory according to its memory capacity; (2) If the application is successful, a mapping process is performed to map the physical address space of the flash memory to the requested virtual address space; ► (3) If an access request signal is received, execute the corresponding Access procedures; printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs (3-1) If it is a write request, execute the following write procedures: (3-la) Write the data to be written to the quick Flash memory; (3-lb) Perform a write data comparison procedure to compare the data before writing with the data after writing to check whether there is any error in the written data; (3-2) The right is a read request, then the following read process is performed: (3-2a) Read the data to be read from the flash memory to make the paper size applicable to the Chinese National Standard (CNS) A4 specification (21 〇297 mm) 2 15894 A7
五、發明說明(3 ) 來; (3-2b)執行一讀取資料比 出來之資料是否有錯誤。 ,藉以檢查讀取 ^述之存取動作由於係、透過pcmcu介面在本發明 之快閃記憶體存取控制方法 六诉也a π ; * 啊卜進仃’因此可使得此 存取動作不需要佔用特定鉍 号疋之輪出入d/ο)空間,且不需要 使用特殊的硬體電路來實施, /、有更快之存取速度。再 且,本發明亦較習知技 & + & ^ 4 系統斷電保護性,不 ^aam 使已存入快閃記憶體之參數資料流失。本 發明因此較習知技術具有更佳之實用性。 [圖式簡述] 為讓本發明之上述和1 ^ 八匕目的特徵、和優點能更明 顯易Μ,下文將舉一較佳眚 牛杈佳貫施例,並配合所附圖式,詳細 說明本發明之實施例。所附圖式之内容簡述如下: 第1圖為一系統架構示意方塊圖’其顯示應用本發明 之f夬閃記憶體存取控制方沐的堂 仅刺万法的旱上型個人電腦的系 構; 經濟部智慧財產局員工消費合作社印製 第2圖為机程圖,其顯示本發明之快閃記憶體存取 控制方法之主程序; 第3圖為一流程圖,其顯示本發明之快閃記憶體存取 控制方法之資料寫入程序; 第4圖為一流程圖,其顯示本發明之快閃記憶體存取 控制方法之資料讀取程序。 [圖式之標號] 3 时國國家標準(CNS)A4 χ 297ϋ 15894 482959 經濟部智慧財產局員工消費合作社印製 A7 B7 五、發明說明(4 ) 100 掌上型個人電腦(Handheld Personal Computer,HPC) 110 中央處理器(Central Processing Unit,CPU) 120 主記憶體單元 121 系統程式(Operating System,OS) 122 快閃記憶體驅動程式(本發明之存取控制方法) 123 應用程式組 130 PCMCIA 介面 ^ 200 快閃 §己憶體(flashmemory) [發明實施例詳細說明] 第1圖為一系統架構示意方塊圖,其顯示應用本發明 之快閃記憶體存取控制方法的掌上型個人電腦(Handheld Personal Computer,HPC)的系統架構。首先於此須注意 的是’此處之實施例雖以掌上型個人電腦為例作說明,但 本發明並不限於應用於掌上型個人電腦上;廣義而言,係 可應用於各種使用外接快閃記憶體且具有程式處理能力的 |電腦裝置上,用以控制電腦裝置對外接快閃記憶體之資料 存取動作。 於第1圖中,掌上型個人電腦係為標號1〇〇所指之虛 線框所包含之部分,其系統架構包含一中央處理器(Central Processing Unit ’ CPU)ll〇、一主記憶體單元 12〇、以及 -PCMCIA (Personal Computer Memory Card International Association)介面130。為簡化圖式及說明,此處之系統 架構僅顯示與本發明有關之系統構件,其它無關之系統構 件,例如輸入裝置、顯示裝置、等等,並未顯示於圖式中。 ---------------------訂--------- (請先閱讀背面之注意事項再填寫本頁) 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐_)_ 4 15894 482959 B7 五、發明說明(5 ) 中央處理器110用以執行主記憶體單元i 20中之各個 程式’其為一般熟知之資料處理裝置,因此以下將不對其 功能及内部架構作進一步詳細之說明。PCMCIA介面130 可讓快閃記憶體200以外接方式竊接至掌上型個人電腦 100,其為一般習於電腦技術者所熟知之介面,因此以下 將不對其詳細内容作進一步說明。 主5己憶體單元120可為任何該中央處理器no可直接 存取及執行程式之記憶體,例如包括唯讀記憶體(Read-Only Memory, ROM)及隨 機存取 記憶體 (Rand〇m -AccessV. Description of the invention (3) Come; (3-2b) Whether there is any error in the data obtained by performing a read data comparison. In order to check the access action described in the above description, the method of access control of the flash memory according to the present invention through the pcmcu interface is also a π; It occupies the space of d / o) of the wheel of specific bismuth, and does not need to be implemented by special hardware circuits. It has faster access speed. Furthermore, the present invention is more protective than the conventional technique & + & ^ 4 system power-off protection, does not ^ aam the parameter data stored in the flash memory is lost. Therefore, the present invention has better practicability than the conventional technology. [Brief Description of the Drawings] In order to make the above-mentioned features and advantages of the present invention more obvious and easier, the following will give a better example of a yak branch and a good implementation, and cooperate with the attached drawings in detail. An embodiment of the present invention will be described. The contents of the drawings are briefly described as follows: FIG. 1 is a schematic block diagram of a system architecture, which shows the application of the flash memory access control method of the present invention. Architecture; Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs. Figure 2 is a chart showing the main program of the flash memory access control method of the present invention. Figure 3 is a flowchart showing the present invention. The data writing procedure of the flash memory access control method; FIG. 4 is a flowchart showing the data reading procedure of the flash memory access control method of the present invention. [Symbols of drawings] National Standard (CNS) A4 χ 297ϋ 15894 482959 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs A7 B7 V. Invention Description (4) 100 Handheld Personal Computer (HPC) 110 Central Processing Unit (CPU) 120 Main memory unit 121 Operating system (OS) 122 Flash memory driver (access control method of the present invention) 123 Application program group 130 PCMCIA interface ^ 200 Flash § flashmemory [Detailed description of the embodiment of the invention] FIG. 1 is a schematic block diagram of a system architecture showing a handheld personal computer (Handheld Personal Computer) to which the flash memory access control method of the present invention is applied. , HPC) system architecture. First of all, it should be noted that although the embodiments herein are described by taking a palm-type personal computer as an example, the present invention is not limited to being applied to a palm-type personal computer; Flash memory with program processing capabilities | on a computer device, used to control the computer device's data access to external flash memory. In FIG. 1, the palm-type personal computer is a part contained by a dotted frame indicated by reference numeral 100. Its system architecture includes a Central Processing Unit (CPU) 110 and a main memory unit 12 〇, and-PCMCIA (Personal Computer Memory Card International Association) interface 130. In order to simplify the drawings and descriptions, the system architecture here only shows the system components related to the present invention. Other unrelated system components, such as input devices, display devices, etc., are not shown in the drawings. --------------------- Order --------- (Please read the notes on the back before filling this page) This paper size is applicable to China Standard (CNS) A4 specification (210 X 297 mm _) _ 4 15894 482959 B7 V. Description of the invention (5) The central processing unit 110 is used to execute each program in the main memory unit i 20 'It is generally known data Processing device, so its function and internal structure will not be described in further detail below. The PCMCIA interface 130 allows the flash memory 200 to be externally stolen to the palmtop personal computer 100, which is an interface familiar to those skilled in computer technology. Therefore, the detailed content will not be described further below. The main memory unit 120 can be any memory that the central processing unit can directly access and execute programs, for example, including read-only memory (ROM) and random access memory (Random). -Access
Memory,RAM),係用以存放掌上型個人電腦ι〇〇操作及 應用上所需之各個程式,包括一系統程式(〇peratingMemory (RAM), which is used to store various programs required for the operation and application of palm-type personal computers, including a system program (〇perating
System,〇S)121、一快閃記憶體驅動程式122、以及一應 用程式組123。 系統程式121用以控制掌上型個人電腦1〇〇之整體運 作,其為一般電腦系統於運作時所需之必要程式,亦為習 於電腦技術者所熟知之系統,因此以下將不對其功能及内 部架構作進一步詳細之說明。 經 濟 部 智 慧 財 產 局 員 工 消 費 合 作 社 印 製 快閃記憶體驅動程式122即為根據本發明之快閃記憶 體存取控制方法所撰寫而成之程式,其用以控制掌上型個 人電腦100對快閃記憶體200之資料存取動作,包括寫入 動作及讀取動作,其中之詳細流程揭露於第2,3,4圖。 應用程式組123包括各種應用程式。此些應用程式於 執行時,若有需要讀取快閃記憶體2〇〇中的資料或將資料 寫入快閃記憶體200,則會發出一存取請求至驅動程式 5 15894 本紙張尺度適用中國國家標準(CNS)A4^TiITx 297公爱)-- 五、發明說明(6 ,令該驅動程式 介面2透過中央處理器110及PCMCIA '、行對快閃記憶體200的資料存取動作。 於:閃錢體200 一般係用以儲存掌上型個人電腦1〇〇 咨上所需之系統參數資料,例如硬體設定參數、用戶 -料硬體保護密碼、系統註冊管理程式、全球識別碼 ㈣⑽Uy Unique Identifier,職D),等等。於實際應 ’係先將這些參數資料寫入至快閃記憶體2〇〇中;接 者於開機使用_,將這些參數資料從快閃記憶體2⑽讀取 出來’藉以設定掌上型個人電腦1〇〇之系統初始設定狀 此寫入操作及讀取操作均係受控於驅動程式122(即 本發明之快閃記憶體存取控制方法),其程序步驟如第2, 3’ 4圖的流程圖所示;其中第2圖顯示驅動程式122之 主程序,而第3,4圖則分別顯示驅動程式122之二個副 程序:寫入程序及讀取程序。 請首先參閱第2圖之主程序流程圖,於開機後,首先 1藝執行步驟201之虛擬位址申請程序。於此程序中,係首先 按照快閃記憶體200的總記憶容量,申請其可由系統程式 經 濟 部 智 慧 財 產 局 員 工 消, 費_ 合 ί : 社 印 製 (〇S)121直接存取之虛擬位址(virtual address)空間。 接著於步驟202中,判斷步驟201之虛擬位址申請程 序是否成功。若否,則結束主程序;若是,則執行步驟2〇3。 於步驟203中,執行一映射程序,用以將快閃記憶體 200之實體位址(physical address)空間映射至所申請到之 虛擬位址空間。接著執行步驟204。 接著於步驟204中,判斷步驟203之映射程序是否成 本紙張尺度適用中國國家標準(CNS)A4規格(21〇 X 297公釐) 6 15894 B7 B7 7 15894 五、發明說明(7 ) 力二:嫌:結束主程序;若是’則執行步驟205。 /驟205令,等待應用程式組⑵ -讀取H 此存取請求可為—寫人請求或 取往驟206中’判斷步驟205是否有接收到一存 月 右疋,則將程序跳至步驟207,·若否,則將程序 跳至步驟208。 货則將程序 則執:Π 207中’若所接收到之存取請求為寫入請求, =:'3圖所示之寫入程序;反之,若為讀取請求,則 :,®所:之讀取程序。寫入程序或讀取程序執行完 畢後’程序接著會跳回步驟205。 於步驟208中,判斷是否要退出驅動程式122。若否, 則將程序跳回至㈣2G5;若是,龍束此主程序。 請接著參閱第3圖’於寫人程序3⑽_,首先執行步 驟之虛擬位址檢查程序,藉以檢查確認快閃記憶體觸 之實體位址空間是否確已成功地映射至系統程式i2i之虛 擬位址空間。 曰接著於步驟302中’判斷步驟3G1之虛擬位址檢查程 序疋否已確邁映射成功。若否,則程序跳至步驟Bn;若 是’則程序跳至步驟303。 於步驟303中,發出一寫入致能信號至快閃記憶體 2〇〇,用以將快閃記憶體200設定至寫入模式。完成之後, 接著執行驟304。 於步驟304中’執行债錯總值計算程序,用以計算欲 本紙張尺度適用中關家標準(CNS)A4規格(21G X 297公复了 頁 訂System (OS) 121, a flash memory driver 122, and an application group 123. The system program 121 is used to control the overall operation of the palmtop personal computer 100. It is a necessary program for general computer systems in operation and a system familiar to computer technicians. Therefore, its functions and functions will not be described below. The internal structure is explained in further detail. The flash memory driver program 122, printed by the employee's consumer cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs, is a program written in accordance with the flash memory access control method of the present invention, which is used to control the handheld personal computer 100 to flash The data access operations of the memory 200 include a write operation and a read operation. The detailed flow of these operations is disclosed in Figures 2, 3, and 4. The application group 123 includes various applications. During the execution of these applications, if there is a need to read the data in the flash memory 200 or write the data to the flash memory 200, an access request will be sent to the driver 5 15894 This paper size is applicable Chinese National Standard (CNS) A4 ^ TiITx 297 public love)-5. Description of the invention (6), the driver interface 2 accesses the flash memory 200 through the central processing unit 110 and PCMCIA '. In: Flash money body 200 is generally used to store system parameter data required for handheld personal computer 100 consultation, such as hardware setting parameters, user-material hardware protection password, system registration management program, global identification code ㈣⑽Uy Unique Identifier, D), and so on. In actual application, 'the parameter data is first written into the flash memory 2000; then the user uses it at startup, and reads these parameter data from the flash memory 2' to set up the handheld personal computer 1 〇〇The initial setting of the system This write operation and read operation are controlled by the driver 122 (that is, the flash memory access control method of the present invention), and the program steps are as shown in Figure 2, 3 '4 The flowchart is shown in Figure 2. Figure 2 shows the main program of driver 122, and Figures 3 and 4 show the two sub-programs of driver 122: the writing program and the reading program. Please refer to the main program flow chart in Figure 2. After powering on, first perform the virtual address application procedure in step 201. In this procedure, the application is based on the total memory capacity of the flash memory 200, which can be consumed by the staff of the Intellectual Property Bureau of the Ministry of System and Program Economy. Address (virtual address) space. Then, in step 202, it is determined whether the virtual address application procedure of step 201 is successful. If not, end the main routine; if yes, go to step 203. In step 203, a mapping process is performed to map the physical address space of the flash memory 200 to the requested virtual address space. Then step 204 is performed. Next, in step 204, it is determined whether the mapping procedure of step 203 is based on the Chinese standard (CNS) A4 specification (21 × X 297 mm) on the paper scale. 6 15894 B7 B7 7 15894 5. Description of the invention (7) Force 2: : End the main program; if yes, go to step 205. / Step 205, waiting for the application program group-Read H This access request can be-a writer request or go to step 206 'to determine whether step 205 has received a storage month right, then the program skips to step 207, · If not, skip the program to step 208. The goods will execute the program: Π 207 'If the received access request is a write request, =:' The write program shown in Figure 3; otherwise, if it is a read request, then: Read program. After the writing or reading procedure is completed, the procedure then jumps back to step 205. In step 208, it is determined whether to exit the driver 122. If not, the program jumps back to ㈣2G5; if it is, the main program is bundled. Please refer to Figure 3 'in the writer program 3⑽_. First, perform the virtual address check procedure of the steps to check whether the physical address space touched by the flash memory is successfully mapped to the virtual address of the system program i2i space. Then, in step 302, it is judged whether the virtual address check procedure of step 3G1 has been successfully mapped. If not, the program jumps to step Bn; if yes, the program jumps to step 303. In step 303, a write enable signal is sent to the flash memory 200 to set the flash memory 200 to the write mode. After completion, step 304 is performed. In step 304, a calculation procedure of the total debt error value is performed to calculate the paper size. The paper size is applicable to the Zhongguanjia Standard (CNS) A4 specification (21G X 297).
482959 五、發明說明(8 寫入之資料的偵錯總值(cllecksum),藉以在寫入過程中作 為偵錯之依據。完成之後,接著執行驟3〇5。 於步驟305中,執行寫入動作,用以將資料寫入至快 閃記憶體200。由於快閃記憶冑2〇〇的規格特性,此寫入 動作係以字節(block)為單位,以逐字節(blQek_by_biMk) 方式依序將各字節之資料寫入至快閃記憶體200。完成之 後,接著執行驟306。 於步驟306中’按照快閃記憶體200的規格特性,將 程序置於等待狀愁,期間為一個時脈週期。 於此之後,接著執行驟307。 於步驟3G7中,執行資料比對程序,用以將寫入前之 貝料的读錯總值與寫入後之資料的债錯總值作_比對,藉 以偵測出寫入之資料是否有錯誤發生。 曰 著於步驟308中’判斷步驟3()7之資料比對程序的 結果是否正確。若是(代砉官 峰右疋(代表寫入之貧料完全正確),則結束 以(代表寫入之資料有錯誤發生), 至步驟309。 於步驟309中,重試一 + 次 次寫入動作,用以將欲寫入之 貝科再次寫入至快閃記憶體200。 正確接若著Γ,步驟310中’比對步驟309所寫入之資料是否 右疋,則結束寫入程序;若否,則程序跳至步驟31卜 確地311中’顯示一錯誤訊息,藉以將資料無法正 確也寫入快閃記憶體200的狀 將自動結束。 。知使用者。程序接著 匕本紙張尺 15894 ^--------^---------^ (請先閱讀背面之注意事項再填寫本頁) 經 濟 部 智 慧 財 產 局 消 費< 合 社 印 製 8 482959 A7 五、發明說明(9 ) 請接著參閱第4圖,於讀取程序4〇〇中,首先執行+ 驟401之虛擬位址檢查程序,藉以檢查確認快閃記憶體 之實體位址空間是否確已成功地映射至系統程式ΐ2ι之虛 擬位址空間。 | 接著於步驟402中,判斷步驟4〇1之虛擬位址檢查程 序疋否已確認映射成功。若否,則程序跳至步驟;若 是,則程序跳至步驟403。 於步驟403中,執行讀取動作。於此步驟中,係首先 發出一讀取致能信號至快閃記憶體2〇〇,用以將快閃記憶 體200設定至讀取模式;接著將所欲讀取之資料從快閃記 憶體200中讀取出來。由於快閃記憶體2〇〇的規袼特性, 此讀取動作係以字節為單位,以逐字節方式依序將各字節 之資料從快閃記憶體200中讀取出來。完成之後,接著執 行驟304。 於步驟404中’執行資料内容檢查程序,藉以檢查步 驟403所讀取出來的資料内容是否正確。若是,則結束讀 取程序;若否,則程序跳至步驟4 〇6。 於步驟406中,顯示一錯誤訊息,藉以將資料無法正 確地從快閃記憶體200中讀取出來的狀況,告知使用者。 程序接著將自動結束。 上述之存取動作由於係透過pcmCIa介面130在驅 動程式122(即本發明之快閃記憶體存取控制方法)的控制 下進仃,因此可使得此存取動作不需要佔用特定之輸出入 (1/〇)^間’且不需要使用特殊的硬體電路來實施,並亦 15894 (請先閱讀背面之注意事項^寫本頁) J^T· 經濟部智慧財產局員工消費合作社印製 9 482959 A7 -------- B7 _ 五、發明說明(10 ) 較習知之存取控制方法具有更快之存取速度。再且,使用 本發明之快閃記憶體存取控制方法亦較習知之存取控制方 =法具有更佳之系統斷電保護性,不會在於斷電時致2已存 入快閃記憶體200之參數資料流失。本發明因此較習知技 術具有更佳之實用性。 以上所述僅為本發明之較佳實施例而已,並非用以限 定本發明之範圍;凡其它未脫離本發明所揭示之精神下所 4_完成之等效變更或修飾,均應包含在下述之專利範圍内。 ^ - I 1 (請先閱讀背面之注意事項再填寫本頁) 訂---------線 - - Ϊ a - » > - 經濟部智慧財產局員工消費合作社印製 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) 10 15894482959 V. Description of the invention (8) The total debugging value (cllecksum) of the written data is used as the basis for debugging during the writing process. After completion, step 305 is performed. In step 305, the writing is performed Action to write data to the flash memory 200. Due to the flash memory's 200-characteristics, this write action is in byte (block) units and is performed byte-by-byte (blQek_by_biMk). Write the data of each byte to the flash memory 200 in sequence. After completion, proceed to step 306. In step 306, according to the specifications and characteristics of the flash memory 200, the program is placed in a wait state, and the period is one Clock cycle. After that, step 307 is performed. In step 3G7, a data comparison procedure is performed to use the total reading error value of the shell material before writing and the total debt error value of the data after writing. _Comparison, to detect whether there is an error in the written data. In step 308, determine whether the result of the data comparison procedure in step 3 () 7 is correct. If yes (代 砉 官 峰 右 疋 (representative The written data is completely correct), then ends with ( (Indicates that the written data has an error), go to step 309. In step 309, retry the write action once + times to write the Beco to be written into the flash memory 200 again. Correctly connect If Γ, in step 310, 'compare whether the data written in step 309 is right, then end the writing process; if not, then the program jumps to step 31 in step 311 to display an error message, so as to copy the data. If it is not correctly written into the flash memory 200, the state will automatically end.. Know the user. The program then goes to the paper rule 15894 ^ -------- ^ --------- ^ (Please Read the notes on the back before filling out this page) Consumption by the Intellectual Property Bureau of the Ministry of Economic Affairs <Printed by Yonhap 8 482959 A7 V. Description of the invention (9) Please refer to Figure 4 below. In the reading program 400, first Run the virtual address check procedure of step 401 to check whether the physical address space of the flash memory has been successfully mapped to the virtual address space of the system program ι2ι. | Then, in step 402, determine step 4. The virtual address check procedure of 1 has not confirmed that the mapping is successful. If not , The program jumps to step; if so, the program jumps to step 403. In step 403, a read operation is performed. In this step, a read enable signal is first sent to the flash memory 200, and The flash memory 200 is set to the read mode; then the data to be read is read from the flash memory 200. Due to the regulatory characteristics of the flash memory 200, this reading action is In byte unit, the data of each byte is read out from the flash memory 200 in a byte-by-byte order. After completion, step 304 is performed. In step 404, a data content checking procedure is executed to check whether the data content read in step 403 is correct. If yes, end the reading procedure; if not, skip to step 4 06. In step 406, an error message is displayed to inform the user of the situation in which the data cannot be correctly read from the flash memory 200. The program will then end automatically. The above access operation is performed under the control of the driver 122 (that is, the flash memory access control method of the present invention) through the pcmCIa interface 130, so that this access operation does not need to occupy a specific input / output ( 1 / 〇) ^ 间 'and does not require the use of special hardware circuits to implement, and also 15894 (Please read the precautions on the back ^ write this page) J ^ T · Printed by the Intellectual Property Bureau Staff Consumer Cooperatives 9 482959 A7 -------- B7 _ V. Description of the invention (10) It has faster access speed than the conventional access control method. Furthermore, using the flash memory access control method of the present invention also has better system power-off protection than the conventional access control method = method, which will not cause 2 to be stored in the flash memory 200 when the power is turned off. Parameter data loss. Therefore, the present invention has better practicability than the conventional technology. The above is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention; all other equivalent changes or modifications made without departing from the spirit disclosed by the present invention should be included in the following Within the scope of patents. ^-I 1 (Please read the precautions on the back before filling out this page) Order --------- Line--Ϊ a-»>-Printed Paper Size of Employees' Cooperatives of Intellectual Property Bureau, Ministry of Economic Affairs Applicable to China National Standard (CNS) A4 (210 X 297 mm) 10 15894