TW200809593A - Media card with command pass through mechanism - Google Patents

Media card with command pass through mechanism Download PDF

Info

Publication number
TW200809593A
TW200809593A TW95146174A TW95146174A TW200809593A TW 200809593 A TW200809593 A TW 200809593A TW 95146174 A TW95146174 A TW 95146174A TW 95146174 A TW95146174 A TW 95146174A TW 200809593 A TW200809593 A TW 200809593A
Authority
TW
Taiwan
Prior art keywords
command
card
data
agreement
instruction
Prior art date
Application number
TW95146174A
Other languages
Chinese (zh)
Inventor
Robert C Chang
Henry Ricardo Hutton
Farshid Sabet-Sharghi
Halut Kent Tanik
Ron Barzilai
Meytal Dam Ari
Original Assignee
Sandisk Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US11/299,186 external-priority patent/US20070168668A1/en
Priority claimed from US11/298,349 external-priority patent/US20070136501A1/en
Application filed by Sandisk Corp filed Critical Sandisk Corp
Publication of TW200809593A publication Critical patent/TW200809593A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Abstract

The present invention presents techniques for transmitting application specific instruction between a host and a memory card. The commands for the application specific protocol are embedded along with a signature in the data portion of a transmission protocol that is used to communicate between the host the memory card. The allows for the transmission of application specific commands that lack a corresponding command in the transmission protocol to still be transmitted in that protocol. The method can be implemented on the host side either at the device driver level or the file level. In order to implement a read command in the application specific protocol, a write command in the first protocol with an embedded read command is first sent to a logical address, followed by a second read command to the same logical address.

Description

200809593 九、發明說明: 【發明所屬之技術領域】 本發明大體而言係關於抽取式電子電路卡之使用及結 構且更具體吕之,本發明係關於允許個人電腦或其他主 機藉由不支援特定媒體卡命令之讀取器及/或主機軟體來 使用此等命令。 【先前技術】 近來,諸如緊密快閃卡(C0mpact Flash Card)、安全數位 (SD)卡、多媒體卡(MMC)、χΕ)及索尼記憶棒/高速記憶棒 (Memory Stick ΡΓ0)之小型快閃記憶卡已得到消費者的廣泛 接受。此等裝置主要經設計用於諸如數位相機及快閃記憶 體音樂播放器之消費者電子裝置。然而,需要其亦具有至 個人電腦之方便連接以供上載及下載資料。 不同卡具有不同電氣介面且通常具有可由用於卡之主機 使用的專用於媒體之命令。另外,由於此等卡經啟動以過 載有卡與卡之間不同之額外功能,所以卡協定可不僅在卡 形式因數之間不同,而且在相同形式因數之各種卡之間亦 不同。該等命令通常具有諸如特定輸入-輸出(I/O)及安全操 作之獨特功能。因為此等卡之使用變得更加多樣且其不斷 用於更多類型之應用程式,所以此等新應用程式通常將涉 及現有協定中所缺乏之功能或命令。 具有不同機械及/或電氣介面之市售非揮發性記憶卡之 實例包括可自 Sunnyvale,California 之 Corporation of Sunnyvale(本申請案之受讓人)購得的相關多媒體卡 116844.doc 200809593 ("MMC”)及安全數位("SD”)記憶卡。存在著符合國際標準化 組織("ISO")及國際電工技術委員會("IEC")之標準的其他 卡,經廣泛實施之實例係已知為IS0/IEC 7816標準。 在由 Cupertino,California之多媒體卡協會(MultiMediaCard Association)(”MMCA")不斷更新及公開的”規格The MultiMediaCard System Specification’1 中給出 MMC之物理 及電氣規格。日期分別為1999年6月、2000年1月、2001年6 月及2004年2月之該規格之版本2·11、2.2、3·1及4.0以此引 用的方式明確地併入本文中。在單一卡中具有達128兆位元 組的變化之儲存容量的MMC產品當前可自SanDisk公司購 得。在由SanDisk公司公開的日期為2000年4月 ”MultiMediaCard Product Manual"修訂版2中描述了 此等產 品,其手冊以此引用的方式明確併入本文中。美國專利第 6,279,144號及在1998年11月4日申請之申請案第09/186,064 號中亦描述了 MMC產品之電操作的某些態樣。在美國專利 第6,040,622號中描述了實體卡結構及製造其之方法。讓渡 給SanDisk Corporation之此等申請案及專利以此引用的方 式明確併入本文中。 較新之SD卡類似於MMC卡,除用以容納額外記憶體晶片 的增加之厚度之外,其具有相同大小。其之間的主要不同 之處在於:SD卡包括額外資料接點以使得能夠在卡與主機 之間更快地傳送資料。(具有額外資料接點之MMC卡之版本 亦為可用的,見上文闡述之MMC規格之4.0版)。SD卡之其 他接點與MMC卡之彼等接點相同,從而使得經設計以接受 116844.doc 200809593 SD卡之插槽亦將接受MMC卡。如以此引用方式併入本文中 之美國專利第6,820,148號中所描述的,以經設計以接受SD 卡之插槽亦可經製造以接受MMC卡的方式進一步製造與 SD卡之間的電氣介面及功能介面。在2000年8月17日申請之 美國專利申請案第09/641,023號中描述SD卡之某些態樣, 該申請案以此引用之方式併入本文中。(SD卡之規格可用於 SD協會(SDA)之成員公司)。 根據ISO/IEC 7816標準而製造之卡具有不同形狀,其具 有在不同位置中之表面接點,及一不同於MMC及SD卡之電 氣介面。ISO/IEC 7816標準具有總標題"Identification cards-Integrated Circuit(s) Cards with Contacts",且由具有 自1994年至2000年之個別曰期的第1部分至第l〇部分組 成。此標準(其複本可自Geneva,Switzerland,之ISO/IEC獲 得)以引用的方式明確併入本文中。ISO/IEC 7816的卡尤其 適用於其中必須以安全方式(其使資料極難以或不可能以 未經授權之方式被讀取)來儲存資料的應用程式。小型 ISO/IEC 7816卡通常用於蜂巢式電話以及其他應用程式 中。如上文所提及的,當將此等記憶卡用於新應用程式中 時’其可能需要在協定之現有版本中沒有的功能或命令。 可參看圖1說明此情況。如圖1之上部分所示,目標為在主 機侧與卡側上的特定應用程式(例如在安全資料傳送或電 子商務應用程式中)之間交換命令及資料。為了實施此目 標,將需要在主機與卡之間傳輸該等命令,其中圖i之下部 分展示了主機側上之某些軟體層及卡側上的某些韌體層。 116844.doc 200809593 來自主機之應用程式層之指令將被傳遞通過作業系統、檔 案層及裝置(卡)驅動程式,終止於可藉以將其傳輸至卡的協 定中。在卡内,指令將接著由裝置層韌體(其處理標準卡操 作)加以處理並被傳遞至韌體之應用程式層。視正使用之配 置而定,傳輸協定中之指令將自主機直接地交換至卡或經 由所配接之讀取器或硬體交換至卡,該讀取器或硬體可具 有其自身之用於自一協定轉譯至另一協定的軟體/韌體 層。其中可出現問題之處為在此等層之間的轉譯中之某階 段’應用程式之預期指令可能缺少在沿該路徑之某點處的 相應命令。 作為一實例,卡通常係藉由使用接受來自主機系統之命 令的(例如,用於USB的)硬體配接器而與Pc主機相連接。 然而,在主機與硬體配接器藉以通信的協定中無法使用許 多特定媒體命令,即使PC主機之主機應用程式希望將此等 命令傳輸至卡應用程式。 圖2展示第一主機及一卡之系統,其中卡1〇1可直接地(例 如’藉由插入槽153中)或經由某種配接器而連接至主機 151。卡韌體係由FW105加以指示。(參看圖3中之卡韌體1〇5 及讀取器韌體335將瞭解,較一般而言可將此等功能實施於 硬體、軟體或此等硬體及軟體之某組合中)。此主機151之 實例可為數位相機或電話。若干類型之此等卡當前正在使 时且正在開發中》卡及主機可經由若干特定協定而通 k,許多該等特定協定專用於特定媒體且其可包括各種特 定媒體命令^於許多該等命令可為媒體專㈣,所以可 116844.doc 200809593 出現以下狀況:當將在主機與媒體之間交換此命令時,於 沿線之某處該命令將需要被轉譯成可能不支援特定媒體命 令的另一協定。若此另一協定不具有相應命令,則主機將 不能夠成功地發出該命令。 舉例而言,除其用於主機之外,其亦通常供使用者存取 個人電腦上之卡。舉例而言,其通常用於一已用於(例如) 數位相機之卡且希望存取儲存在個人電腦上之卡中的相 片。由圖3之盒狀圖展示此情況。卡101通常經由一具有一 用於卡101之插座333的卡讀取器331而與個人電腦PC 351 通信,儘管在其他狀況下該卡可直接附著至PC 351。讀取 器331與PC 351通常將經由協定而通信,該協定至少在某種 程度上不同於由卡101用以與主機151通信的協定。讀取器 331基於勃體335(或硬體、軟體或此等硬體及軟體之某、组合) 而將來自PC 351之命令轉譯為適用於卡101的形式,其中通 常應瞭解,可視實施而由軟體與硬體之任何組合來執行此 功能。圖4中示意性地展示此過程。 為給出具體實例,在圖4中,將讀取器331視為使用SCSI 命令集與PC 351通信之USB裝置且將卡1〇1視為SD卡。因為 PC 351及讀取器331使用SCSI協定,所以當主機希望經由讀 取器而向卡發出命令時,其發出SCSI命令集中之命令401。 為將命令401傳送至讀取器,將命令4〇1置放於uSB包裝403 中、沿USB連接而傳輸至讀取器,且在該處移除uSB包裝。 卡碩取器331將接著將來自SCSI命令集之命令4〇1轉譯成 SD集中之相應命令或多個命令4〇5,從而允許將其傳遞至卡 116844.doc 200809593200809593 IX. INSTRUCTIONS: TECHNICAL FIELD OF THE INVENTION The present invention relates generally to the use and structure of removable electronic circuit cards, and more particularly to allowing a personal computer or other host to support a particular computer by The reader of the media card command and/or the host software use these commands. [Prior Art] Recently, small flash memories such as C0mpact Flash Card, Secure Digital (SD) card, MultiMediaCard (MMC), and Sony Memory Stick/Memory Stick ΡΓ0 Cards have been widely accepted by consumers. These devices are primarily designed for consumer electronic devices such as digital cameras and flash memory music players. However, it is also necessary to have a convenient connection to a personal computer for uploading and downloading data. Different cards have different electrical interfaces and typically have commands specific to the media that can be used by the host for the card. In addition, since these cards are activated to overload the additional functions between the cards and the cards, the card agreement may differ not only between card form factors, but also between cards of the same form factor. These commands typically have unique features such as specific input-output (I/O) and safe operation. Because the use of such cards becomes more diverse and they continue to be used for more types of applications, such new applications will typically involve features or commands that are not available in existing agreements. Examples of commercially available non-volatile memory cards having different mechanical and/or electrical interfaces include related multimedia cards available from Corporation of Sunnyvale, Sunnyvale, California, the assignee of the present application. 116844.doc 200809593 (" MMC") and Secure Digital ("SD") memory card. There are other cards that comply with the standards of the International Organization for Standardization ("ISO") and the International Electrotechnical Commission ("IEC"). The widely implemented examples are known as the IS0/IEC 7816 standard. The physical and electrical specifications of MMC are given in the "The MultiMediaCard System Specification"1, which is continuously updated and published by the MultiMediaCard Association ("MMCA") of Cupertino, California. Versions 2.11, 2.2, 3.1, and 4.0 of this specification dated June 1999, January 2000, June 2001, and February 2004 are expressly incorporated herein by reference. MMC products with varying storage capacities of up to 128 megabytes in a single card are currently available from SanDisk Corporation. These products are described in the MultiMediaCard Product Manual" Revision 2, published by SanDisk Corporation in April 2000, the disclosure of which is incorporated herein by reference in its entirety. U.S. Patent No. 6,279,144 and in Some aspects of the electrical operation of the MMC product are also described in the application Serial No. 09/186,064, filed on Nov. 4, the disclosure of which is incorporated herein by reference in its entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire all Such applications and patents to SanDisk Corporation are expressly incorporated herein by reference. A newer SD card is similar to an MMC card, except that it has the same thickness to accommodate the additional thickness of the additional memory wafer. The main difference between them is that the SD card includes additional data contacts to enable faster transfer of data between the card and the host. (The version of the MMC card with additional data contacts is also available, see above The MMC specification version 4.0 is described in the text. The other contacts of the SD card are the same as those of the MMC card, so that the slot designed to accept the 116844.doc 200809593 SD card will also accept MMC. The slot designed to accept the SD card can also be further manufactured between the SD card and the MMC card as described in US Pat. No. 6,820,148, which is incorporated herein by reference. An electrical interface and a functional interface are described in U.S. Patent Application Serial No. 09/641,023, filed on Aug. (The specifications of the SD card can be used by members of the SD Association (SDA).) Cards manufactured according to the ISO/IEC 7816 standard have different shapes, have surface contacts in different positions, and are different from MMC and SD cards. Electrical interface. The ISO/IEC 7816 standard has the overall title "Identification cards-Integrated Circuit(s) Cards with Contacts" and consists of parts 1 through 1 of individual periods from 1994 to 2000. This standard (a copy of which is available from Geneva, Switzerland, ISO/IEC) is expressly incorporated herein by reference. The ISO/IEC 7816 card is particularly suitable for use in a safe manner (which makes data extremely difficult or impossible) An application that stores data in an unauthorized manner. Small ISO/IEC 7816 cards are commonly used in cellular phones and other applications. As mentioned above, when these cards are used for new In the application, it may require features or commands that are not available in the existing version of the agreement. This can be illustrated with reference to Figure 1. As shown in the upper part of Figure 1, the goal is to exchange commands and data between the host side and a particular application on the card side (e. g., in a secure data transfer or e-commerce application). In order to implement this goal, the commands will need to be transferred between the host and the card, with the lower part of Figure i showing some of the soft layer on the host side and some of the firmware layers on the card side. 116844.doc 200809593 The instructions from the application layer of the host will be passed through the operating system, the file layer and the device (card) driver, terminating in the protocol by which they can be transferred to the card. Within the card, the instructions are then processed by the device layer firmware (which handles standard card operations) and passed to the application layer of the firmware. Depending on the configuration being used, the instructions in the transport protocol will be exchanged directly from the host to the card or via a mated reader or hardware to the card, which may have its own use. A software/firmware layer that translates from one agreement to another. One of the problems with this is that a certain stage of the translation between these layers' application expectation of the application may lack the corresponding command at some point along the path. As an example, a card is typically connected to a Pc host by using a hardware adapter that accepts commands from the host system (e.g., for USB). However, many specific media commands cannot be used in a protocol whereby the host and the hardware adapter communicate, even if the host application of the host computer wishes to transfer such commands to the card application. 2 shows a system of a first host and a card, wherein the card 101 can be connected to the host 151 either directly (e.g., by being inserted into the slot 153) or via some sort of adapter. The card tough system is indicated by FW105. (Refer to the card firmware 1〇5 and the reader firmware 335 in Fig. 3, it is understood that these functions can be implemented in hardware, software, or some combination of such hardware and software in general). An example of this host 151 can be a digital camera or a telephone. Several types of such cards are currently in progress and under development. Cards and hosts may pass through a number of specific protocols, many of which are specific to a particular medium and which may include various specific media commands. Can be specific to the media (4), so 116844.doc 200809593 The following situation occurs: When this command is to be exchanged between the host and the media, the command will need to be translated somewhere along the line to another one that may not support the specific media command. agreement. If this other agreement does not have a corresponding command, the host will not be able to successfully issue the command. For example, in addition to its use for a host computer, it is also typically used by a user to access a card on a personal computer. For example, it is typically used for a card that has been used, for example, in a digital camera and that wishes to access a card stored on a personal computer. This is illustrated by the box plot of Figure 3. The card 101 is typically in communication with the personal computer PC 351 via a card reader 331 having a socket 333 for the card 101, although in other cases the card can be attached directly to the PC 351. Reader 331 and PC 351 will typically communicate via a protocol that differs at least to some extent from the protocol used by card 101 to communicate with host 151. The reader 331 translates commands from the PC 351 into a form suitable for the card 101 based on the body 335 (or hardware, software, or some combination of such hardware and software), wherein it is generally understood that the visual implementation This function is performed by any combination of software and hardware. This process is schematically illustrated in Figure 4. To give a concrete example, in FIG. 4, the reader 331 is regarded as a USB device that communicates with the PC 351 using the SCSI command set and regards the card 1〇1 as an SD card. Since the PC 351 and the reader 331 use the SCSI protocol, when the host wishes to issue a command to the card via the reader, it issues a command 401 in the SCSI command set. To transfer the command 401 to the reader, the command 4〇1 is placed in the uSB package 403, transferred to the reader along the USB connection, and the uSB package is removed there. The card picker 331 will then translate the command 4〇1 from the SCSI command set into a corresponding command or multiple commands 4〇5 in the SD set, thereby allowing it to be passed to the card 116844.doc 200809593

因此,在不改變配接器或讀敗哭 土 艾心丧為:¾項取器之靭體的情況下,不能 夠將此媒體卡特定命令自主機傳遞至卡,配接器或讀取器 之勃體控制(hGSt)媒體卡引人其用於與主機通信之協定的 相應命令。無論何時料信隸之某處需要協定變化時或 當主機之作業系統不瞭解卡特徵時,即使在無獨立卡讀取 器的情況下,亦可出現類似情況。 為了使讀取器在咖命令集與叫令集之 間轉潭…”需要在兩個集中之均等命令。因此,若 主機希望藉由發請協定中之安全讀取命令而執行(例如) 對叫中之安全區域的讀取,則因為不存在此隨均等命 令,因此言買取器因為未在SCSI命令集中找到其而無法對此 進灯轉#且讀取請求將被視為其巾㈣者無足夠存取權限 之區域。對^種卡類型之其他特定媒體命令而言,將出 現相同情況,其中在讀取器所理解之協定中益發送至該綠 取器的用於主機之均等SCSI命令或多個均^csi命令/ 在先前技術中,此問題之方法將為改變配接器韌體以支 援用於經由配接器而傳送此等指令的特定命令或在讀取器 -主機協定中建立新命令,其每一者皆經定製以適於特定媒 體命令,諸如對應於(例如)SD卡之協定中之發送詢問命 令、接收回應命令等的彼等特定媒體命令。此等方法由於 許多原因而傾向於不切實際。舉例而言,該等協定通常係 基於一標準(其為了成為有用之標準而需要被廣泛接受且 通常傾向於偏好較不複雜之命令集;因此,當弓丨入新媒體 且現有媒體發展時難以將各種新的特定媒體命令引入命令 116844.doc -11- 200809593 集中。若替代地,改變配接器之拿刀體以允許特定命令傳遞 _體自身並不支援的彼等特定媒體命令,則此等配接器之 每一廉商的軟體將需要接受並進行適當韌體變化。因此, 引入個人電腦可利用各種特定媒體命令而不必改變讀取器 《勒體或主機-讀取器協定所使用的方法將具有極大益處。 更一般吕之,即使當卡直接與主機連接時,因為引入了 ' #特定應用程式命令,所以協定將需要被更新。即使可對 ❿ 5見有協定進行擴展及標準化以併人有新功能,此仍引入了 肖舊版本或彼等其他廠商之問題的相容性,從而極大地破 壞了‘準化協定之效用。另外,儘管該等協定可經調適以 適於新應用程式,但因為出現曰益增加之應用程式來擴展 卡之使用,所以此可能僅為臨時解決方案。因此,類似地 需要適應其中主機之作業系統不支援特定媒體命令之狀 況。 【發明内容】 _ 因此,簡言之且一般而言,本發明提供裝置(諸如,記憶 卡或其他積體電路卡)可與主機交換應用程式或特定媒體 命令所使用的方法及技術。主機與卡可直接地或經由讀取 -器或硬體配接器而通信,該讀取器或硬體配接器經由一不 . I有特定媒料令之均等命令的協定而傳輸特定應用程式 命令。舉例而言,在一實施例中,即使卡讀取器不支援此 命令,pc亦可經由卡讀取器而讀取81)(安全數位)記憶卡之 安全資料區域。 更具體言之,主機形成具有一在沿主機與卡之間的通信 116844.doc -12 · 200809593 路控而被支援的協定中之命令的扭 ”知令,同時實際媒體或特 定應用程式命令内嵌於該指令φ ^ ^ Τ。在例示性實施例中,特 定媒體命令内嵌於指令之資料部八+ ^ 竹邵>中。接著卡接收協定 卡經由該協定而與主機通信)申 上 之私令並將其轉譯為應用 程式之協定。内被命令以透明方々 乃万式傳遞·,例如,當傳輪協 定實際上可含有特定媒體命令時,兮扁μ 時,該傳輸協定正好傳遞至 卡上其認為是資料之處。一曰太本 ^ 一在卡中,其便識別出實際命Therefore, it is not possible to pass this media card specific command from the host to the card, adapter or reader without changing the adapter or reading the sorrow: 3⁄4 itemizer firmware The Bosch Control (hGSt) media card introduces its corresponding commands for communication with the host. A similar situation can occur even when there is no stand-alone card reader when it is known that there is a need for a change in the agreement or when the operating system of the host does not know the card features. In order for the reader to switch between the coffee command set and the call set..." requires equal commands in both sets. Therefore, if the host wishes to execute by issuing a secure read command in the agreement (for example) The reading of the security zone is called, because there is no such equal-order command, so the buyer cannot enter the light because it is not found in the SCSI command set# and the read request will be regarded as its towel (four). An area with insufficient access rights. The same will occur for other specific media commands of the card type, where equal SCSI for the host is sent to the green extractor in the agreement understood by the reader. Command or multiple ^csi commands / In the prior art, the method of this problem would be to change the adapter firmware to support specific commands for transmitting such instructions via the adapter or in a reader-host protocol New commands are created, each of which is customized to suit a particular media command, such as a particular media command corresponding to a send query command, a receive response command, etc. in an agreement such as an SD card. due to For many reasons, it tends to be impractical. For example, such agreements are usually based on a standard (which needs to be widely accepted in order to be a useful standard and tends to prefer a less complex set of commands; therefore, when bowing When entering new media and existing media development, it is difficult to introduce various new specific media commands into the command 116844.doc -11- 200809593. If instead, change the adapter body to allow specific commands to pass _ body itself does not support With their specific media commands, each software vendor of these adapters will need to accept and make appropriate firmware changes. Therefore, the introduction of personal computers can take advantage of various specific media commands without having to change the reader. Or the method used by the host-reader protocol would be of great benefit. More generally, even when the card is directly connected to the host, the protocol will need to be updated because the '# specific application command is introduced. Even if it is correct ❿ 5 See the agreement to expand and standardize to have new features, which still introduces the compatibility of the old version or the problems of other vendors. This greatly undermines the utility of the 'standardization agreement.' In addition, although these agreements can be adapted to new applications, this may only be a temporary solution because of the increased use of the application to extend the use of the card. Therefore, it is similarly necessary to adapt to a situation in which the operating system of the host does not support a specific media command. [Invention] Therefore, in summary, and in general, the present invention provides a device such as a memory card or other integrated circuit. Card) A method and technique for exchanging applications or specific media commands with a host. The host and card can communicate directly or via a reader or hardware adapter, the reader or hardware adapter The specific application command is transmitted via a protocol in which the specific medium has an equal command. For example, in an embodiment, even if the card reader does not support the command, the pc can also pass the card reader. And read 81) (safe digital) memory card security data area. More specifically, the host forms a twisted command with an order in the agreement supported by the communication between the host and the card 116844.doc -12 · 200809593, while the actual media or specific application commands are within the command Embedded in the instruction φ ^ ^ Τ. In the exemplary embodiment, the specific media command is embedded in the data section of the instruction VIII + ^ 竹 邵 >. Then the card receiving agreement card communicates with the host via the protocol) The private order and translate it into an application agreement. The command is transmitted in transparent form. For example, when the transfer agreement can actually contain a specific media command, the transfer protocol just passes To the card where it is considered to be the information. A slap in the face ^ in the card, it will identify the actual life

々内嵌於指令中且繼續提取該指人 相7。此係稭由判定命令之 資料部分含有—簽名錢行:若發現簽名1提取並執行 内欲命令β未發現簽名,則執㈣㈣定之命令4例 示性實施例中,簽名及内嵌命令 P 7置放於貧料部分之第一區 段中。在裝置侧實施轉換1中提取實際命令,且在主機 侧中,於裝置驅純式層級_㈣統層命令。裝 置驅動程式層級實施將命令定址至特定邏輯塊位址,同時 在檔案層級處可使用任何邏輯塊位址。儘管裝置驅動程式 層級實施需要較少額外魏用,h + A β , 而f平乂 乂頻汁粍用,但在許多作業系統中其可能 需要使用者所缺乏的存取權限。 士本發明之各種態樣不僅限於卡協定具有在主機與硬體卡 讀取器之間所使用的協定中無均等命令的命令之狀況,而 且限於其中中間協定需要載運其所缺乏之命令的其他狀 況。第-組實施例考慮其中卡可以其自身協定直接與主機 通信的狀況,但卡(或其他裝置)具有—具有需要使用一額外 命令集之額外特徵集的應用程式。此等命令並非由主機與 卡進行通信所使用的標準協定之部分,或並不由主機上之 116844.doc -13 - 200809593 標準作業系統加以支I蔓。因&,需要特定構件以在卡上之 應用程式(可於勒體層級實施)與主機上之應用程式(可於軟 體層級實施)之間來回地傳遞此等命令。在本發明之原理態 樣中,應用程式命令内嵌於中間協定中之指令的資料部分 中,在此狀況下該中間協定為卡協定。在本發明之另一= 樣中,此係藉由具有與開啟、關閉及管理自主機應用程= 至裝置之路徑相關的命令集來達成。 第二例示性實施例係實施於裝置(卡)驅動程式層級且使 用一指令,該指令指定特定邏輯塊位址(LB A)、卡傳遞(cpT) 模式LBA,該卡傳遞(CPT)模式LBA具有一特定簽名以通知 該卡一特定命令内嵌於區段中。此可被實施為卡韌體之變 化,以使得其支援CPT模式。此消除了根據每一特定媒體 命令而改變配接器之韌體的需要,使得卡可在任何(例 如)USB讀取器或配接器處執行而不必進行特定媒體調適 (或改變主機之作業系統(〇s) ’使得卡可在任何〇s下使 用)。卡韌體繼續執行(honor)正常讀取命令/寫入命令。在 使用至特定LB A偏移之讀取命令/寫入命令的情況下,檢查 一簽名以判定資料是否含有内嵌媒體卡特定命令。協定可 實施於任何媒體卡之韌體中。因此,在不改變讀取器韌體 的情況下’不需要配接器或USB或其他讀取器或主機〇s的 韌體改變。 第三組例示性實施例實施於主機侧之檔案層級。特定媒 體命令再次内嵌於中間協定中,但不是依賴於硬體詳細說 明及參考特定協定,而是將内嵌之命令及任何隨附資料全 116844.doc -14- 200809593 部置放於檔案之資料部分中,接著將該檔案傳送至媒體, 其中韌體再次提取實際命令。在此等實施例中,主機僅告 知棺案糸統將稽案寫入至記憶體裝置,其中裝置特定命令 再次内嵌於資料部分中。在使用至任何LB A之讀取命令/寫 入命令的情況下,與特定邏輯位址相反,裝置檢查一簽名 以判疋資料疋否含有内敗媒體卡特定命令。例示性實施例 、 將此簽名置放於與寫入命令相關聯之任何檔案中的第一資 料區段中。若發現適當簽名,則提取内嵌命令;若未發現 簽名,則將該命令解釋為中間協定之標準命令。以此方式, 本發明之檔案層級實施例允許繞過在裝置層級應用程式中 使用特定邏輯位址而出現的權限問題,因為在作業系統中 通常允許將檔案寫入至裝置。 在所有例示性實施例中,將内嵌命令置放於中間協定中 之寫入命令的資料部分中。舉例而言,裝置或特定應用程 式協定中之(例如)N個區段的寫入命令將由具有(Ν+ι)個資 • 料區段之中間協定中的寫入命令組成,第一區段含有實際 的内嵌寫入命令且剩餘]^個區段含有待寫入之實際 一般而言’可將命令(及簽名)連同待由内嵌命令傳送至裝置 &任何資料一起置放於接受相關聯冑料部分之任何命令 中。為實施裝置或特定應用程式協定中需要將資料自裝置 傳送至主機的讀取命令或其他命令,例示性實_使用— 對Ρ τ .第一命令將再次為具有一資料區段之中間協定中 的寫入命令,其對應於内嵌讀取命令(且不具有與内嵌讀取 相關聯的實數資料);自裝置至主機之實際資料傳送接著由 116844.doc -15- 200809593 第一命令(經定址至與第一命令相同的邏輯位址之主機讀 取)實現。 本發明之額外細節、特徵及優點自以下描述將變得顯而 易見,以下描述應結合隨附圖式來進行。 【實施方式】 在主要恶樣中’本發明允許在主機上之應用程式(通常 為使用卡上之應用程式的軟體)與卡上之應用程式(通常為 將此等額外特徵實施為卡上之特定應用程式的卡勃體)之 間來回地傳遞並非標準卡敎之部分(或不由主機上之標 準〇s而支援)的命令。例示性實施例藉由將特定命令内嵌於 任何主機所支援之標準命令(諸如寫人)中而實現此操作。此 允許諸如[先前技術]段巾所描述之記憶卡在所有標準主機 裝置及pc上被_、建置介面及使用,同時允許未經支援 之額外非標準特徵作為—標準而併人於系統中。 作為具體實例’參看關於圖2至圖4於先前技術中所述之 特疋狀況’此等方法允許專用於SD卡之命令(諸如安全讀 取)經由缺乏均等命令之_協定而傳輸。-般而言,此係 藉由形成-由存在於傳輸協定中之命令部分及一"内嵌 :特定媒體命令的資料部分組成之指令而實現。舉例而 吞’因為寫人命令對於記憶卡系統而言為基本命令,所以 其=存在於傳輸協^中且具有相關聯之資料部分。將實際 :定應用程式命令與簽名一起置放於資料部分中以指示將 執行特U體命令。亦將與待傳送至裝置之實際内钱特定 媒體命令相關聯的任何資料置放於傳輸協定之命令的資料 116844.doc •16- 200809593 邛分中。對於SD/USB實例而言,為在USB協定中將十個區 段之寫入讀取發送至SD卡,在包含一命令及十_個資料區 段的聰協定中發出—指令:第_資料區段含有實際犯安 全寫入命令以及一簽名及相關資訊,且隨後為待寫入之資 料之十個區段。當在卡中被接收時,韋刃體提取實際安全寫 '· 入命令、檢查簽名並執行資料之讀取。 " 對於讀取(及將資料自裝置傳送至主機之其他命令)而 參 百’中間協定中之寫入命令可再次用於載運内嵌讀取命 令,但因為此不提供待傳送回至主機之資料,所以現其與 中間協疋中之第二讀取命令成對。更具體言之,該對中之 第一命令將為來自主機之具有至邏輯塊位址lba=xyZ2 内嵌讀取命令的寫入(在中間協定中)。在裝置驅動程式層級 實施中,邏輯塊位址LBA=XYZ將為特定位址,同時對於播 案層級實施,此可為任何位址。接著該對中之第二命令為 至此同一位址LBA==XYZ的標準主機讀取。接著將特定資料 傳送至主機。 更一般而言,本發明允許藉由將所要命令與任何隨附資 料-起内喪於可由系統使用之中間或傳輸協定之指令中而 ' 纟主機與卡之間交換制程式或特定媒體指令。在執行於 .一侧的主機上之特定應用程式與另一側的特定卡上之相應 應用程式之間剖析(resolve)特定命令。在沿傳輸路徑之中間 點處’指令呈現為具有中間協定之正常命令,以透明方式 傳遞之實際特定應用程式命令。在例示性實施例中,此係 藉由使用接受一資料部分之傳輸協定中的命令(諸如寫入 116844.doc -17· 200809593 P 7)及將λ際應用私式或特定媒體命令内敌於此資料部 刀中而進行。(在某些方面’此為在2術年9月%日申請的 同在申請中之共同讓渡之美國專利申請案第则Μ89號 中所述的本發明之擴展,該案以引用的方式併人本文中。) 當指令(傳輸協定中)到達切,檢查資料部分以察看其是否 含有適當簽名’且若含有適當簽名,則提取㈣命令。圖5 中對此進行了示意性展示。 圖5為根據本發明之一特定實施例如何將一特定應用程 式命令内❹協定中之示意性表示,該減用於將協定自 主機應用程式傳遞至應用程式之卡側。考慮其巾應用程式 或特定媒體指令具有—命令部分、cmd及某相應資料之狀 況。舉例而言,CMD可為特^應用程式寫入。為傳輸此指 令,主機側將採用傳輸協定中之命令,稱其為CMD,,例如 寫入命令,其具有一相應資料部分。任何置放於此指令之 資料部分中的命令將簡單地傳遞;因此,若將實際之預期 特定應用程式命令C M D (連同其相應資料一起)内嵌於此資 料邛为中,則即使在傳輸協定中未識別出命令cMD其亦將 被傳輸至卡。一旦在卡中,命令CMD將需要自資料部分中 提取。此亦係藉由使卡傳遞簽名(cpT簽名)而置放於資料部 分中而進行:當傳入之指令到達卡上時,檢查資料部分中 之簽名,且若發現簽名,則接著提取實際命令。 在圖5中,於510處展示含有内嵌命令之傳輸協定中之指 令。命令部分511具有命令CMD,且可將其視為實際上將不 被執行但用來將資料部分513傳送至卡侧的一種"虛設"命 116844.doc -18- 200809593 令。可將資料部分513分成具有簽名及實際命令cmd之第一 部分513a及對應於CMD之任何資料的第二部分513b。舉例 而言,若CMD為一類型之寫入命令,則513b將為待寫入之 資料,而若其為(例如)狀態檢查,則將無5 13b。(如下文進 一步描述的,較可能為内嵌讀取命令,因為(在此實施例中) 其涉及發送傳輸協定之區段511中的寫入命令CMDI以及資 料部分之區段513a中的内嵌讀取命令〇1^1)及非實數資料部 分513b。)在卡側,接著檢查513a之簽名且若未發現簽名, 則將命令CMD’與513之全部作為資料加以執行。若發現簽 名,則提取具有包含命令CMD之命令部分531及具有資料部 分533中之任何相應資料的實際指令53〇。(在命令部分川 中具有足夠空間之諸如scs;[協定的協定中,亦可將CPT簽 名、命令CMD或其二者内嵌於傳輸協定之命令部分而非資 料部分中。) 返回參看圖1及本發明之更抽象描述,本發明允許應用程 式之主機側與卡侧通信,即使其需要在沿路徑之某處使用 一不適用於該應用程式之協定來彼此通信。此可為當配接 器不瞭解卡特徵(如先前技術中所描述)而且主機作業系統 不瞭解卡特徵時的狀況。此解決了具有或不具有位於主機 與卡之間的主機配接器之系統的媒體或特定應用程式命令 之發出。另外,其允許其中卡協定可不僅在卡形式因數之 間不同而且在相同形式因數之各種卡之間不同的狀況,因 為由於此等卡正變得過载有卡與卡之間可不同的額外功 能。本配置允許其中卡配接器及主機〇s與特定卡協定無關 116S44.doc -19- 200809593 的系統,其中在執行於-侧之主機上的特定應用程式與另 一側之特定卡上的特定應用程式之間剖析特定命令。 在主機側,本發明可實施於檔案系統層級(其中在檔案模 式中應用程式正使用主機檔案系統並寫入至檔案)或可實 施於裝置驅動程式層級(在一使用裝置驅動程式之模式 中)。下文給出兩種版本之特定實例。哪一類型之實施例係 較佳的通常將取決於諸如特定應用程式之詳細說明及作業 系統之細節。舉例而言,在裝置驅動程式層級之實施通常 較簡單且需要較少軟體/韌體額外耗用,但使用至邏輯位址 之直接寫入;然而,此直接寫入需要使用者將缺乏之管理 員權限。藉由替代地,使用檔案系統層級之實施可避免此 等複雜性,但以額外額外耗用為代價。 將藉由三個特定實施例之更詳細描述來說明本發明。所 有此等實施例允許在不改變用以支援新特徵之主機卡協定 或同時藉由不支援額外協定之中間軟體/硬體而使用其的 情況下,待實施於卡中之特定非標準特徵用於主機上。第 二及第三組實施例描述實施於主機側(分別在裝置驅動程 式層級及檔案系統層級)之兩個方法,同時第一實施例描述 卡側實施。此第一實施例補充第二及第三實施例並描述卡 側如何操作且亦將用於提供對所有實施例之更一般的細 節。如下文中更多描述的,此係使用標準可用命令以包封 (envelop)非標準命令而進行。對於此等狀泥中每一者而 言’例示性實施例選擇處處皆被支援之標準讀取寫入。應 注意,在此等特定實施例中,卡無需識別檔案之概念,因 116844.doc -20- 200809593 為在所有此等實施例中卡瞭解一至特定邏輯塊位址⑽A) 之寫入。此LBA可為此目的而被具體地配置(或再配置)(如 在裝置驅動程式模式中),或可為任何位址(在檔案驅動程式 模式中)。主要不同之處在於:在主機側(其中在播案模式 中應用程式正使用主機檔案系統並寫人至檔案,而在第 '弋中其正使用裝置驅動程式且直接寫入至lba。 在下文中’於#干特定實施例之實私丨中提出本發明之各 種心樣|例而s,該等實施例已將特定媒體命令内截於 寫入命令之資料部分中’·更—般而言’可將媒體或特定應 用程式命令内喪於其他命令卜同樣,[先前技術]中之論述 係基於具有特定協定域之特定硬體配置;亦即,其中pc, 主機使用一在主機與讀取器之間的協定及在讀取器與卡之 間的第二協定而經由硬體讀取器與卡進行通信。此等實施 例皆可以若干方式來一般化及擴展。 [先前技術]之論述集中於其中卡與pc經由讀取器而通信 之實例。更一般而言’當(在主機(例如,pc)與最終目標之 間的路徑中之某處)使用不具有需要傳輸之一或多個命令 之均等命令的協定時’本發明之各種態樣適用。如所提及 的’除當硬體卡讀取器以一在卡協定中不具有主機希望發 送至卡之特定媒體命令之均等命令(例如,SD卡中之安全讀 取)的協定(例如,USB/SCSI)與主機通信時出現的問題之 外’當卡接著直接地附著至主機時亦可出現問題。在更複 雜之狀況下,可存在若千Φ„w ~ 干中間協疋,在該狀況下可使用若 干内嵌層,如在第二實例中將看到的。 116844.doc -21. 200809593 作為當不需要存在獨立卡讀取器時的特定實例,存在具 有兩組接點之卡…組供仍輯使用且另―組供—標準組 (MMC、SD、CF等)之卡接點使用。(在皆於2⑽4年4月16日 申請之美國專射請㈣29/2〇3,693、US 1G/826,謝及us _26’796號中描述此等雙接點卡之實例,該等案皆以引用 的方式併入本文中。)在使用"正常"卡接點的情況下,卡可 以=許特定媒體命令之卡特定協定與第_主機通信。在使 用第二組接點(此處’聰)的情況下,卡可以缺乏特定媒體 命令之均等命令的另一不同協定與諸如pc之另一主機通 信。在此狀況下’第二主機以其中根據本發明而内嵌特定 媒體命令的其他協定與卡通信:例如,使用刪接點,卡 可在聰埠處直接連接㈣,藉此在使用㈣於如上所述 SCSI協定中之任何SD特定命令的情況下,其以scsi協定進 行通信。 如所提及的,在尤其有關的一組實施例中,主機與卡以 卡協定進行通信,但主機應用程式可希望與卡上之應用程 式交換命令及資料,其中在該卡之一層中不瞭解卡的"通常" 記憶體功能。舉例而言,SD記憶卡可為自SD特定韌體層隱 藏的裝置應用程式層分割。主機與卡將使用標準8]0協定進 行通信,但隱藏之装置應用程式可藉由將特定應用程式命 令内嵌於SD協疋内而與相應主機應用程式進行通信。第一 例示性實施例為此類型。 例示性實施例將特定媒體(或特定應用程式)命令内嵌於 寫入命令内。寫入命令係用作將命令内嵌於中間協定之資 116844.doc -22- 200809593々 is embedded in the instruction and continues to extract the finger phase 7. This straw is included in the data portion of the decision command - the signature money line: if the signature 1 is extracted and executed, the command is not found, the command is executed (4) (4). In the exemplary embodiment, the signature and the embedded command P 7 are set. Placed in the first section of the lean section. The actual command is extracted in the implementation of the conversion on the device side, and in the host side, the device drives the pure level _ (four) layer command. The device driver hierarchy implementation addresses commands to specific logical block addresses while any logical block address is available at the file level. Although the device driver hierarchy implementation requires less additional use, h + A β , and f is used, in many operating systems it may require access rights that are not available to the user. The various aspects of the invention are not limited to the condition that the card agreement has an order without an equal command in the agreement between the host and the hardware card reader, and is limited to the other in which the intermediate agreement needs to carry the command it lacks. situation. The first set of embodiments considers a situation in which a card can communicate directly with the host by its own agreement, but the card (or other device) has an application that has an additional feature set that requires the use of an additional command set. These commands are not part of the standard agreement used by the host to communicate with the card, or are not supported by the standard operating system on the mainframe 116844.doc -13 - 200809593. Because & requires specific components to pass these commands back and forth between the application on the card (which can be implemented at the Leiter level) and the application on the host (which can be implemented at the software level). In the principle aspect of the invention, the application command is embedded in the data portion of the instruction in the intermediate agreement, in which case the intermediate agreement is a card agreement. In another example of the invention, this is accomplished by having a set of commands associated with opening, closing, and managing the path from the host application to the device. The second exemplary embodiment is implemented at the device (card) driver level and uses an instruction that specifies a specific logical block address (LB A), card transfer (cpT) mode LBA, and the card transfer (CPT) mode LBA. There is a specific signature to inform the card that a particular command is embedded in the segment. This can be implemented as a change in the card firmware so that it supports the CPT mode. This eliminates the need to change the firmware of the adapter according to each particular media command so that the card can be executed at any (eg) USB reader or adapter without having to perform specific media adaptations (or changing the host's operations) System (〇s) 'Enables the card to be used under any 〇s. The card firmware continues to perform a normal read command/write command. In the case of a read command/write command to a particular LB A offset, a signature is checked to determine if the material contains an embedded media card specific command. The agreement can be implemented in the firmware of any media card. Therefore, the firmware of the adapter or USB or other reader or host 〇s is not required without changing the reader firmware. A third set of exemplary embodiments is implemented at the file level on the host side. Specific media commands are once again embedded in the intermediate agreement, but instead of relying on hardware details and reference to specific agreements, the embedded commands and any accompanying materials are placed in the archives. In the data section, the file is then transferred to the media, where the firmware extracts the actual command again. In these embodiments, the host only informs the file system to write the audit file to the memory device, where the device specific command is again embedded in the data portion. In the case of a read command/write command to any LB A, in contrast to a particular logical address, the device checks a signature to determine if the data contains an internal media card specific command. The illustrative embodiment places this signature in a first data section in any of the archives associated with the write command. If an appropriate signature is found, the embedded command is extracted; if no signature is found, the command is interpreted as a standard command of the intermediate agreement. In this manner, the file level embodiment of the present invention allows for the circumstance of privilege issues that arise with the use of specific logical addresses in device level applications, as files are typically allowed to be written to the device in the operating system. In all of the illustrative embodiments, the embedded command is placed in the data portion of the write command in the intermediate contract. For example, a write command for, for example, N segments in a device or a specific application agreement will consist of a write command in an intermediate contract with (Ν+ι) resource segments, the first segment Contains the actual embedded write command and the remaining sections contain the actual to be written. 'The command (and signature) can be placed on the device along with any data to be sent by the embedded command to the device. In any of the commands associated with the data section. To implement a read command or other command in a device or application-specific protocol that requires data to be transferred from the device to the host, an exemplary implementation - using - for τ τ. The first command will again be in an intermediate contract with a data segment. Write command, which corresponds to the embedded read command (and does not have real data associated with the embedded read); the actual data transfer from the device to the host is followed by the first command 116844.doc -15- 200809593 ( Implemented by a host that is addressed to the same logical address as the first command. Additional details, features, and advantages of the invention will be apparent from the description of the appended claims. [Embodiment] In the main case, the present invention allows an application on a host (usually a software that uses an application on a card) and an application on the card (usually implementing these additional features as a card) Commands that are not part of the standard card (or are not supported by the standard 〇s on the host) are passed back and forth between the application-specific Bobs. The exemplary embodiment accomplishes this by embedding a particular command in a standard command (such as a writer) supported by any host. This allows a memory card such as that described in the [Prior Art] segment to be used on all standard host devices and PCs, and to allow unsupported additional non-standard features to be used as standards in the system. . As a specific example, see the feature described in the prior art with respect to Figures 2 through 4'. These methods allow commands dedicated to the SD card (such as secure reading) to be transmitted via a protocol lacking an equal command. In general, this is accomplished by forming an instruction consisting of a portion of the command that exists in the transport protocol and an "embedded: data portion of the particular media command. By way of example, because the writer command is a basic command for the memory card system, it = exists in the transmission protocol and has an associated data portion. Place the actual application command with the signature in the data section to indicate that the special U body command will be executed. Any information associated with the actual money-specific media order to be transmitted to the device is also placed in the information of the order of the transmission agreement 116844.doc •16- 200809593. For the SD/USB instance, in order to send the read and read of the ten segments to the SD card in the USB protocol, the command is issued in the Cong Agreement containing a command and ten data segments. The section contains the actual compromised write command and a signature and related information, and is then the ten sections of the data to be written. When received in the card, the blade extracts the actual security write command, checks the signature, and performs the reading of the data. " For the read (and other commands to transfer data from the device to the host), the write command in the EM's intermediate protocol can be used again to carry the embedded read command, but since this is not provided back to the host The information, so it is now paired with the second read command in the intermediate agreement. More specifically, the first command in the pair will be a write from the host with an inline read command to the logical block address lba = xyZ2 (in an intermediate contract). In a device driver level implementation, the logical block address LBA = XYZ will be a specific address, and for a broadcast level implementation, this can be any address. The second command in the pair is then read by the standard host with the same address LBA==XYZ. The specific data is then transferred to the host. More generally, the present invention allows for the exchange of programming or specific media instructions between a host and a card by severing the desired command with any accompanying information in an intermediate or transport protocol that can be used by the system. A specific command is resolved between a particular application on the host executing on the . side and a corresponding application on a particular card on the other side. At the intermediate point along the transmission path, the instruction is presented as a normal command with an intermediate protocol, transparently passing the actual specific application command. In an exemplary embodiment, this is done by using a command in a transport protocol that accepts a data portion (such as writing 116844.doc -17. 200809593 P 7) and by using λ inter-application private or specific media commands. This data section is carried out in the knife. (In some respects' this is an extension of the invention described in U.S. Patent Application Serial No. 89, the commonly assigned application in the same application. In this article.) When the instruction (in the transport protocol) arrives at the cut, the data portion is checked to see if it contains the appropriate signature' and if the appropriate signature is included, the (four) command is extracted. This is shown schematically in Figure 5. Figure 5 is a schematic representation of how a specific application command is in accordance with a particular embodiment of the present invention, which is used to pass the agreement from the host application to the card side of the application. Consider the condition of the towel application or specific media instructions - the command part, cmd, and a corresponding piece of data. For example, CMD can be written for special applications. To transmit this command, the host side will use the command in the transport protocol, which is called CMD, such as a write command, which has a corresponding data portion. Any commands placed in the data section of this directive will simply be passed; therefore, if the actual expected specific application command CMD (along with its corresponding material) is embedded in this data, then even in the transport protocol The command cMD is not recognized and will be transmitted to the card. Once in the card, the command CMD will need to be extracted from the data section. This is also done by placing the card with a signature (cpT signature) in the data portion: when the incoming instruction arrives on the card, checking the signature in the data portion, and if the signature is found, then extracting the actual command . In Figure 5, the instructions in the transport protocol containing the embedded commands are shown at 510. The command portion 511 has a command CMD and can be regarded as a "dummy" 116844.doc -18-200809593 order that will not actually be executed but is used to transfer the data portion 513 to the card side. The data portion 513 can be divided into a first portion 513a having a signature and an actual command cmd and a second portion 513b corresponding to any material of the CMD. For example, if CMD is a type of write command, then 513b will be the data to be written, and if it is, for example, a status check, there will be no 5 13b. (As further described below, it is more likely to be an inline read command because (in this embodiment) it involves the write command CMDI in the section 511 of the transmit transport protocol and the inline in the section 513a of the data portion. The command 〇1^1) and the non-real data portion 513b are read. On the card side, the signature of 513a is then checked and if no signature is found, all of the commands CMD' and 513 are executed as material. If a signature is found, the actual command 53 具有 having the command portion 531 containing the command CMD and any corresponding data in the data portion 533 is extracted. (In the command part, there is enough space such as scs; [in the agreement, the CPT signature, the command CMD, or both of them can be embedded in the command part of the transmission agreement instead of the data part.) In a more abstract description of the invention, the present invention allows the host side of the application to communicate with the card side even if it needs to communicate with each other using a protocol that is not applicable to the application somewhere along the path. This can be the case when the adapter does not understand the card features (as described in the prior art) and the host operating system does not understand the card features. This resolves the issuance of media or specific application commands for systems with or without host adapters between the host and the card. In addition, it allows for situations in which the card agreement can differ not only between card form factors but also between various cards of the same form factor, since there may be additional differences between the card and the card as these cards are becoming overloaded Features. This configuration allows a system in which the card adapter and host 〇s are independent of a particular card agreement 116S44.doc -19- 200809593, where a particular application on the host executing on the - side is specific to the particular card on the other side Analyze specific commands between applications. On the host side, the present invention can be implemented at the file system level (where the application is using the host file system and writing to the file in the file mode) or can be implemented at the device driver level (in a device driver mode) . Specific examples of the two versions are given below. Which type of embodiment is preferred will generally depend on details such as the specific application and details of the operating system. For example, implementation at the device driver level is generally simpler and requires less software/firmware extra consumption, but uses direct writes to logical addresses; however, this direct write requires management that the user will lack. Permissions. By using the file system hierarchy instead, this complexity can be avoided, but at the expense of additional overhead. The invention will be illustrated by a more detailed description of three specific embodiments. All such embodiments allow for the use of specific non-standard features to be implemented in the card without changing the host card agreement to support the new feature or by using the intermediate software/hardware that does not support the additional protocol. On the host. The second and third sets of embodiments describe two methods implemented on the host side (at the device driver level and the file system level, respectively) while the first embodiment describes the card side implementation. This first embodiment supplements the second and third embodiments and describes how the card side operates and will also be used to provide a more general detail of all embodiments. As described more below, this is done using standard available commands to envelop non-standard commands. For each of these isoforms, the exemplary embodiment is selected to be supported by standard read writes. It should be noted that in these particular embodiments, the card does not need to recognize the concept of a file, as 116844.doc -20-200809593 is a write to a particular logical block address (10) A) in all of these embodiments. This LBA can be specifically configured (or reconfigured) for this purpose (as in device driver mode) or can be any address (in file driver mode). The main difference is that on the host side (where the application is using the host file system and writing the file to the file in the broadcast mode, and in the '弋 it is using the device driver and writing directly to the lba. In the following The various embodiments of the present invention are presented in the context of a particular embodiment of the invention, and the embodiments have intercepted a particular media command into the data portion of the write command. 'The media or specific application commands can be succumbed to other commands. Similarly, the discussion in [Prior Art] is based on a specific hardware configuration with a specific protocol domain; that is, where pc, the host uses one in the host and reads The agreement between the devices and the second agreement between the reader and the card communicates with the card via the hardware reader. These embodiments can be generalized and extended in several ways. [Prior Art] Focusing on instances in which a card communicates with a pc via a reader. More generally, 'when (in somewhere in the path between the host (eg, pc) and the final destination) use does not have one or more of the required transmissions Order The various aspects of the invention are applicable when the agreement of the order is applied. As mentioned, except that the hardware card reader does not have an equal command in the card agreement that does not have a particular media command that the host wishes to send to the card (eg In addition to the problems that occur when communicating with the host (for example, USB/SCSI), the problem can also occur when the card is directly attached to the host. In more complicated situations, There are several intrinsic layers that can be used in this situation, as will be seen in the second example. 116844.doc -21. 200809593 as when there is no need to have a separate card read For a specific example of the device, there are cards with two sets of contacts... the groups are used for the serial use and the other groups are used for the card contacts of the standard group (MMC, SD, CF, etc.) (both in 2 (10) 4 years in April Examples of such dual contact cards are described in U.S. Patent Application Serial No. 4, the entire disclosure of which is incorporated herein by reference. In the case of using "normal" card contacts, the card can be = specific media life Having the card specific agreement communicate with the host. In the case of using the second set of contacts (here 'consent'), the card can communicate with another host, such as a pc, in a different agreement that lacks an equal command for a particular media command. In this case, the second host communicates with the card in other protocols in which specific media commands are embedded in accordance with the present invention: for example, using a delete point, the card can be directly connected at the smart (4), thereby using (d) In the case of any of the SD specific commands in the SCSI protocol as described above, it communicates in the scsi protocol. As mentioned, in a particularly relevant set of embodiments, the host communicates with the card in a card agreement, but the host application The program may wish to exchange commands and data with the application on the card, where the card's "normal" memory function is not known at one level of the card. For example, an SD memory card can be segmented by a device application layer hidden from an SD specific firmware layer. The host and card will communicate using the standard 8]0 protocol, but the hidden device application can communicate with the corresponding host application by embedding specific application commands in the SD protocol. The first exemplary embodiment is of this type. The illustrative embodiments embed specific media (or application specific) commands within a write command. The write command is used to embed the command in the intermediate agreement. 116844.doc -22- 200809593

料部分内的實例且寫入命令固有地具有一資料部分。更一 般而s,不僅可類似地利用寫入命令而且可類似地利用接 又資料部分之任何命令。由於寫入為協定中用以傳送資 料之基本指令,所以下文之例示性實施例將繼續根據寫入 進订描述》此外,儘管為簡單起見在所有實例中媒體或特 定應用程式命令内喪於資料部分之開始處,但更-般而 5 ’其可置放於資料部分中之其他處且由簽名來識別。(如 上文所提及的,更一般而言’簽名、應用程式命令或其二 者亦可内嵌於協定(在其命令部分中具有足夠空間)中之傳 輸協定(諸如SCSI協定)的命令部分中。) 本發明涉及之問題可以更抽象之層次而呈現。考慮盆中 主機應用程式需要以一具有命令集(α、β、γ、…)之協:與 裝置應m進行通信’但在通信路彳i巾之某處需要使用 广有p 7集(A B、…)之另一協定。在[先前技術]之實例中, (0”、...)將為犯協定且中間命令集(八、3、...)將為隨 協定。在下文之論述中,(α、ρ、γ、·..)將為用於特定應用 私式(堵如隱藏分割)之命令集且(A、B、.·.)將替代地為卡命 令集。只要存在對應關係A〜、p等,便不存在問題。 當存在不具有中間協定中之均等命令:?,的媒體或特定 應用程式^令γ(例如,SD協定中之安全讀取)時,出現困 難。在先前技術下,將需要對於每—此γ〜均等 命令(例如,C㈠γ)。膏彳杳或,拍據士& " 八肉發明,將特定媒體命 令内敗於中間協定中之現有命令中(Α(γ)^, 示一内嵌有γ之寫入(例如)命令),而非引入新命令。 116844.doc •23· 200809593 一般而言’將一命令(稱其為?)引入(α、p、丫、…)協定中 以開啟供應用程式之主機側與裝置侧通信的管線。一旦該 管線開啟,便可接著發送媒體或特定應用矛呈式命令。此 表示為續⑺卜γ。將在第一實例,發展此技術。此允許 處理命令失敗及其他細微之處。具有命令失敗之問題在The instance within the material portion and the write command inherently have a data portion. More generally, not only can the write command be utilized similarly, but any command in the data portion can be similarly utilized. Since the write is a basic instruction in the protocol for transferring data, the following exemplary embodiments will continue to be based on the write-description description. In addition, although for the sake of simplicity, media or application-specific commands are lost in all instances for simplicity. At the beginning of the data section, but more generally 5' it can be placed elsewhere in the data section and identified by the signature. (As mentioned above, more generally the 'signature, application command, or both, can also be embedded in the command portion of the transport protocol (such as the SCSI protocol) in the agreement (with sufficient space in its command portion) The problems involved in the present invention can be presented at a more abstract level. Consider the host application in the basin needs to have a combination of command sets (α, β, γ, ...): communicate with the device should be 'but' need to use the wide p 7 set somewhere in the communication path ,...) another agreement. In the example of [Prior Art], (0", ...) will be the agreement and the intermediate command set (8, 3, ...) will be the agreement. In the following discussion, (α, ρ, γ,·..) will be the command set for the specific application private (blocking such as hidden segmentation) and (A, B, ..) will be replaced by the card command set. As long as there is a corresponding relationship A~, p, etc. There is no problem. When there is a medium or a specific application that does not have an equal command in the intermediate agreement: γ (for example, a secure read in the SD protocol), there is a difficulty. Under the prior art, Need for each - this γ ~ equal command (for example, C (one) γ). Paste or, according to the priest & " eight meat invention, the specific media command is defeated in the existing command in the intermediate agreement (Α (γ) ^, shows a write (for example) command with γ embedded in it, instead of introducing a new command. 116844.doc •23· 200809593 In general, 'introducing a command (called it as ?) (α, p, 丫, ...) in the agreement to open the pipeline between the host side and the device side of the application. Once the pipeline is open, it can be sent Particular application as a lance or command type. This is expressed as BU continued ⑺ gamma]. In the first example, the development of this technology. This allows processing and other nuances of command failure. Failure of the command in question has

於:由於據巾間協定所知,其正發送-簡單寫人命令,故 中間協定不瞭解内嵌命令之性質。若内丧命令為(例如)讀 取,則pc將不會知道在讀取失敗的情況下已發生什麼。在 中間協定中,將其視為寫人失敗且不將其解釋為内嵌讀取 =失敗;因此,主機將不㈣解待執行之適當復原步驟。 藉由開啟在應用程式之主機側與卡側之間的管線,可更易 於追縱並處理此等困難。 第一例示性實施例 第一例示性實施例係實施於主制的㈣層級且將用於 »兄明本發明之各種,4樣;在卡側,不管主機侧是實施於檀 案層級還是實施於裝置驅動程式層級,實純大程度上為 相同的。當參考此實施例之特定應用程式時,其將在記憶 卡上之隱藏分割之内容中被給出,其中記憶體分成可公共 存取部分及一私用(或"隱藏")部分。在於2004年12月21日申 請之美國臨時專利巾請案6g/63M()4(該案以引料方式併 入本文中)巾描述此配置,料多數細節並未被如此限制。 百先:描述主機側部分(詳言之,裝置驅動程式),隨後描述 卡、、-田即。在以下專利中請案中描述隱藏分割之使用的其他 實例,、王口P以引用的方式併入本文中:在2祕年2月日 116844.doc -24- 200809593 申請之ll/067,298 ;在2003年11月ι〇日申請的i〇/7〇3,471 ; 在2004年7月26曰申請之i〇/899,260 ;及在2005年2月2曰申 請的 11/050,013。 圖6為展示裝置側之例示性結構的示意性方塊圖。在卡 1〇〇1側’裝置應用程式或多個應用程式1〇23各自提供用於 主機側1051之主機應用程式或多個應用程式1〇53至對於此 特定形式因數的非標準卡特徵(此處為隱藏分割)的閘道 或’’官線”。下文在圖7中更多地描述主機側層的情況。在卡 侧,裝置應用程式1023供應分割存取(讀取及寫入)、狀態及 其他裝置應用程式資訊。裝置應用程式丨023可經由下文所 述之例示性協定而與主機應用程式1〇53通信且經由媒體層 1025而使用卡之系統及記憶體資源。在記憶體1〇11處指示 記憶體自身且其通常將為NOR或NAND種類之快閃記憶 體,儘管其亦可為其他非揮發性記憶體,包括2〇〇4年5月7 曰之美國專利申請案1〇/841,379(該案以引用的方式併入本 文中)中所述之彼等記憶體。FE(前端)層1〇21為韌體層,其 處理來自主機侧之命令(在諸如CF、SD、MMC等協定之卡 類型介面中)。BE("後端")層1027為韌體層,其處理對記憶 體loii之管理,包括讀取及寫入至記憶體。媒體層1025將 裝置應用程式韌體1023與BE層1027相連接且亦對應用程式 韋刃體與控制器之RAM資源建置介面,該控制器未在此圖中 具體展示。 當自主機1051發送指令時,最初在裝置1001上於前端 (FE)層1021處接收到該指令。該命令將在於主機與裝置之 116844.doc -25- 200809593Yu: As far as the agreement is concerned, it is sending a simple write command, so the intermediate agreement does not understand the nature of the embedded command. If the internal command is, for example, read, the pc will not know what has happened in the event of a read failure. In an intermediate agreement, it is considered a writer failure and is not interpreted as an inline read = failure; therefore, the host will not (4) resolve the appropriate recovery steps to be performed. By opening the pipeline between the host side and the card side of the application, it is easier to track down and handle these difficulties. First Exemplary Embodiment The first exemplary embodiment is implemented in the (four) hierarchy of the main system and will be used for the various aspects of the present invention, 4; on the card side, whether the host side is implemented at the level of the Tan or the implementation At the device driver level, the real purity is largely the same. When referring to the particular application of this embodiment, it will be given in the content of the hidden partition on the memory card, where the memory is divided into a publicly accessible portion and a private (or "hidden") portion. This configuration is described in the U.S. Provisional Patent Accessory Application No. 6g/63M() 4 filed on December 21, 2004 (which is incorporated herein by reference). Most of the details are not so limited. Hundreds of first: Describe the host side part (in detail, the device driver), then describe the card, and - Tian. Other examples of the use of hidden segmentation are described in the following patents, and Wangkou P is incorporated herein by reference: in the second secret year of February 116, 116844.doc -24-200809593, application ll/067,298; I〇/7〇3,471 applied for on ι〇日 in November 2003; i〇/899,260 applied on July 26, 2004; and 11/050,013 applied on February 2, 2005. Fig. 6 is a schematic block diagram showing an exemplary structure of the device side. On the card 1〇〇1 side, the device application or the plurality of applications 1〇23 respectively provide a host application or a plurality of applications 1主机53 for the host side 1051 to non-standard card features for this particular form factor ( Here is the gateway or ''official line' of the hidden partition). The case of the host side layer is more described below in Fig. 7. On the card side, the device application 1023 supplies split access (read and write) , status and other device application information. The device application 023 can communicate with the host application program 153 via the exemplary protocol described below and use the card system and memory resources via the media layer 1025. 1〇11 indicates the memory itself and it will typically be a NOR or NAND type of flash memory, although it may be other non-volatile memory, including US Patent Application May 7, 2004 Their memory is described in 1 〇 / 841, 379 (hereby incorporated by reference). FE (front) layer 1 〇 21 is a firmware layer that processes commands from the host side (in such as CF) Card types such as SD, MMC, etc. The BE ("Backend") layer 1027 is a firmware layer that handles management of the memory loii, including reading and writing to the memory. The media layer 1025 will device the application firmware 1023 and BE. Layer 1027 is connected and also interfaces to the RAM resources of the application and the controller. The controller is not specifically shown in this figure. When the command is sent from the host 1051, it is initially on the device 1001 at the front end (FE). The instruction is received at layer 1021. The command will be in the host and device 116844.doc -25- 200809593

間所使用的中間協定(例如,SD協定)中。當命令到達FE層 1021時’檢查命令傳遞簽名:若未發現簽名,則將該指令 視為來自中間協定之標準指令且該指令可存取記憶體或以 標準方式來執行該指令;若發現簽名,則提取内嵌特定應 用程式命令且將其傳遞至適當裝置應用程式1〇23上以供執 行。當實施於裝置驅動程式層級(主機側)(如在下文之第二 例不性實施例中)時,將命令定址至特定邏輯位址,同時當 實施於檔案層級(如在此實例與以下第三實例中)時,可將命 令定址至任何邏輯位址;如自裝置側所瞭解的,兩個實施 在报大程度上為相同的。 一旦發現簽名且提取内嵌命令,便使隱藏分割(在此實例 中)經由位於卡1〇〇1上之相應裝置應用程式1〇23而可用於 主機應用程式1053。主機與裝置應用程式將使用一將覆蓋 主機側與卡侧之間的讀取及寫入之協定以及報告分割狀態 而進仃通信。在此例示性實施例中,裝置控制對應用程式 之權限。當裝置確認主機應用程式之憑證(eredentiai)時給 予該等權限(讀取、寫入),且一經核準,裝置應用程式便經 由主機/裝置協定而向分割授予讀取及寫入權限。一旦已確 認主機應用程式,便接著假定裝置正運作於信任環境中。 如所提及的,第-例示性實施例將實施於槽案層級,立 中内叙命令置放於寫入檔案之第一資料區段中。實施並; 依賴於對任何特定邏輯位址之參考,而是依賴於檢查第一 編段的特定圖案或簽名。分割中之檔案係由主機加以 官理,其意味著在隱藏分割實例中,主機應用程式為障藏 116844.doc -26 - 200809593 ^之檔㈣統的所有者一旦主機應用程式獲得對應 私式之權限,其便完全控制内容。 〜:管口於作業系統(os)之存取權限問題而通常不能夠 °貝取藏分割之FAT,所以主機應用程式1 〇 5 3將實施檔案系 如同對隱藏分割之任何存取—般,僅在至應用程式 之官線開啟之後FAT才為可用的。(下文將界定及闡述由主 機應用/式進行的命令傳送。)由大容量儲存裝置或抽取式 I:動私式層級之Qs所瞭解的,主機制程式將位於卡之非 隱藏或公共分割上。若干此等主機應用程式可位於此區域 中且使用者將知道執行哪一個主機應用程式、將在主機側 執仃哪一個主機應用程式。 參看圖7更詳細地描述主機侧軟體層。裝置驅動程式1055 八有兩個任務其充當匯流排驅動程式並執行由(中間)協定 及標案系統1〇57支援的標準用戶端應用程式之⑴操作。此 外,其亦實施應用程式及裝置或特定應用程式協定。標準 I〇 API及實施可為卡家族之全部所共有(例如,標準SD卡操 作)。應用程式或特定裝置Αρι及實施本質上為特定協定。 圖7展不階層式結構之實例,該階層式結構賦能共同部分之 碼共用及不同特定應用程式協定之間的簡單可移植性。 除主機應用程式層i 053及檔案系統層1〇57之外,主機結 構現亦併人有專用於裝置應用程式之層!吻。對於"標準" 裝置操作(未併人有特定應用程式操作)而言,不使用層1059 且層1053、1057及1〇55將女辦μ l 4 乂 5將大體上如先前技術中一般而操 作。當將使用特定;ft用藉#人* 疋應用私式扣令時,裝置應用程式層1〇59 116844.doc -27- 200809593 將被插入於檔案系統1〇57與主機層1053之間,以格式化及 内嵌特定應用程式命令。 裝置驅動程式1055可包括介面及管線子層以提供常用功 能性且可配合所有特定應用程式協定之最小變化一起使 用。主機之應用程式應根據特定應用程式而與協定層匹 配。介面子層將呈現一組標準裝置功能。舉例而言,此等 功能將包括:硬體初始化及組態;驅動程式開啟及關閉例 行程序;讀取及寫入操作;及擦除。其亦將包括用於進行 適當通4方法並因此而初始化管線之功能。 當傳輸諸如圖5之5 10的指令時,在某些狀況下,作業系 統(OS)可將其分成若干片,可能甚至插入其他指令的片。 在此等狀況下,檔案系統1057及裝置驅動程式1055可分解 指令510 ’使得命令部分511處於不附著至資料部分513直至 附著至所有資料部分5 13中的任一情況下,其中剩餘資料部 分接著在一或多個隨後傳送中被傳送。在此等狀況下,對 剩餘資料部分之隨後傳送將沒有區段5 13&之簽名部分並表 現為標準命令。對於在讀取操作中自卡傳送至主機之資料 而吕,亦可發生此分割。在其中已知〇8將不分裂指令或〇s 可受到足夠控制以使得其可經指示以不進行此操作的狀況 下,可簡化程序。首先參看圖10A之流程及圖12之相應狀態 機圖對此進行論述。隨後將參看圖1〇B論述更一般之狀況。 此外,為論述之簡單起見,參看圖1〇A之論述大體上將基於 僅有單一應用程式之狀況,儘管通常將有若干不同的此等 應用程式在作用中。圖10B之更一般狀況將使此更明確。 116844.doc -28- 200809593 對於第一例示性實施例,將簡單隱藏分割協定用於說 明。將記憶體1〇11分成兩個分割。第一分割為產品標準分 割。標準主機僅瞭解此分割。第二分割為僅可經由特定應 用程式命令而存取之隱藏分割。標準主機不瞭解此分割且 沒有辦法存取該分割。該實例之隱藏分割協定界定了裝置 與應用程式進行通信而使用的五個功能: 1·開啟隱藏分割:用於鑑認使用者並賦能讀取及寫入操 作。 ’、 2·關閉隱藏分割:去能讀取及寫入操作。 3·獲得隱藏分割狀態:傳回圖8中所示之資料。 4·隱藏分割讀取:若分割開啟,則自隱藏分割進行讀取。 若分割關閉,則傳回一錯誤。 5·隱藏分割寫入:若分割開啟,則寫入至隱藏分割。若 分割關閉,則傳回一錯誤。 協定層提供實施安全協定所需之額外ApI。在隱藏分割之 特定實例中,除讀取及寫入之外,協定還需要三個服務·· 開啟分割、關閉分割、獲得分割狀態。下文在表丨中展示此 等印々,其中結合圖8對其進行進一步論述。 管線子層負責根據媒體命令傳遞原理而與卡進行的通 信。如先前所描述,媒體命令傳遞協定中之主要思想為將 特疋命令(並非標準產品規格之一部分的命令)内嵌於標準 項取及寫入操作内。將該等命令内嵌於標準讀取及寫入操 作中使得能夠與標準主機及驅動程式一起工作。 在例示性實施例冲,所有命令將藉由將一寫入命令發送 116844.doc -29- 200809593 至媒體卡之某一 LB A而初始化。特定應用程式寫入命令將 包括多個區段傳送,其中第一區段保存命令之自變數且剩 餘資料塊保持相關資料(若存在)。將在兩個部分中執行讀取 命令: 1.藉由首先將一寫入命令發送至一具有描述讀取命令 之性質的適當資料之選定LBA而初始化該讀取命令。 2·在寫入命令將卡應用程式設定於正確傳送狀態之 後,自寫入命令將讀取命令發送至選定LBA以執行自 卡至主機的實際資料傳送。 所有命令首先發送一具有圖9所示區段格式的寫入命 令。當主機應用程式決定發送寫入命令時,所傳送之第一 區段將具有上述格式。自主機發送之下一資料塊將具有卡 之實際資料。若主機應用程式決定初始化讀取命令,則其 首先將一寫入命令發送至具有上述單一區段格式之選定 LB A(LB A=LB A—XYZ)並接著將一讀取發送至同一 LB A。在 下文進一步論述之圖10A及圖10B之流程圖中對此進行展 示。 若干可能之實施可用於媒體命令傳遞協定。此段之實例 使用檐案系統,例如Windows標案系統操作。下一段之實例 在裝置驅動程式層級直接與裝置通信且不具有檔案系統額 外耗用。另一實施可用於袖珍型PC(PPC)。在此最末狀況 下,讀取及寫入操作可直接存取PPC儲存驅動程式。由於此 處不存在用於袖珍型PC裝置之標準儲存裝置驅動程式,所 以不保證此方法將適用於所有PPC裝置。用戶端應用程式廠 116844.doc -30- 200809593 商應使用其意欲與之一起工作的PPC裝置組對此方法進行 測試。 返回本實例之檔案系統實施,對於其中OS將在單一傳送 中傳送完整指令的狀況而言,管線子層藉由自(如圖10A中 之LBA_XYZ所指示的)相同檔案位置進行讀取及寫入至該 相同檔案位置而初始化對命令傳遞LB A的讀取及寫入操 作。此無需如下一段之實例中一般為預定位址,而是可為 任何邏輯塊位址。對於此實例而言,實施使用Windows之標 準檔案系統 API-CreateFile、ReadFile、WriteFile 及 SetFilePointer。可將實施集合分成四個或五個部分:預先 之要求;通信管線之建置;檔案長度之驗證;應用程式寫 入命令;及若將讀取資料或將其他資訊傳回主機,則為讀 取命令。 在檔案層級實施中,檔案系統用於不知不覺地傳輸内嵌 之特定應用程式命令。由於實際内嵌命令可不同於檔案系 統認為其正發送的在中間協定中之命令之性質,所以若不 採取適當步驟則可出現衝突。舉例而言,若出現錯誤,則 因為當實際錯誤可與内嵌命令(例如,讀取命令)在一起時檔 案系統會將此視為中間協定中之載運命令(寫入命令)中的 錯誤,故錯誤復原可為複雜的。類似地,若檔案系統採用 快取,則可導致不一致。 另一問題可由於檔案分段而產生:因為例示性實施依賴 於自相同檔案位置(圖10A之LBA_XYZ)進行讀取及寫入至 該相同檔案位置,所以應將整個檔案儲存至記憶體中一連 116844.doc -31- 200809593 續群組之區段。若待在LBA一χγζ處開始儲存之資料大於可 用片段(segment),則檔案系統將會將其分開。因此,特定 應用程式命令之最大資料長度應不大於最小〇8檔案配置單 兀(叢集),使得所使用之邏輯位址(LBA—χγζ)與一具有足 夠空間之邏輯塊位址相關聯。 在Windows實例中,檔案系統實施之預先之要求需要一含 有至少128個連續區段的標準檔案。為確保此檔案之存在, 將其建立於格式化之磁碟機上。因此,若主機應用程式廠 商選擇此方法,則其應佈署具有該應用程式之通信檔案。 在此實例中,設計假定名為"FilePipe”之檔案(具有下文指定 之某些屬,性)存在於裝置使用者區域中。若此檔案不存在, 則驅動程式將試圖建立該檔案。若其失敗,則應用程式可 要求使用者格式化磁碟機並在格式化磁碟機上重新安裝應 用程式。 為建置通信管線,裝置驅動程式1055較佳開啟具有以下 屬性之通信檔案: 未經共用 未緩衝 經隱藏 未經共用之狀態確保僅主機應用程式可存取檔案,以防 止其他應用程式存取命令傳遞LB A。未緩衝狀態指示系統 開啟無中間緩衝或快取之檔案。因此,至/自此檔案之任何 寫入或讀取導致不同於快取版本的至/自卡之讀取命令/寫 入命令。(在某些狀況下,為確保將刷新至卡的檔案,可能 116844.doc -32- 200809593 程βΓ "旗標與"寫傳遞"旗標。)由於實際應用 =式或特定媒體命令内喪於另一協定之命令中,所以當存 例如)寫人錯誤時,主機將此解释為與中間敎中之寫入 ::!關的錯誤而非與内嵌命令有關之錯誤。未緩衝狀態 …貝料傳送與預期的内嵌命令相關。隱藏狀態暗示最終 使用者將此視為系統檔案。 下一實施步驟為驗證檔案含有至少128個連續區段。In the intermediate agreement used (for example, the SD Agreement). When the command arrives at the FE layer 1021, the 'check command passes the signature: if the signature is not found, the instruction is treated as a standard instruction from the intermediate agreement and the instruction can access the memory or execute the instruction in a standard manner; if the signature is found , extracts the embedded specific application command and passes it to the appropriate device application 1〇23 for execution. When implemented at the device driver level (host side) (as in the second example embodiment below), the command is addressed to a specific logical address while being implemented at the file level (as in this example and below) In the third instance, the command can be addressed to any logical address; as understood from the device side, the two implementations are largely the same. Once the signature is found and the inline command is extracted, the hidden partition (in this example) is made available to the host application 1053 via the corresponding device application 1〇23 located on the card 101. The host and device application will communicate using a protocol that will override the read and write between the host side and the card side and report the split status. In this illustrative embodiment, the device controls permissions to the application. The device grants such access (read, write) when the device confirms the credentials of the host application (read, write), and upon approval, the device application grants read and write access to the partition via the host/device agreement. Once the host application has been confirmed, it is then assumed that the device is operating in a trusted environment. As mentioned, the first exemplary embodiment will be implemented at the slot level, and the command will be placed in the first data section of the write file. Implementing and; relying on references to any particular logical address, but relying on checking the specific pattern or signature of the first segment. The file in the split is managed by the host, which means that in the hidden split instance, the host application is the owner of the file (distribution). Once the host application obtains the corresponding private type, Permissions, which fully control the content. ~: The problem of the access rights of the nozzle in the operating system (os) is usually not able to capture the FAT of the partition, so the host application 1 〇 5 3 will implement the file system as any access to the hidden partition - only FAT is available after the official line to the application is opened. (The command transmission by the host application/type will be defined and explained below.) The main mechanism program will be located on the non-hidden or public segmentation of the card, as understood by the mass storage device or the removable I-level Qs. . A number of such host applications can be located in this area and the user will know which host application to execute and which host application will be executed on the host side. The host side software layer is described in more detail with reference to FIG. The device driver 1055 has two tasks which act as a bus driver and perform the (1) operation of the standard client application supported by the (intermediate) protocol and the standard system 1〇57. In addition, it also implements applications and devices or specific application agreements. Standard I〇 APIs and implementations are common to all card families (eg, standard SD card operations). An application or a specific device is essentially a specific agreement. Figure 7 shows an example of a hierarchical structure that enables common sharing of code and common portability between different application-specific protocols. In addition to the host application layer i 053 and the file system layer 1〇57, the host structure is now also dedicated to the layer of device applications! kiss. For "standard" device operations (not specifically for specific application operations), layer 1059 is not used and layers 1053, 1057, and 1〇55 will be used to be substantially the same as in the prior art. And the operation. When a specific private quotation is to be used, the device application layer 1〇59 116844.doc -27- 200809593 will be inserted between the file system 1〇57 and the host layer 1053 to Format and embed specific application commands. Device driver 1055 can include interface and pipeline sublayers to provide common functionality and can be used with minimal changes to all specific application protocols. The host application should match the protocol layer for a specific application. The interface sublayer will present a set of standard device functions. For example, these features will include: hardware initialization and configuration; driver startup and shutdown routines; read and write operations; and erase. It will also include functionality for performing the appropriate method and thus initializing the pipeline. When an instruction such as 5 10 of Fig. 5 is transmitted, in some cases, the operating system (OS) may divide it into slices, possibly even inserting slices of other instructions. In such a situation, file system 1057 and device driver 1055 can decompose instruction 510' such that command portion 511 is in any of the cases that are not attached to data portion 513 until attached to all data portions 5 13 with the remaining data portion continuing Transmitted in one or more subsequent transfers. Under these conditions, the subsequent transmission of the remaining data portion will have no signature portion of the segment 5 13& and will appear as a standard command. This segmentation can also occur for data that is transferred from the card to the host during a read operation. The procedure can be simplified in situations where it is known that the 〇8 will not split the instruction or 〇s can be sufficiently controlled so that it can be instructed not to do so. This is first discussed with reference to the flow of Figure 10A and the corresponding state diagram of Figure 12. A more general situation will be discussed later with reference to Figures 1 and B. Moreover, for the sake of simplicity of discussion, the discussion of Figures 1A will generally be based on the situation of only a single application, although there will typically be several different such applications in effect. A more general situation of Figure 10B will make this clearer. 116844.doc -28- 200809593 For the first exemplary embodiment, a simple hidden partitioning agreement is used for illustration. The memory 1〇11 is divided into two segments. The first division is the product standard division. The standard host only knows about this split. The second split is a hidden split that can only be accessed via a specific application command. The standard host does not understand this split and there is no way to access the split. The hidden partitioning protocol of this example defines five functions used by the device to communicate with the application: 1. Open hidden segmentation: used to authenticate the user and enable read and write operations. ', 2· Close hidden segmentation: to read and write operations. 3. Obtain the hidden segmentation state: return the data shown in Figure 8. 4. Hidden split read: If the split is on, the self-hidden split is read. If the split is off, an error is returned. 5. Hidden split write: If split is on, write to hidden split. If the split is off, an error is returned. The agreement layer provides the additional ApI needed to implement a security agreement. In the specific instance of hidden partitioning, in addition to reading and writing, the agreement requires three services. · Turn on splitting, turn off splitting, and get split state. These prints are shown below in Tables, which are further discussed in conjunction with Figure 8. The pipeline sublayer is responsible for communication with the card based on the media command delivery principle. As previously described, the primary idea in media command delivery protocols is to embed feature commands (commands that are not part of the standard product specification) into standard entry and write operations. Embedding these commands in standard read and write operations allows them to work with standard hosts and drivers. In the exemplary embodiment, all commands will be initiated by sending a write command 116844.doc -29-200809593 to a certain LB A of the media card. The specific application write command will include multiple section transfers, where the first section holds the arguments of the command and the remaining extents hold the associated material, if any. The read command will be executed in two parts: 1. Initialize the read command by first sending a write command to a selected LBA having the appropriate material describing the nature of the read command. 2. After the write command sets the card application to the correct transfer state, the self-write command sends a read command to the selected LBA to perform the actual data transfer from the card to the host. All commands first send a write command with the extent format shown in Figure 9. When the host application decides to send a write command, the first segment transmitted will have the above format. A data block sent from the host will have the actual data of the card. If the host application decides to initialize the read command, it first sends a write command to the selected LB A (LB A = LB A - XYZ) having the single segment format described above and then sends a read to the same LB A . This is illustrated in the flow charts of Figures 10A and 10B, discussed further below. Several possible implementations are available for media command delivery agreements. An example of this paragraph uses a file system, such as a Windows standard system operation. An example of the next segment communicates directly with the device at the device driver level and does not have additional overhead for the file system. Another implementation can be used for a pocket PC (PPC). In this last condition, the read and write operations can directly access the PPC storage driver. Since there is no standard storage device driver for a pocket PC device, there is no guarantee that this method will be applicable to all PPC devices. Client Application Factory 116844.doc -30- 200809593 The vendor should test this method using the PPC device group that it intends to work with. Returning to the file system implementation of this example, the pipeline sublayer reads and writes from the same file location (as indicated by LBA_XYZ in Figure 10A) for the condition in which the OS will transmit the complete instruction in a single transfer. The reading and writing operations of the command LB A are initialized to the same file location. This does not require a predetermined address in the example of the following paragraph, but can be any logical block address. For this example, the standard file systems API-CreateFile, ReadFile, WriteFile, and SetFilePointer using Windows are implemented. The implementation set can be divided into four or five parts: pre-requirements; communication pipeline establishment; file length verification; application write command; and read if data is read or sent back to the host Take the command. In file level implementations, the file system is used to unknowingly transfer embedded application-specific commands. Since the actual embedded command can be different from the nature of the command in the intermediate agreement that the file system believes it is being sent, a conflict can occur if no appropriate steps are taken. For example, if an error occurs, the file system will treat this as an error in the carriage command (write command) in the intermediate agreement when the actual error can be with the embedded command (for example, a read command). Therefore, error recovery can be complicated. Similarly, if the file system uses a cache, it can lead to inconsistencies. Another problem can arise from file segmentation: since the exemplary implementation relies on reading and writing to the same file location from the same file location (LBA_XYZ of Figure 10A), the entire file should be stored in memory. 116844.doc -31- 200809593 Section of the renewed group. If the data to be stored at the LBA χ ζ is larger than the available segment, the file system will separate it. Therefore, the maximum data length for a particular application command should be no larger than the minimum 档案8 file configuration 丛 (cluster) so that the logical address used (LBA_χγζ) is associated with a logical block address with sufficient space. In the Windows instance, the pre-required implementation of the file system requires a standard file containing at least 128 consecutive segments. To ensure the existence of this file, create it on a formatted drive. Therefore, if the host application vendor chooses this method, it should deploy the communication file with the application. In this example, the design assumes that the file named "FilePipe" (with some of the genities specified below) exists in the device user area. If the file does not exist, the driver will attempt to create the file. If it fails, the application can ask the user to format the drive and reinstall the application on the format drive. To build the communication pipeline, the device driver 1055 preferably opens the communication file with the following attributes: The shared unbuffered, hidden, unshared state ensures that only the host application can access the file to prevent other applications from accessing the command to pass LB A. The unbuffered status indicates that the system has no intermediate buffer or cached file. / Any write or read from this file results in a read/write command to/from the card that is different from the cached version. (In some cases, to ensure that the file will be flushed to the card, it may be 116844. Doc -32- 200809593 procedure βΓ "flag and "write delivery"flag.) Because the actual application = or a specific media command is lost in another agreement, So when there is a write error, for example, the host interprets this as an error with the write::! in the middle, not the error associated with the embedded command. Unbuffered state...Beibu delivery and expected inline Command related. The hidden state implies that the end user views this as a system file. The next implementation step is to verify that the file contains at least 128 consecutive segments.

對於應用程式之寫入命令(隱藏分割實例中之安全寫入) =言,沿上文所描述之線預備寫入緩衝器。接著對檔案指 私重叹以確保讀取及寫入操作係對於相同 而言。接著藉由調用具,,FilePipe"名稱之” WriteFUe,,命令而 將緩衝器發送至裝置。 對於應用程式之讀取命令(隱藏分割實例中之安全讀取) 而έ,首先重設檔案指標,接著執行"WriteFile"命令以發 送命令緩衝器。接著再次重設檔案指標以確保對相同Lb a 執行寫入及讀取操作。接著執行”ReadFile,,以自裝置獲得安 全資料。 返回至卡側,裝置應用程式1023將管理隱藏分割(在此實 例中),從而允許擱置於主機應用程式確認時的讀取及寫 入。對於隱藏分割階段,資源及記憶體存取係經由媒體層 1025而進行。媒體層1〇25將所有裝置應用程式資料傳送導 引至記憶體1011上之隱藏分割。 如上所述,裝置應用程式1023經由規則卡協定讀取命令/ 寫入命令而自主機應用程式1053接收其特定命令。舉例而 116844.doc -33- 200809593 言,在將SD卡協定視為例示性實施例的情況下,經由SD寫 入命令而在命令區段中傳遞每一命令索引及自變數。當期 待來自裝置應用程式之讀取命令時,接著主機應用程式首 先將發送寫入命令(經由SD寫入命令),接著發送實際讀取 命令(SD讀取命令)。在傳遞命令區段之寫入命令期間,將 讀取命令内容儲存於(例如)專用於裝置應用程式之RAM空 間中。當接著為讀取命令時,裝置應用程式將接著載入所 儲存之讀取内容並傳送所請求之資料。所儲存之讀取内容 將繼續保持原狀直至其被另一讀取内容替代為止。此將使 得主機能夠執行讀取重試而不發送另一寫入命令+命令區 段。 因為多數協定命令充當讀取命令/寫入命令,所以可藉由 讀取及寫入至某些LB A而傳送作為特定應用程式命令之新 命令。在例示性實施例中,所有命令係藉由將一寫入命令 發送至媒體卡之某一 LBA而初始化。特定應用程式寫入命 令將包括多個區段傳送,其中第一區段保持命令之自變數 且剩餘資料塊保持相關資料(若存在)。 如上所提及的,在兩個部分中執行讀取命令: 1 ·藉由首先將寫入命令發送至選定LB A而起始讀取命 令,其中以適當資料描述讀取命令之性質。 2·在寫入命令將卡應用程式設定於正確傳送狀態之後,將 發送自寫入命令至選定LB A的讀取命令以執行自卡至 主機的實際資料傳送。 返回至圖9,所有命令必須首先發送一寫入命令,其中圖 116844.doc -34- 200809593 9展示此處自變數資料區段之例示性格式。如圖9中所示, 位元組0至31保持應用程式傳遞簽名(例如,"pass Through Mode Supported"),位元組32保存應用程式之山,位元組33 保存内喪命令之應用程式命令操作碼索引且以應用程式命 令自變數資料來填充剩餘區段。 當在此實施例中主機應用程式1053決定發送寫入命令 時,所傳送之第一區段將具有圖9之格式。自主機1〇51發送 之下一資料境將具有用於卡的内嵌命令實際資料。若主機 應用程式決定初始化讀取命令,則其首先將寫入命令發送 至具有上述單一區段袼式之選定LB A且接著將讀取命令發 送至相同LBA以實現讀取。 主機應用程式1053負責根據自裝置所見之通信流程(如 圖10A中所示)而初始化所述命令。為進行此操作,主機應 用程式控制卡協定之讀取及寫入操作的目標LBa,其將載 運如上所述之内嵌命令。儘管僅描述單一 LBA處之單一命 令’但對於多個LBA而言,可發生圖i〇A(及圖ha至η。、 圖12等)中所展示之過程,因為該等lb a可皆依賴於傳遞模 式簽名。(下文參看圖10B更詳細地描述此狀況,其中不同 LBA係以一下標加以指示,LBAJ。因為裝置能夠連續處理 夕個檔案’所以特定LB A僅取決於裝置之狀態機(如下文參 看圖12所論述的)。 當接收到至選定LBA之寫入時,該過程開始於步驟 1101,此處認為LBA=LBA—XYZ。接著檢查⑴〇3)簽名以察 看其疋否為應用程式傳遞簽名:若並非應用程式傳遞簽 116844.doc -35- 200809593 名、’則卡進行標準IG操作⑽5);若為制程式傳遞簽名, 則進入CMD傳遞模式。步驟11〇9判定命令方向(如自裝置所 見)疋否為出(OUT)。若方向為出(例如,至裝置之記憶體的 寫入),則執行(11 11)該命令。 右^方向不為出’則在1113處,記憶體裝置等待讀取 對之第一命令(應用程式讀取請求)。若替代地,寫入到達 ’ ()則在返回等待狀態(1113)之前轉至標準1〇操作 φ (1123) ☆接收到項取命令,則檢查(1117)LBA且若其係至 選疋LBA’則其$讀取狀帛二命令且執行(⑴力讀取;若 LBA不匹配,則替代地,轉至1123。 存在一個以上可能之實施方式且實施細節根據目標平臺 而改變。一普通方式(其應用程式於基於WindowsNT之桌上 型電腦及上文關於主機側所描述的)為使用虛擬槽案及標 準Windows樯案系統API。另一方式為使用賈比如…%幻 傳遞API而直接初始化卡協定之(例如,sd)讀取及寫入操 • 作,如下一實例中所描述的。此方式亦應用程式於基於For application write commands (hidden writes in hidden split instances) = say, write write buffers along the lines described above. The file is then privately sighed to ensure that the read and write operations are the same. The buffer is then sent to the device by calling the FilePipe"name's "WriteFUe," command. For the application's read command (hidden read in the split instance), the file metric is reset first. Then execute the "WriteFile" command to send the command buffer. Then reset the file metrics again to ensure that the same Lb a is written and read. Then execute "ReadFile" to get the security data from the device. Returning to the card side, the device application 1023 will manage the hidden partitioning (in this example), allowing for reading and writing to be placed upon confirmation by the host application. For the hidden segmentation phase, resource and memory accesses are made via media layer 1025. Media layer 1 〇 25 directs all device application data transfers to the hidden partition on memory 1011. As described above, the device application 1023 receives its specific command from the host application 1053 via the rules card agreement read command/write command. For example, in the case where the SD card protocol is regarded as an exemplary embodiment, each command index and arguments are passed in the command section via the SD write command. When a read command from the device application is pending, the host application will first send a write command (via the SD write command) followed by the actual read command (SD read command). During the write command to pass the command segment, the contents of the read command are stored, for example, in the RAM space dedicated to the device application. When the command is subsequently read, the device application will then load the stored read content and transfer the requested data. The stored read content will remain as it is until it is replaced by another read. This will enable the host to perform a read retry without sending another write command + command block. Because most protocol commands act as read commands/write commands, new commands can be transmitted as specific application commands by reading and writing to certain LB As. In the exemplary embodiment, all commands are initiated by sending a write command to an LBA of the media card. A particular application write command will include multiple section transfers, where the first section holds the argument's argument and the remaining chunks hold the associated material, if any. As mentioned above, the read command is executed in two parts: 1 - The read command is initiated by first sending a write command to the selected LB A, where the nature of the read command is described in the appropriate data. 2. After the write command sets the card application to the correct transfer state, the read command from the write command to the selected LB A is sent to perform the actual data transfer from the card to the host. Returning to Figure 9, all commands must first send a write command, where Figure 116844.doc -34 - 200809593 9 shows an exemplary format of the argument data section herein. As shown in FIG. 9, bytes 0 through 31 hold the application pass signature (eg, "pass Through Mode Supported"), byte 32 holds the application hill, and byte 33 holds the application of the dead command The program commands the opcode index and the application commands the self-variable data to fill the remaining segments. When the host application 1053 decides to send a write command in this embodiment, the transmitted first segment will have the format of Figure 9. The next data sent from the host 1 〇 51 will have the embedded command actual data for the card. If the host application decides to initialize the read command, it first sends the write command to the selected LB A with the single segment style described above and then sends the read command to the same LBA for reading. The host application 1053 is responsible for initializing the command based on the communication flow seen by the device (as shown in Figure 10A). To do this, the host application controls the target LBa of the card protocol read and write operations, which will carry the embedded commands as described above. Although only a single command at a single LBA is described 'but for multiple LBAs, the process shown in Figure iA (and Figures ha to η., Figure 12, etc.) can occur because these lb a can be relied upon Pass the pattern signature. (This situation is described in more detail below with reference to Figure 10B, where different LBAs are indicated by subscripts, LBAJ. Because the device is capable of continuously processing the evening files', the particular LB A depends only on the state machine of the device (see Figure 12 below) When the write to the selected LBA is received, the process begins at step 1101, where LBA = LBA - XYZ is considered. Then check (1) 〇 3) the signature to see if it passes the signature for the application: If the application does not pass the signature 116844.doc -35- 200809593, then the card performs the standard IG operation (10) 5); if the signature is passed for the program, the CMD delivery mode is entered. Step 11〇9 determines whether the command direction (as seen by the device) is OUT (OUT). If the direction is out (for example, writing to the memory of the device), then the command is executed (11 11). If the right ^ direction is not ', then at 1113, the memory device waits to read the first command (application read request). If the write arrives at '(), it goes to the standard 1〇 operation φ (1123) before returning to the wait state (1113). ☆ If the item fetch command is received, check (1117) the LBA and if it is connected to the LBA 'There is its $Read command and execute ((1) force read; if the LBA does not match, then instead, go to 1123. There is more than one possible implementation and the implementation details change according to the target platform. A common way (The application is based on the Windows NT-based desktop computer and described above on the host side) to use the virtual slot and the standard Windows file system API. Another way is to initialize directly using the Jia...% magic transfer API. Card protocol (eg, sd) read and write operations, as described in the following example. This method is also based on the application

Windows NT之桌上型電腦,但其需要如上文關於卡驅動程 式層級之實施而論述的管理權限。 關於卡韌體與應用程式韌體之間的命令介面,在第一步 驟中,卡FW接收一特定應用程式命令。在驗證卡傳遞模式 支援簽名之後,卡之FE層1021將剖析與至應用程式1〇及命 令OP-Code之選定LBA的寫入命令一起的自變數資料區 段。特定應用程式命令解譯器將調用具有指向主機資料緩 衝器之指標的應用程式介面例行程序。在第二步合 I16844.doc -36 - 200809593 開始特定洲程式命令相時,應用程式:FW必須設定其自 身狀怨機以處理應用程式命令序列且亦設定一旗標以指示 至選定LBA之下一讀取命令/寫入命令係用於應用程式 FW。每當將讀取命令發送至卡(至選定lba)時卡之^將 首先檢查此旗標以區分此特定應用程式讀取命令與至此 LB A的規則讀取命令。A Windows NT desktop computer, but it requires administrative rights as discussed above with respect to the implementation of the card driver hierarchy. Regarding the command interface between the card firmware and the application firmware, in the first step, the card FW receives a specific application command. After the verification card transfer mode supports the signature, the FE layer 1021 of the card will parse the argument data section along with the write command to the selected LBA of the application 1 and the command OP-Code. The application-specific command interpreter will invoke an application interface routine with metrics pointing to the host data buffer. In the second step I16844.doc -36 - 200809593 when starting a specific continent command phase, the application: FW must set its own complaint machine to process the application command sequence and also set a flag to indicate to the selected LBA. A read command/write command is used for the application FW. Whenever a read command is sent to the card (to the selected lba), the card will first check this flag to distinguish this particular application read command from the rule read command up to this LB A.

' 現將描述隱藏分割應用程式之協定的實例。圖11A至11C φ 說明與圖1〇A相同之某些過程,但根據主機與裝Ϊ之間的系 統匯流排上之活動進行說明。圖UA中展示鑑認及安全分割 FAT讀取之過程。首先,主機將使用者名稱+密碼發送至卡 以供鑑認。一經鑑認,卡便使得應用程式能夠自安全及隱 藏分割讀取FAT。分割持續開啟直至主機終止會話或裝置經 歷功率循環為止。只要分割開啟,便允許由主機應用程式 讀取及寫入至隱藏分割。 圖11B說明安全分割中之檔案之主機讀取。如上文所描 _ 述’特定應用程式讀取命令出現於兩個卡協定命令内··指 定讀取命令之性質及自變數的寫入命令;及接著的實際讀 取命令。 、 圖11 c說明至隱藏分割之主機寫入。在通過鑑認的情況 ' 下,主機可存取分割之FAT且現具有將新檔案傳送至主機之 權限。主機將寫入命令發送至具有一寫入開始位址及區段 計數的安全分割。 圖8展示上文提及之裝置應用程式狀態以及隱藏分割實 例之例示性值的實施例。因為可允許若干不同分割,所以 116844.doc -37- 200809593 在實例中裝置應用程式分割ID中之位元組1係給定為”1’。 接著四個位元組給出分割大小,此處展示為區段之十兆位 元組值。位元組5指示分割當前是否為開啟的且給定接著的 四個位元組以指示裝置應用程式之版本。位元組10提供操 作狀態。位元組10至5Π係以零進行填充從而形成一區段。 在變化中,位元組11可用於記錄在最末異動中所寫入的區 段之數目。 表1描述發送至隱藏分割實例之裝置應用程式的應用私 式協定命令之一實例。CMD索引置放於命令區段之位元組 33中,且命令自變數係自位元組34開始置放並以表中所寫 入之指定次序而置放。 CMD 主引 CMD名稱 CMD自變數 位元組之數目 1. OPEN一PARTITION 以位元組之使用者名稱長度 1 使用者名稱 指定於第一自變數中 以位元組之使用者密碼長度 1 — 使用者密碼 描定於第三自變數中 2. CLOSE PARTITION 以位元組之使用者名稱長度 1 ____ 使用者名稱 第一自變數中指定_ 以位元組之使用者密碼長度 1 ___ 使用者密碼 指定於第三自變數中_ 3. READ一 PARTITION LBA數目 4 讀取之區段計數 4 4. WRITE—PARTITION LBA數目 4 寫入之區段計數 4 5. READ一 PARTITION —STATUS 分割ID 1 一 表1 當藉由裝置之寫入協定(諸如SD協定)而傳送内嵌隱藏分 割命令時,在建置實際係用於分割之裝置應用程式且並非 116844.doc -38 - 200809593 用於SD規則操作《寫入或讀取命令之後將藉由(例如)sd命 令解譯器來調用分割的命令解譯器。在剖析命令區段之 後,命令解譯器將調用適當例行程序。在一特定實施例中, 應用程式之命令可具有作為第一自變數之參數,其指示MD 命令是讀取命令還是寫入命令。第二參數可將指標傳遞至 經配置之RAM中置放命令區段的位置。由於分割之裝置應 用程式的相關資訊開始於區段之該點處,所以該指標將指 向位元組33(命令操作碼索引)。可在第三參數中指定由此第 二參數指向的緩衝器大小。 如已提及的,因為在剖析命令區段之後立即以與卡協定 之彼等序列相同的序列來執行裝置應用程式之寫入命令, 所以該等寫入命令為簡單的。舉例而言,在SD狀況下: 1·接收SD寫入命令(1或多個區段):在例示性實施例中第 一區段總為命令區段。 2.卡層剖析第一區段之第一 32個位元組並識別命令區段 之簽名。以指向命令區段之指標而調用裝置應用程式命 令剖析器(解譯器)。 3·在執行命令解譯器以識別内嵌應用程式命令之後,命令 解譯器調用將執行内嵌命令並開始應用程式之命令過 程的相應例行程序。 4·執行隱藏分割之應用程式的命令過程且將狀態傳回卡 層,其中序列將轉至如SD寫入命令過程將終止的結束 處。SD卡轉至閒置(IDLE)狀態。 亦如已提及的,隱藏分割之應用程式協定中的讀取命令 116844.doc -39- 200809593 為兩步驟過程,其包含(再次在SD實施例中)SD寫入命令, 隨後為SD讀取命令。第一步驟為SD寫入命令·· 1·由主機發送的具有一資料塊(512個位元組)之§〇寫入命 令··在例示性實施例中第一區段總為命令區段。 2·卡層剖析第一區段之第一 32個位元組並識別命令區段 之簽名。以一指向命令區段之指標調用裝置應用程式之 命令剖析器(解譯器)。 3·在執行命令解譯器以識別内嵌應用程式命令之後,命令 解# 識別將(在接著的SD讀取命令中)被執行的内喪 讀取命令,儲存此命令識別符。接著命令解譯器設定卡 層讀取命令旗標。 4·執打應用程式之命令過程且將狀態傳回卡層,其中序列 將轉至如SD寫入命令過程將終止的結束處。sd卡可轉 至閒置狀態。 苐一步驟為S D讀取命令: 1 · S D讀取命令。 2· SD卡層松查應用程式卡層讀取命令旗標並發現其被設 定:其調用具有讀取命令指示的裝置應用程式命令解譯 态而非調用規則SD讀取命令。 3.裝置應用程式命令解譯器識別分割讀取命令旗標並重 新調用f諸存於先前寫入命令中的分割讀取命令識別 符。該識別符指向相應分割讀取例行程序並初始化分割 讀取序列。 4·執行分割讀取序列並將傳回狀態傳遞至卡層。 116844.doc 200809593 5·卡層終止SD讀取過程且卡進入間置狀態。 藉由基於SD之實施例之圖12中所示的卡侧應用程式之命 令狀態機而說明讀取及寫入過程。由於此等内嵌命令係藉 由SD寫入命令而傳遞,且當需要執行隱藏分割讀取命令時 主機不能夠傳遞SD讀取命令上的命令區段,所以裝置應用 程式(1023)之命令解譯器需要保持一將管理及瞭解哪一讀 取命令正由主機應用程式1〇53執行的狀態機。在此圖中, 圓圈係指執行於裝置應用程式層(圖6,1〇23)處的裝置特定 應用程式命令,同時附加註釋係指如在?£層(圖6, ι〇2ι)處 所見的在中間(此處,SD)協定中之命令。圖12之右侧 徑)為寫入處理之過程,其中將資料傳送至裝置或無資料被 傳送的任何過程將遵循類似之流程。圖12之左側對声於宜 中將資料自裝置傳送至主機的讀取或其他過程。讀取流程 由讀取所需之該對之第一命令的B路徑及該對之第二命令 的c路徑組成。 寫入流程與讀取流程以相同之方式開始,接收一犯寫入 命令’在偵測到簽名之後自該犯寫入命令而剖析内嵌命 令。對於寫人流程而言’寫人旗標保持為開(。啦執行寫入 過程。然而,對於讀取流程之第—階段而言,將設定讀取 旗標。幻貞制來自主機之讀取過料 式⑽3)㈣定此切(SD)讀取過料標。料標向 :來自主機(在SD匯流排上)之下一讀取命令並非規則卡讀 =且應將其導引至裝置應用程式⑽3)以供處I此發 項取流程之第2階段’其中回應於該對之第二命令而自裝置 116844.doc -41 - 200809593 傳送資料。當卡層初始化時旗標獲得重設。 參看表1中所列之命令,〇PEN_PARTm〇N命令(OP-Code 0x01)接收使用者名稱及密碼並對其進行驗證。若其與裝置 應用程式之所儲存名稱及密碼相匹配,則開啟分割以用於 主機存取(讀取、寫入)。此時’存在著將被發送及相對於裝 置應用程式之碼中的片語而被驗證的鑑認片語。圖13A中展 示此過程。分割將保持開啟直至CLOSE ^PARTITION將其關 閉為止或直至下一功率循環為止。 CLOSE—PARTITION命令(OP-Code 0x02)之使用係用以關 閉應用程式工作會話且不讓分割開啟。圖13B中展示一實施 例。 圖 13C 中展示 READ—PARTITION命令(OP-Code 〇χ〇3)之 使用。若分割開啟(自1633至1635為是(yes)路徑),則此命 令將使得主機應用程式能夠讀取儲存於分割中之資料 (1639、1641)。在例示性實施例中,此例行程序將調用 "FlashRead” API例行程序,其將資料傳送導引至隱藏分割空 間。 WRITE—PARTITION命令(OP-Code 0x04)將資料自主機導 引至卡上之隱藏分割。如圖13D中所示,僅當設定(SET)分 割旗標(1653)時,此命令才由裝置應用程式加以執行。此例 行程序將調用”FlashWrite’’(1659、1661)API例行程序,其將 資料傳送導引至隱藏分割空間。 READ—PARTITION—STATUS 命令(OP-Code 0x05)供應圖 8 中所示之資訊。此為具有上文參看圖8所述之結構的應用程 116844.doc -42- 200809593 式讀取命令。當命令進入時’例行程序將聚集所有資訊且 將其置放於上述結構中並將其發送至主機。 如上文所提及的,某些作業系統將不時地將—指令分 開’使得並非所有資料部分將附著至其相應命令部分。在 此狀況下,寫入指令之資斜邱八脸—p l^ 貝抖口P刀將在無卡傳遞簽名的情況 下顯露於卡處,因此,表規或尤目士# 录現為不具有附著簽名之傳輸協定 中之標準命令的命令可實際上為剩餘特定應用程式命令。 作為具體實例’考慮圖5之指令51〇的狀況,指令51〇且有⑽ 如)十個區塊之資料部分513。在將此指令傳輸至卡時,主 機之作業系統可僅發送附著至該指令之㈣部分的首選五 個區塊中稍後傳輸剩餘五個區塊。當發送此最末組之 資料塊時’其將缺乏含有應用程式協定之簽名及實際命令 的初始資料塊5Ua,且將表現為來自傳輸協定之標準命令 的部分。當内喪敎應用程式命令為讀取型命令時,此分 段亦可發生,使得以部分的方式將資料自卡發送至主機。 圖10B藉由以用於讀取及寫入過程之邏輯位址lbAr〗及 LBAWi替代單-邏輯塊位址lba=lba_xyz來擴展圖i〇a之 流程從而說明在特定應用程式讀取與寫入命令中的此分 段。藉由界定LBA—取以及寫入之LBAwi,裝置可處理在 任一方向之應用程式資料傳送的中斷。下標丨係用以慮及來 自多個應用程式及多使用者主機裝置之多個特定應用程式 命令之同時發生的實施。 圖10B之過程再次基於將SD協定用作傳輸協定的sd卡之 實例並以處於SD閒置狀態及在12〇1處接收命令的裝置而開 116844.doc -43 - 200809593 始。其接著判定所接收之指令是否為SD寫入(1203),且若 並非SD寫入,則判定其是否為SD讀取(1205)。若其既非SD 寫入亦非SD讀取,則執行SD命令(1207)且裝置返回至閒置 狀態(1209)。 若在步驟1203處所接收之指令為SD寫入,則接著檢查傳 遞簽名(1214)。若在1214處發現簽名,則此指示新内嵌命令 之開始,該新内嵌命令可接著被提取。在1231處,對於所 有讀取及寫入邏輯塊位址LB ARi;wi-而言,若傳入命令之邏 輯塊位址LBACMD與指派給當前寫入過程的邏輯塊位址相 同(LBAcmd=LBAwi) ’則清除相應LBA^j;wi。通常,所指派 之LBACMD應未被使用,但在其已被指派給另一過程的狀況 下,此會將其異常中止且清除位址。 接著判定特定應用程式命令之資料方向(1233)。若不涉及 資料傳送,則接著執行特定應用程式命令(1245)且裝置返回 至閒置狀態(1249)。 若應用程式之命令為寫入,則將相應邏輯位址設定為 LBAWi=LBACMD + data blockeoimt( 1251)且寫入應用程式資 料(1253)。如上文所論述的,主機之OS可將指令分開,使 得命令不隨附有所有相應資料。當提取及剖析内嵌命令 時,卡將瞭解,應包括多少資料塊。在1255處,進行檢查 以察看是否包括並寫入所有資料。若如此,則可清除 LBAWi(1257);否貝U ,其不被清除,因為剩餘資料將(除非 由錯誤或停機而中斷)最終跟隨且將看似為至一作為上文 所計算之位址的連續(相對於此命令)卡位址之標準SD寫入 116844.doc -44- 200809593 命令。裝置接著將返回至閒置狀態(1259)以等待另外的命 0 返回1231,若應用程式命令為讀取,則裝置設定 LBARi=LBACMD並設定 datatypeRi=datatypeCMD(1235)從而為 在1263處於第二讀取階段中的隨後資料傳送作準備。裝置 接著轉至SD閒置模式以等待讀取過程之第二階段。對此解 決方案之不同的變化將不使用LBACMD而是使用在寫入命 令之參數中明確界定的不同位址LB Aread。此方法將圍繞 OS之快取機制(caching mechanism)而工作。在若干系統 中,主機OS將不會試圖往回讀取剛剛被寫入之卡位址。實 情為,其將會將資料緩衝器返回至主機應用程式之主機快 取缓衝器(cache buffer),假定此資料為卡所具有之資料, 由於其剛剛被寫入至其。在此狀況下,資料缓衝器將包括 特定應用程式命令而非卡回應。 返回至1214,若命令(在傳輸協定中)為寫入(自1203為是 (yes)路徑),但缺乏簽名(自1214為否(no)路徑),則該命令 實際上可為傳輸(此處為SD)協定中之寫入命令,或可為用 於應用程式協定中之寫入的額外資料。在1215處對此進行 判定:若對於LBAwi中任一者而言,LBACMD#LBAwi,則其 為接著被執行於1217處的標準SD寫入,其後卡轉至SD閒置 狀態(1219)。若LBACMD匹配LBAwi中之一者,則命令實際 上為相應應用程式命令之更多資料部分且流程轉至125 1以 寫入此額外應用程式資料。 返回至步驟1205,若命令為SD讀取,則判定其實際上為 I16844.doc -45- 200809593 SD讀取或為應用程式讀取之第二階段。在1226處藉由比較 LB ACMd與LB ARi而對此進行判定:若對於LB ARi中任一者而 言,LBACMD#LBARi,則其為接著被執行於1227處的標準80 讀取,其後卡轉至SD閒置狀態(1229)。若替代地,對於LBARi 中任一者而言,LBACMD匹配LBARi中的一者,則其為應用 程式讀取之第二階段。 當LBAcMD=LBARi時’將相應邏輯位址設定為 LBARi=LBACMD + data blockcoimt( 1261)且讀出應用程式資 料(1263)。裝置接著轉入SD閒置狀態(1269)。對於應用程式 讀取過程,例示性流程缺乏應用程式寫入側之步驟1255及 1257的均等步驟。即使已存取所有相應資料,亦繼續設定 相應讀取旗標。藉由保持LB ARi開啟,可在錯誤狀況下重新 讀取資料。在此配置下,對於一實例,諸如在步驟123 1中, 若為另一目的而重新指派位址,則僅清除LB ARi。 相對於圖10B之圖10A的此等添加允許在應用程式資料 之傳送中存在中斷。其亦消除了對讀取及寫入至相同邏輯 位址之需要。此等允許技術用於其中可能不存在對作業系 統具有足夠控制的狀況下,因為圖10A之實施例所需的控制 之種類可能需要已知可控平臺。同樣,應再次注意:圖10B 更明確地合併可存在多個主機應用程式,其各自與卡進行 獨立通信,且資料傳送之中斷可在來自一協定之指令的部 分之間插入來自另一協定之指令的部分。另外,讀取過程 與寫入過程之獨立LB A允許繞過裝置驅動程式層中之任何 讀取或寫入快取。 I16844.doc -46- 200809593 第二例示性實施例 弟-實例實施於檔案層級。本發明之各種態樣亦可實施 於裝置驅動程式層級,從而藉由將請求發送至裝置驅動程 式而初始化讀取及寫入操作,例如在主機使用wind〇哺業 系、、先時該裝置驅動程式可為WindGws標準儲存驅動程式。命 ^遞方法之此實施直接與裝置通信且不具有播案系統額 卜耗用。然而,此方法可需要管理權限。主機之應用程式 可嘗試此方法並將此方法用作第一選擇且若其失敗則轉移 至檔案糸統操作。介面功能可用於在該等方法之間進行選 擇並相應地初始化通信管線。在任何其他操作之前,用戶 以應用程式將則此命令。若應用程式缺乏適當管理員權 限,則以此方法工作將導致異常,其可根據異常處理碼而 被處理。 ^貝例係基於對上文[先前技術]段中問題之論述。儘管 [先則技則之論述提出在記憶卡經由硬體卡讀取器而連接 至pc之情形中的問題,但將在下文中看到(如同此處給出之 其他實例-般)’情況更為一般。記憶體裝置可具有此協定 轉譯’或更精確言之’即使當其直接連接至第二主機時亦 無轉譯問題。當記憶體裝置連接至具有(如自記憶體裝置所 看到的)不完整協定之主機時,可導致此情況。—其中可出 現此的狀況為其中卡具有兩組接點’-組供USB埠使用且 另、且供"^準組之卡接點使用。(在皆於2004年4月16日 申請之美國專利申請案第29/2〇3,693 ' US謂26,8〇1及仍 0/826,796號中士田述此等雙接點卡之實例。)如關於第三組 116844.doc -47- 200809593 實施例所論述的,協定轉譯可完全地包含於記憶體裝置自 身内,不為主機所知。此外,在下文中,儘管關於可拆卸 記憶卡而描述實施例,但該論述亦適用於内嵌記憶體裝置。 在第二例示性實施例之第一組實施例中,為允許媒體卡 特定命令自主機傳遞至卡而不改變控制媒體卡之配接器或 讀取器的韌體,本發明使用特定邏輯塊位址(LBA)(卡傳遞 模式LBA),其具有在資料區段中之特定簽名以通知卡特定 命令内嵌於區段中。此可藉由韌體變化來實施以支援命令 傳遞(CPT)模式。因為此不需要配接器之韌體變化,所以可 在任何USB讀取器或配接器處執行該卡。 如在[先前技術]之段中所論述的,各種小型快閃記憶卡 (緊密快閃卡、安全數位(SD)卡、多媒體卡(MMC)、xD及索 尼記憶棒/高速記憶棒等)具有不同電氣介面及通常供主機 (數位相機、快閃記憶體音樂播放器)使用的特定媒體命令, 該等特定命令未在PC與允許pc讀取卡的硬體配接器之間 所使用的命令集中發現。 在主要悲樣中,本發明使用一卡韌體變化以執行正常 項取命令/寫入命令。然而,當至特定LBA之讀取命令/寫入 ^令偏移時,檢查簽名以判定命令之資料部分是否含有内 嵌媒體卡特定命令。可將協定實施於任何媒體卡之韌體 中。因此,不需要配接器、USB讀取器或由pc(或不可存取 完,特定媒體命令集之其他主機)使用的其他讀取器之任 何靱體變化。實際上,對於卡製造者而言,此比實施讀取 斋莉體改變以用於所有讀取器薇商中的所有卡命令簡單。 116844.doc •48- 200809593 儘管通常將根據特定卡(諸如安全數位(SD)或緊密快閃 (CF))及特定協定(諸如scsi或ΑΤΑ)而描述本發明之各種態 樣’但當論述實例時,將瞭解,各種態樣適用於其他各種 5己憶體及系統。在整個此文獻中以引用方式併入的以下專 利及申請案中進一步描述關於卡結構及操作之各種細節。 圖14展示卡與個人電腦(或更一般而言,需要硬體配接器 以4取”玄卡的任何主機)使用讀取器進行通信所用之過 程。圖14除忽略對在某些狀況下的USB包裝或類似結構的 明確介紹(其在以下論述中亦將被限制)之外,其類似於圖 4。如[先前技術]中所提及的,卡與讀取器使用來自卡協定 之V々集的(諸如201處所指示的)指令而通信。主機與讀取 器通常使用來自另一命令集的(諸如2〇3處所指示的)指令而 通仏。讀取器使用其韌體而在兩個命令集之間轉譯。(儘管 此處及下文中提及韌體,但更一般而言此可實施於硬體、 軟體或此等硬體與軟體之某組合中。)困難在於當命令201 為來自在由PC用以與讀取器通信之協定中不具有均等命令 的卡之命令集之命令時。在此狀況下,因為不存在此均等 指令203,所以讀取器不能夠將201轉譯成相應命令203,且 對於相反方向而言亦為類似的。因此,若主機希望使用卡 之特定媒體指令中之,則在不&變?€:硬體配接器協定 之叩令集的情況下於先前技術中沒有辦法經由讀取器傳遞 該指令。 此特定實例將使用自主機至讀取器之SCSI協定、自讀取 器至卡之SD協定及不會作為内嵌命令存在於SCSI協定中 116844.doc -49· 200809593 的SD命令(例如,安全寫入)之實例。所以儘管此命令可直 接在SD卡中傳輸,但其需要使用應用程式之主機側的本發 明態樣以能夠傳輸載運主機與讀取器之間的命令之中間 SCSI協定中之指令。在讀取器處,虛設命令在每一協定中 具有一版本且可在該等協定之間被轉譯,其中將實際内嵌 命令視為資料。舉例而言,虛設命令再次被視為寫入。因 此,在主機與配接器之間,其將表現為SCSI寫入命令且在 配接器與卡之間其將表現為SD命令,同時在該兩個狀況 下,實際命令内嵌於資料部分中。所以儘管在此實例中内 嵌命令現存在於第二協定中,但其仍為内嵌的,因為在沿 路徑之某一點處,其傳遞一缺乏此特定應用程式命令之協 定。因此,此導致第一協定之命令内後於相同協定之命令 中,從而允許在其與缺乏内嵌命令之均等命令的另一第二 協定之間進行轉譯。圖15中對此進行了展示。儘管此論述 主要係根據SC SI及SD實施例而論述,但將瞭解,一般而言 其適用於其他協定。 圖15為當來自不具有PC讀取器命令集中之均等命令之卡 命令集的命令内嵌於具有在兩個命令集中之表示的PC讀取 器協定之指令203中時,本發明之原理態樣的示意性表示。 在例示性實施例中,特定媒體命令再次内嵌於PC讀取器協 定之資料部分中。PC及讀取器可接著交換命令203,其中讀 取器可將該命令203轉譯為相應命令201。然而,在此命令 内内嵌有另一特定媒體命令6(Π。讀取器接著傳遞此命令並 以一對其操作透明之方式轉譯該命令。例示性實施例之機 116844.doc -50- 200809593 制為具有在兩個命令集中之表示的指令201/203可存取卡 之記憶體中的預定邏輯位址。當(例如)卡接收到至特定邏輯 位址之讀取命令時,警告該卡此讀取命令可為特定媒體命 令601。(如下文中所描述,下文之實施例不依賴於此特定 邏輯位址,且更一般而言,不僅可使用寫入命令而且可使 用具有資料部分之任何命令。)卡接著檢查此命令之簽名以 對此進行驗證且接著提取命令60卜在例示性實施例中,由 於在SCSI及其他協定中,通常不存在方便之空間將特定媒 體命令内嵌於指令之命令部分中,所以命令601置放於指令 之資料部分内。 舉例而言,若PC希望對SD卡之安全區域進行寫入,則其 將形成指令203,該指令203由至特定邏輯塊位址(LBA)之寫 入命令組成,含有命令傳遞(CPT)簽名並含有内嵌於資料部 分中之實際安全寫入命令601。PC接著將此指令203發送至 讀取器,該讀取器將其解譯為SCSI協定中之標準寫入指 令。接著藉由讀取器將此轉譯為SD協定中之標準寫入指令 201。讀取器恰好傳遞安全寫入命令601,假定其為附著至 寫入命令之資料的部分。當指令201到達卡時,基於為寫入 而指定的LB A,韌體允許卡判定指令替代地係為特定媒體 命令。控制器接著提取命令601(將其識別為安全寫入),且 藉由執行對指令之實際資料部分的安全寫入而繼續執行命 圖16更詳細地描述執行至SD卡之N個資料區段之安全資 料寫入的實例之一特定實施例。頂列展示如由主機形成之 116844.doc -51- 200809593 指令。因為安全資料寫入不具有實例之SCSI協定中的類似 物,所以命令部分由SCSI協定中之命令CMD,組成,cMD, 此處為寫入,其存在於兩個命令集中。寫入係至特定命令 傳遞邏輯塊位址CPTLBA。(未展示命令之其他細節,以簡 化娜述。)貧料部分(虛線之右邊)由初始區段組成,其含有 特定媒體命令,隨後為N個實際資料區段。初始資料區段將 包括命令傳遞簽名、實際特定媒體命令及其中將寫入以下 資料的實際位址。邏輯塊位址CPTLB A對應於上文論述之第 例不性實施例的論述中所使用之邏輯塊位址 LBA一XYZ(例如見圖1〇A。)不同標記係用於指示在實施於主 機侧裝置驅動程式層級的本實例中,正被使用之邏輯塊位 址為特別指定之邏輯塊位址,而在實施於檔案層級之先前 實例中,可將其視為任何位址。 圖16類似於先前論述之圖5,但其中對於在此實例中明確 展示之傳輸協定(主機至讀取器、讀取器至裝置)中每一者重 複一次指令510。圖5之指令510將命令CMD之内嵌展示為此 將舍生於沿應用程式之主機側與裝置側之間的傳輸路徑之 某處,同時指令530將所提取之形式展示為其將由應用程式 之裝置側使用。圖16說明可存在若干中間協定且實際命令 (CMD)將保持内嵌於若干此等中間協定中,即使在其中内 嵌命令具有特定中間協定中之類似物的狀況下亦為如此。 如由讀取器所見,第一資料區段恰好為其視為待寫入至 特疋邏輯塊位址之資料的N+i個區段中之第一者。同樣,此 等傳遞内容未改變。藉由讀取器將指令之命令部分自pC/ 116844.doc -52- 200809593 讀取器協定中之其表示(CMDf)轉譯為卡協定中的其表示 (CMD) 〇此時,可將指令傳遞至卡且該指令仍具有(例如) 至CPTLAB之寫入命令隨後為N+1個資料區段的形式。 一旦在卡中,韌體便可解開實際命令。當其判定命令使 用特定位址時,其接著轉至第一資料區段,檢查CPT簽名 並提取實際特定媒體命令。此接著形成指令之實際命令, 該實際命令之後將接著為N個實際資料區段。 因此,如參看圖16描述的,具有N個資料區段之特定媒體 寫入命令變得内嵌為在於PC與讀取器之間使用的傳輸協定 中之N+1個資料區段。為了讀取N個資料區段,將特定媒體 讀取命令作為在讀取(或接收資料之其他命令)或於PC與讀 取器之間使用的傳輸協定中之一資料區段而内嵌。因此, 可將特定媒體讀取命令實施為具有内嵌於僅資料區段中之 特定媒體讀取命令的寫入命令。再次基於特定邏輯位址 (CPTLBA)及簽名,卡將提取特定媒體命令並以來自特定媒 體讀取中所指定的經請求邏輯塊位址之資料進行回應。上 文參考第一例示性實施例進一步展開關於讀取實施之細節 及處理諸如寫入或讀取失敗之複雜問題的方法。 特定邏輯位址(CPTLBA)較佳為並非通常用於檔案系統 中之區段,因為此可避免與可被發送至此區段之標準讀取 命令或寫入命令相衝突。舉例而言,在DOS中,於主啟動 記錄之後,通常存在通常不被存取之某些隱藏區段。(在某 些作業系統中,存取此區域可需要管理員權限,其為在下 一段之基於檔案之實施中可繞過的可能之複雜問題。)藉由 116844.doc -53- 200809593 將此邏輯位址視為特定邏輯位址,若非出於檢查實際命令 為内嵌特定媒體命令之目的,對此位址之存取將不會真正 在此處讀取或寫入資料。讀取器將僅傳遞此命令作為正常 資料存取且卡將每件事分類。 圖17A至17L展示可如何將命令之各種實例内嵌於資料 區段中的一實施例。如上文所描述,當執行至媒體卡之寫 入時,資料部分之第一區段含有CPT(卡傳遞)命令。其指示 待執行之CPT功能。因此,為了寫入10個區段,因為第一 區段為CPT標頭故實際上寫入11個區段。為讀取10個區段, 使用者需要發送CPT命令之一寫入接著讀取10個區段。實 際應用程式為執行不可由正常讀取命令或寫入命令達成的 特定命令。舉例而言,CPT模式可用於特定媒體命令,諸 如AKE(鑑認密鑰交換)或SD卡之應用程式命令。 圖17A展示内嵌命令格式實施例。位元組0至31中之CPT 簽名為取決於用以檢查該簽名與該命令匹配之命令的字符 串。位元組32中之命令可包括: 0 - CPT模式檢查:意欲檢查媒體卡之CPT模式支援 簽名”卡傳遞模式檢查’’ 1 -資料輸出:資料將寫入至媒體卡 簽名”卡傳遞輸出命令” 2 -資料輸入:資料將自媒體卡讀取 簽名”卡傳遞輸入命令’’ 3 -無資料傳送之命令 簽名”卡傳遞無I/O命令” 116844.doc -54- 200809593 4 · CPT命令異常中止 簽名”卡傳遞異常中止命令,, 5 - CPT模式重設 簽名’’卡傳遞重設命令’’ 6 - CPT狀態擷取 * 簽名"卡傳遞狀態讀取” - 身料傳輸長度(Data Transfer Length)(位元組33至35)指定 φ 待傳送之資料量(如位元組之數目);由於資料以區段形式傳 送,所以不完整之區段由〇來填充。Data(位元組36,位元 1)為資料傳送之旗標且若在下一命令上不存在資料傳送則 其為若在下一命令上存在資料傳送則其為"i"。類似 地,Dir(位元組36,位元0)為資料傳送之方向的旗標且若資 料傳运係對於下一命令上之輸入而言,則其為,,〇 ",若資料 傳送係對於下一命令上之輸出而言,則其為"Γ,。 、 媒體卡特定命令區域(位元組48_511)為當被提取時媒體 • 卡將對其加以執行的實際命令。媒體卡特定旗標區域(位元 組36,位元〇)用於媒體相關旗標。 若在發送實際命令之前媒體卡支援卡傳遞命令協定,則 •必須檢查該媒體卡。如上文所描述,LBA(cpTLBA_卡傳遞 LBA)係指定用於該協定。LBA可為自卡之低〇區段至最末區 段的任何數子。在實例中,此將為LB A 2,其為在FAT檔案 系統中之主啟動記錄之後的第二隱藏區段且通常並不用於 保持貝料。注意,即使該LB A含有有效資料,此協定仍將 保存其值。對於檢查模式支援,存在兩個選擇。 I16844.doc •55- 200809593 查詢協定支援之第一選擇係用於當媒體卡將CPT模式支 援簽名置於CPTLBA區段中時。然而,若CPTLBA為具有有 效資訊之區段,則此並非較佳的;例如,FAT/目錄或使用 者資料區域中之區段。若支援CPT模式,則視情況卡可返 回具有如圖17B中所示之簽名的CPTLBA區段,其中位元組 0-31為’’支援卡傳遞模式(以空白填充)"且位元組32-5 11為 0。 若CPTLB A區段不含有支援CPT模式之簽名,則可使用查 詢協定支援的第二選擇。在此狀況下,將以下協定用於檢 查模式支援: a) 讀取CPTLBA區段並將其儲存於主機記憶體區域中。 (不支援簽名) b) 寫入具有一含有用於查詢CPT模式支援之簽名之區段 的 CPTLAB。 c) 讀取CPTLBA區段以檢查CPT模式支援之回應。 d) 寫入具有一來自所儲存記憶體區域之原始區段的 CPTLAB。 當主機讀取CPTLBA區段並將其儲存於記憶體中時,步驟 a)允許檢查特定邏輯位址(CPTLBA)以進行支援同時仍保持 其中可含有之任何資料。此係用以在媒體卡不支援卡傳遞 模式時復原區段。此寫入並不使用CPT模式命令。 圖17C展示步驟b),具有含用於查詢之簽名之區段的 CPTLBA寫入。主機將CPTLBA區段的位元組0-31寫入為”卡 傳遞模式檢查π(以空白填充),接著於位元組32-47中寫入命 116844.doc -56- 200809593 令及旗標。位元組48-511為0。 在步驟c)中,主機讀取CPTLBA區段以進行回應。若回應 如圖17D中所示具有為"支援卡傳遞模式"(以空白填充)之位 元組〇_31及為〇之位元組32_511,則支援卡傳遞模式;否則, 卡並不支援CPT協定。注意,此協定不同於用以查詢協定 支援之第一選擇。當發出CPT模式檢查命令時,對簽名進 行回應。 在步驟d)中,主機自所儲存之記憶體區域寫入cpTLBA區 段中的原始資料。注意,即使卡支援卡傳遞模式,仍因為 不存在適當簽名而不會將此寫入解釋為特定cpT命令。 參看圖17E至圖17G而描述輸入/輸出協定。為將資料輸出 至媒體卡,首先以用於輸出之簽名寫入CpTLBA,接著基於 資料傳送長度而寫入資料。為了以用於輸出之簽名寫入 CPTLBA ’主機將一寫入命令發送至媒體卡,其中資料具有 内嵌有媒體卡特定命令的CPT命令格式。長度為”資料傳送 長度"加CPT命令格式之一區段。圖17E中對此進行展示, 其中位元組32中之1對應於"待寫入至媒體卡的資料,,。 圖17F中展示基於資料傳送長度之實際寫入,其中媒體卡 如何處理資料取決於媒體卡特定命令。如參看圖17 a所提及 的,此實例中之”資料傳送長度"資訊係根據位元組而表示 於位元組33-35(MSB、LMSB、LSB)中。然而,因為在卡與 碩取器之間以區段形式傳送讀取/寫入資料,所以可視需要 以0來填充不完整區段。舉例而言,在SD卡中,鑑認密鑰交 換(AKE)過程使用8個位元組進行詢問及回應。因此,主機 116844.doc -57- 200809593 以5 04個位元組的0來填充資料區段以詢問1及回應2資料, 其中卡類似地填充詢問2及回應1資料。 為了輸入來自媒體卡之資料,主機以用於輸入之簽名寫 入CPTLBA且接著基於資料傳送長度而讀取資料。圖17G展 示待發送以指示將讀取資料的CPT命令,其中位元組32中 之2對應於"待自媒體卡讀取的資料"。為了基於資料傳送長 度而讀取資料,於主機將一讀取命令發送至媒體卡之後, 待讀取之區段的數目為[(資料傳送長度)/512]。(此假定每區 段5 12個位元組;更一般而言,若為不同區段,則實際區段 長度將取代512。)起始區段為CPTLBA。由於先前命令為 CPT輸入命令,所以卡會基於媒體卡特定命令而將資料發 送至主機。 不具有輸入或輸出之命令的實例包括"不具有資料傳送 之命令”、"CPT命令異常中止”及"CPT模式重設"。圖17H展 示”不具有資料傳送之命令",如由在位元組32處之3所指 示。 圖171展示"狀態讀取’’命令(由位元組32處之6指示),其允 許主機讀取CPT狀態。舉例而言,在SD卡中,可將狀態實 施為回應資料。該狀態將為讀回資料之最初少數個位元組。 儘管當需要具體實例時參考SD卡,但圖17A至圖171並不 限於任何特定媒體協定且並不限於特定媒體命令。為了給 出特定媒體命令之實例,圖17J展示專用於SD或MMC卡之 内嵌命令且圖17L展示專用於緊密快閃卡之内嵌命令。 在圖17J中,展示SD/MMC實例之命令格式。位元組0-35 116844.doc -58- 200809593 係如上文所述。SD/MMC命令填充媒體卡特定命令欄位。 位元組48-53為SD命令,例如為安全讀取。在媒體卡特定旗 標攔位中需要並界定某些旗標。BLKH指示命令是用於單一 區段還是用於多個區段:若使用單一區段命令則為〇,且若 使用多個區段命令則為丨。對於應用程式命令而言, APPM。回應類型視命令索引而為§1>回應類型。位元組 48_52中之各項為SD命令之實際元素,其中位元組幻中之 CRC7視情況可被設定為〇 〇 為獲得SD命令之回應資料,使用者可發送狀態_取以獲 得回應。圖17K中對此進行展示。#讀取區段之最㈣個位 元組時將傳回回應資料。 圖17L展示内嵌命令之緊密快閃(CF)命令格式。在此狀況 下,命令在位元組48-54中且提供包含CF命令所需之元素。 在圖17L中,媒體卡特定旗標(位元組刊之位元2至位元組 37)經保留以供專用於各種卡格式之另外命令之用。 第三例示性實施例 第三例示性實施例實施於擋案層級,如第一例示性實施 :卜般。此處’論述將更集中於主機側檔案中所置放之細 節。由於裝置特定命令内嵌於稽案中,所以沒有辦法損害 諸如FAT區域之檔㈣統特定資料。自卡之觀點而言,不二 例示性實施例將看起來為類似的,其不同之處更多的是關 於如何在主機㈣裝資訊。當需要參考㈣制程式時, 第三例示性實施例將為至安全匯流排之安全連結的應用程 式諸如在2004年12月21日申請的美國臨時專利申請案第 116844.doc -59- 200809593 60/638,804號中所提出的, 叫幻,該案以上述方式併入本文中。 在使用檔案層級實旖的^主1 、 貝私的^況下,除克服使用裝置驅動程 式層級實施可能出現66姑#此 的“類權限問題之外,亦可克服對呈 有發送特定命令之特定硬體的可能之需要。舉例而言,: 某些狀况下’於裝1驅動程式層級’存在著必須發送特定 指定以存取SD卡之安全戸 王&域的為要,但在使用檔案層級實 施的情況下,因為資吨孫科& 貝巩係封裝於檔案内,故對此不再存在An example of a protocol for hiding a split application will now be described. Figures 11A through 11C φ illustrate some of the same processes as those of Figure 1A, but are illustrated in terms of activity on the system busbar between the host and the mounting. Figure UA shows the process of identification and secure segmentation of FAT reads. First, the host sends the username + password to the card for authentication. Once authenticated, the card allows the application to read the FAT from a secure and hidden partition. The split continues until the host terminates the session or the device experiences a power cycle. As long as the split is on, it is allowed to be read and written by the host application to the hidden split. Figure 11B illustrates a host read of a file in a secure partition. As described above, the "specific application read command" appears in two card agreement commands. - specifies the nature of the read command and the write command of the argument; and the subsequent actual read command. Figure 11c illustrates the host write to the hidden partition. In the case of authentication, the host can access the split FAT and now has the right to transfer the new file to the host. The host sends a write command to a secure partition with a write start address and a sector count. Figure 8 shows an embodiment of the device application state mentioned above and an exemplary value of a hidden segmentation example. Because several different splits are allowed, 116844. Doc -37- 200809593 In the example, the byte 1 in the device application split ID is given as "1". The next four bytes give the split size, shown here as the ten megabyte of the segment The value of byte 3. indicates whether the split is currently on and gives the next four bytes to indicate the version of the device application. The byte 10 provides the operational status. The bytes 10 to 5 are padded with zeros. Thus forming a segment. In the variant, the byte 11 can be used to record the number of segments written in the last transaction. Table 1 describes the application private protocol command sent to the device application of the hidden segmentation instance. An example. The CMD index is placed in the byte 33 of the command section, and the command self-variables are placed from the byte 34 and placed in the specified order written in the table. CMD Main CMD Name The number of CMD independent variable bytes 1.  OPEN-PARTITION User name length in bytes 1 User name Specified in the first argument. User password length in bytes 1 - User password Described in the third argument.  CLOSE PARTITION User name length in bytes 1 ____ User name Specify in the first argument _ User password length in bytes 1 ___ User password is specified in the third argument _ 3.  READ-PARTITION Number of LBAs 4 Read sector count 4 4.  WRITE—PARTITION Number of LBAs 4 Write Segment Count 4 5.  READ_PARTITION_STATUS Split ID 1 Table 1 When the embedded hidden split command is transmitted by the device's write protocol (such as the SD protocol), the device application actually used for partitioning is not built. Doc -38 - 200809593 For SD rule operations "After writing or reading a command, the split command interpreter will be called by, for example, the sd command interpreter. After parsing the command section, the command interpreter will call the appropriate routine. In a particular embodiment, the application command may have a parameter as a first argument indicating whether the MD command is a read command or a write command. The second parameter passes the indicator to the location of the command segment in the configured RAM. Since the information about the split device application begins at that point in the segment, the indicator will point to byte 33 (command opcode index). The buffer size pointed to by this second parameter can be specified in the third parameter. As already mentioned, since the write command of the device application is executed in the same sequence as the sequence of the card agreement immediately after parsing the command section, the write commands are simple. For example, under SD conditions: 1. Receive SD write command (1 or more segments): In the exemplary embodiment, the first segment is always a command segment. 2. The card layer parses the first 32 bytes of the first segment and identifies the signature of the command segment. The device application command parser (interpreter) is invoked with an indicator pointing to the command section. 3. After executing the command interpreter to identify the embedded application command, the command interpreter invokes the appropriate routine that will execute the embedded command and begin the application's command process. 4. Execute the command procedure for the hidden split application and pass the status back to the card layer, where the sequence will go to the end where the SD write command process will terminate. The SD card goes to the idle (IDLE) state. As already mentioned, the read command in the hidden split application protocol is 116844. Doc -39- 200809593 is a two-step process that includes (again in the SD embodiment) an SD write command followed by an SD read command. The first step is an SD write command. 1. A § 〇 write command with a data block (512 bytes) sent by the host. In the exemplary embodiment, the first segment is always a command segment. . 2. The card layer parses the first 32 bytes of the first segment and identifies the signature of the command segment. The command parser (interpreter) of the device application is invoked with a pointer to the command section. 3. After executing the command interpreter to identify the embedded application command, the command solution # identifies the internal read command that will be executed (in the next SD read command) and stores the command identifier. The command interpreter then sets the card layer to read the command flag. 4. Execute the application's command procedure and pass the status back to the card layer, where the sequence will go to the end where the SD write command process will terminate. The sd card can be turned to idle. The first step is to read the command for S D: 1 · S D read command. 2. The SD card layer checks the application card layer to read the command flag and finds that it is set: it invokes the device application command interpretation with the read command indication instead of calling the rule SD read command. 3. The device application command interpreter recognizes the split read command flag and re-invokes the split read command identifier stored in the previous write command. This identifier points to the corresponding split read routine and initializes the split read sequence. 4. Perform a split read sequence and pass the return status to the card layer. 116844. Doc 200809593 5· The card layer terminates the SD reading process and the card enters the interlaced state. The reading and writing process is illustrated by a command state machine of the card side application shown in Fig. 12 of the SD embodiment. Since these embedded commands are passed by the SD write command, and the host cannot transmit the command section on the SD read command when the hidden split read command needs to be executed, the command solution of the device application (1023) The translator needs to maintain a state machine that will manage and understand which read commands are being executed by host application 1〇53. In this figure, a circle refers to a device-specific application command executed at the device application layer (Fig. 6, 1〇23), and an additional comment means that? The command in the middle (here, SD) agreement seen at the £ layer (Fig. 6, ι〇2ι). The right side of Figure 12 is the process of writing, where any process that transfers data to the device or no data is transmitted will follow a similar process. The left side of Figure 12 is a read or other process that transfers data from the device to the host. The read flow consists of reading the B path of the first command of the pair and the c path of the second command of the pair. The write process begins with the read process in the same manner, and receives a write command 'discussing the embedded command from the write command after the signature is detected. For the writer process, the 'writer' flag remains open (. The write process is performed. However, for the first stage of the read process, the read flag will be set. The illusion is read from the host. Overfeed (10) 3) (4) This cut (SD) reads the target. Material target: The read command from the host (on the SD bus) is not a regular card read = and should be directed to the device application (10) 3) for the second phase of the process of sending the item I Wherein in response to the second command of the pair, the device is 116844. Doc -41 - 200809593 Transfer information. The flag is reset when the card layer is initialized. Referring to the commands listed in Table 1, the 〇PEN_PARTm〇N command (OP-Code 0x01) receives the username and password and verifies them. If it matches the stored name and password of the device application, the split is turned on for host access (read, write). At this time, there is an authentication phrase that is to be transmitted and verified against the phrase in the code of the device application. This process is illustrated in Figure 13A. The split will remain on until CLOSE ^PARTITION turns it off or until the next power cycle. The use of the CLOSE-PARTITION command (OP-Code 0x02) is used to close the application working session and prevent splitting from being turned on. An embodiment is shown in Figure 13B. The use of the READ-PARTITION command (OP-Code 〇χ〇3) is shown in Figure 13C. If splitting is enabled (Yes path from 1633 to 1635), this command will enable the host application to read the data stored in the split (1639, 1641). In an exemplary embodiment, the routine will invoke the "FlashRead" API routine, which directs the data transfer to the hidden partition. The WRITE-PARTITION command (OP-Code 0x04) directs the data from the host to the host. The hidden partition on the card. As shown in Figure 13D, this command is executed by the device application only when the (SET) split flag (1653) is set. This routine will call "FlashWrite" (1659, 1661) An API routine that directs data transfer to a hidden partition. The READ-PARTITION-STATUS command (OP-Code 0x05) supplies the information shown in Figure 8. This is an application having the structure described above with reference to Figure 8 116844. Doc -42- 200809593 Read command. When the command comes in, the routine will gather all the information and place it in the above structure and send it to the host. As mentioned above, some operating systems will divide the instructions from time to time so that not all of the data portions will be attached to their respective command portions. Under this circumstance, the written instruction of the oblique 邱 八 八 — pl pl 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 贝 pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl pl The command to attach a standard command in the signed transport agreement may actually be the remaining specific application command. As a specific example, considering the condition of the instruction 51 of Fig. 5, the instruction 51 has (10), for example, the data portion 513 of ten blocks. When this command is transmitted to the card, the host's operating system can only transmit the remaining five blocks later in the preferred five blocks attached to the (4) portion of the command. When the last block of data blocks is sent, it will lack the initial data block 5Ua containing the signature of the application agreement and the actual command, and will appear as part of the standard command from the transport protocol. This segmentation can also occur when the internal application command is a read command, causing the data to be sent from the card to the host in a partial manner. Figure 10B illustrates the flow of Figure i〇a by replacing the single-logic block address lba=lba_xyz with the logical address lbAr for the read and write process and LBAWi to illustrate the read and write in a particular application. This segment in the command. By defining the LBA-fetch and write LBAwi, the device can handle interrupts for application data transfers in either direction. Subscripts are used to take into account the simultaneous implementation of multiple application-specific commands from multiple applications and multi-user host devices. The process of Figure 10B is again based on an instance of the sd card that uses the SD protocol as a transport protocol and is opened by means of the SD idle state and receiving commands at 12〇116. Doc -43 - 200809593 Start. It then determines if the received command is an SD write (1203), and if it is not an SD write, determines if it is an SD read (1205). If it is neither SD nor SD read, the SD command (1207) is executed and the device returns to the idle state (1209). If the instruction received at step 1203 is an SD write, then the transfer signature is checked (1214). If a signature is found at 1214, this indicates the beginning of a new embedded command, which can then be extracted. At 1231, for all read and write logical block addresses LB ARi;wi-, if the logical block address LBACMD of the incoming command is the same as the logical block address assigned to the current write process (LBAcmd=LBAwi ) 'Clear the corresponding LBA^j; wi. Typically, the assigned LBACMD should not be used, but if it has been assigned to another process, it will abort and clear the address. Then determine the data direction of the specific application command (1233). If no data transfer is involved, then the specific application command (1245) is executed and the device returns to the idle state (1249). If the application command is a write, the corresponding logical address is set to LBAWi=LBACMD + data blockeoimt (1251) and the application data (1253) is written. As discussed above, the host's OS can separate the instructions so that the command does not ship with all the corresponding data. When extracting and parsing embedded commands, the card knows how many data blocks should be included. At 1255, a check is made to see if all data is included and written. If so, LBAWi (1257) can be cleared; otherwise, it is not cleared because the remaining data will (unless interrupted by an error or shutdown) eventually follow and will appear to be the address calculated above. The serial SD of the continuous (relative to this command) card address is written to 116844. Doc -44- 200809593 Command. The device will then return to the idle state (1259) to wait for another life 0 to return to 1231. If the application command is read, the device sets LBALi = LBACMD and sets datatypeRi = datatypeCMD (1235) to be the second read at 1263. Subsequent data transfer in the phase is prepared. The device then goes to the SD idle mode to wait for the second phase of the read process. Different changes to this solution will not use LBACMD but instead use the different address LB Aread explicitly defined in the parameters of the write command. This method will work around the OS's caching mechanism. In several systems, the host OS will not attempt to read back the card address that was just written. Instead, it will return the data buffer to the host application's host cache buffer, assuming that the data is the data the card has, since it has just been written to it. In this case, the data buffer will include specific application commands instead of card responses. Returning to 1214, if the command (in the transport protocol) is a write (from 1203 to the yes path), but lacks a signature (from 1214 to the no (no) path), the command can actually be a transfer (this The write command in the SD) agreement, or may be additional material for writing in an application contract. This is determined at 1215: if for any of the LBAwis, LBACMD#LBAwi, then it is the standard SD write that is then performed at 1217, after which the card transitions to the SD idle state (1219). If LBACMD matches one of the LBAwis, the command is actually the more data portion of the corresponding application command and the flow goes to 125 1 to write the additional application data. Returning to step 1205, if the command is an SD read, it is determined to be actually I16844. Doc -45- 200809593 SD reads or reads the second stage of the application. This is determined at 1226 by comparing LB ACMd with LB ARi: if for any of LB ARi, LBACMD#LBARi, then it is a standard 80 read that is then performed at 1227, followed by a card Go to the SD idle state (1229). Alternatively, for any of LBARI, LBACMD matches one of LBARI, which is the second stage of application reading. When LBAcMD = LBARR, the corresponding logical address is set to LBARi = LBACMD + data blockcoimt (1261) and the application data (1263) is read. The device then transitions to the SD idle state (1269). For the application read process, the exemplary process lacks the equal steps of steps 1255 and 1257 on the application write side. Continue to set the corresponding read flag even if all the corresponding data has been accessed. By keeping the LB ARi turned on, the data can be re-read under error conditions. Under this configuration, for an instance, such as in step 123 1 , if the address is reassigned for another purpose, only LB ARi is cleared. Such additions relative to Figure 10A of Figure 10B allow for an interruption in the transfer of application data. It also eliminates the need to read and write to the same logical address. Such permissive techniques are used in situations where there may be insufficient control of the operating system, as the type of control required by the embodiment of Figure 10A may require a known controllable platform. Again, it should be noted again that Figure 10B more specifically incorporates the existence of multiple host applications, each of which is in independent communication with the card, and that the interruption of data transfer can be inserted between the portions from an agreed instruction from another agreement. Part of the instruction. In addition, the independent LB A of the read process and the write process allows any read or write cache in the device driver layer to be bypassed. I16844. Doc -46- 200809593 The second exemplary embodiment - the example is implemented at the file level. Various aspects of the present invention can also be implemented at the device driver level to initiate read and write operations by sending a request to the device driver, such as when the host uses the wind system, and the device is driven first. The program can store drivers for the WindGws standard. This implementation of the life delivery method communicates directly with the device and does not have the cost of the broadcast system. However, this method may require administrative privileges. The host application can try this method and use this method as the first choice and if it fails, it will be transferred to the file system operation. The interface function can be used to select between these methods and initialize the communication pipeline accordingly. The user will use this command with the application before any other operations. If the application lacks proper administrator rights, working in this way will result in an exception, which can be handled based on the exception handling code. The case is based on the discussion of the problem in the [Prior Art] section above. Although [the discussion of the first technique raises the problem in the case where the memory card is connected to the pc via the hardware card reader, it will be seen below (as in the other examples given here)] For the general. The memory device may have this protocol translated 'or more precisely' even when it is directly connected to the second host, there is no translation problem. This can be the case when the memory device is connected to a host with an incomplete agreement (as seen from the memory device). - The situation in which this can occur is where the card has two sets of contacts' - the set is used by the USB port and is used by the card contacts of the " (U.S. Patent Application Serial No. 29/2,3,693, filed on Apr. 16, 2004, US Serial No. 26,8,1, and still No. 0/826,796, the example of such a two-contact card.) As for the third group 116844. Doc-47-200809593 As discussed in the embodiments, the protocol translation can be completely contained within the memory device itself, not known to the host. Further, in the following, although the embodiment is described with respect to the detachable memory card, the discussion is also applicable to the embedded memory device. In a first set of embodiments of the second exemplary embodiment, the present invention uses a particular logic block to allow media card specific commands to be passed from the host to the card without changing the firmware of the adapter or reader that controls the media card. A Address (LBA) (Card Transfer Mode LBA) that has a specific signature in the data section to notify the card specific command to be embedded in the section. This can be implemented by firmware changes to support command delivery (CPT) mode. Since this does not require firmware changes to the adapter, the card can be executed at any USB reader or adapter. As discussed in the [Prior Art] section, various compact flash memory cards (compact flash cards, secure digital (SD) cards, multimedia cards (MMC), xD, and Sony memory sticks/high-speed memory sticks) have Different electrical interfaces and specific media commands typically used by the host (digital camera, flash memory music player), such commands are not used between the PC and the hardware adapter that allows the pc to read the card. Focus on discovery. In the main sadness, the present invention uses a card firmware change to perform a normal item fetch command/write command. However, when a read command/write command offset to a particular LBA is made, the signature is checked to determine if the data portion of the command contains an embedded media card specific command. The agreement can be implemented in the firmware of any media card. Therefore, there is no need for adapters, USB readers, or any variants of other readers used by pcs (or other hosts that are inaccessible, specific media command sets). In fact, for the card manufacturer, this is simpler than implementing a read jamming change for all card commands in all readers. 116844. Doc •48- 200809593 although various aspects of the invention will generally be described in terms of a particular card (such as Secure Digital (SD) or Compact Flash (CF)) and a specific agreement (such as scsi or ΑΤΑ), but when discussing examples, It will be appreciated that the various aspects are applicable to a variety of other 5 recalls and systems. Various details regarding the structure and operation of the card are further described in the following patents and applications incorporated by reference herein in its entirety. Figure 14 shows the process used by a card to communicate with a personal computer (or more generally, any host that requires a hardware adapter to take a "black card") using a reader. Figure 14 is omitted except under certain conditions. In addition to the explicit description of the USB package or similar structure, which will also be limited in the following discussion, it is similar to Figure 4. As mentioned in [Prior Art], the card and reader use the card protocol. The V々 is communicated with instructions (such as indicated at 201.) The host and the reader typically use an instruction from another command set (such as indicated at 2〇3). The reader uses its firmware. Translating between two command sets. (Although the firmware is mentioned here and below, in general this can be implemented in hardware, software or some combination of hardware and software.) The difficulty lies in Command 201 is a command from a command set of cards that do not have an equal command in the protocol used by the PC to communicate with the reader. In this case, since there is no such equal instruction 203, the reader cannot 201 is translated into the corresponding command 203, and for the phase The direction is also similar. Therefore, if the host wants to use the specific media command of the card, there is no way in the prior art in the case of the set of the hardware adapter agreement. This instruction is passed via the reader. This particular instance will use the SCSI protocol from the host to the reader, the SD protocol from the reader to the card, and will not exist as an embedded command in the SCSI protocol 116844. An example of an SD command (for example, secure write) of doc -49· 200809593. So although this command can be transmitted directly to the SD card, it requires the use of the present invention on the host side of the application to be able to transfer instructions in the intermediate SCSI protocol that carries commands between the host and the reader. At the reader, the dummy commands have a version in each contract and can be translated between the agreements, with the actual embedded commands being treated as data. For example, a dummy command is again considered a write. Therefore, between the host and the adapter, it will behave as a SCSI write command and between the adapter and the card it will behave as an SD command, while in both cases the actual command is embedded in the data portion. in. So although the embedded command now exists in the second protocol in this example, it is still inline because at some point along the path it passes a protocol lacking this particular application command. Thus, this results in the order of the first agreement being followed by an order of the same agreement, thereby allowing translation between it and another second agreement lacking an equal order of the embedded command. This is shown in Figure 15. Although this discussion is primarily based on SC SI and SD embodiments, it will be appreciated that in general it applies to other agreements. Figure 15 is a schematic diagram of the present invention when a command from a card command set that does not have an equal command in the PC reader command set is embedded in an instruction 203 of a PC reader protocol having representations in two command sets. A schematic representation. In an exemplary embodiment, the particular media command is again embedded in the data portion of the PC reader protocol. The PC and reader can then exchange command 203, which can translate the command 203 into a corresponding command 201. However, another specific media command 6 is embedded within the command (Π. The reader then passes the command and translates the command in a manner that is transparent to its operation. The machine of the illustrative embodiment 116844. Doc -50- 200809593 is a predetermined logical address in the memory of the instruction 201/203 accessible card with the representation in the two command sets. When, for example, the card receives a read command to a particular logical address, the card is warned that the read command can be a particular media command 601. (As described below, the embodiments below are not dependent on this particular logical address, and more generally, not only can a write command be used but any command with a data portion can be used.) The card then checks the signature of the command to Validating this and then extracting the command 60. In the exemplary embodiment, since there is usually no convenient space for embedding a particular media command in the command portion of the command in SCSI and other protocols, the command 601 is placed in In the information section of the Directive. For example, if the PC wishes to write to the secure area of the SD card, it will form an instruction 203 consisting of a write command to a specific logical block address (LBA) containing a command pass (CPT) signature. It also contains the actual secure write command 601 embedded in the data section. The PC then sends this instruction 203 to the reader, which interprets it as a standard write command in the SCSI protocol. This is then translated by the reader into a standard write instruction 201 in the SD protocol. The reader happens to pass the secure write command 601, assuming it is part of the data attached to the write command. When the instruction 201 arrives at the card, the firmware allows the card decision instruction to be a specific media command based on the LB A specified for writing. The controller then extracts the command 601 (identifying it as a secure write) and continues to execute the life map 16 by performing a secure write of the actual data portion of the instruction. The N data sectors executed to the SD card are described in more detail. A specific embodiment of one of the examples of security data writing. The top column display is formed by the host 116844. Doc -51- 200809593 Directive. Because the security material is written to an SCSI protocol that does not have an instance, the command portion consists of the command CMD in the SCSI protocol, cMD, here written, which exists in both command sets. Write to the specific command pass logic block address CPTLBA. (The other details of the command are not shown to simplify the narrative.) The poor portion (to the right of the dashed line) consists of the initial segment, which contains a specific media command followed by N actual data segments. The initial data section will include the command delivery signature, the actual specific media command, and the actual address where the following data will be written. The logical block address CPTLB A corresponds to the logical block address LBA-XYZ used in the discussion of the example embodiment discussed above (see, for example, FIG. 1A.) Different tags are used to indicate implementation on the host. In this example of the side device driver hierarchy, the logical block address being used is a specially designated logical block address, and in the previous instance implemented in the file hierarchy, it can be treated as any address. Figure 16 is similar to Figure 5 previously discussed, but with instructions 510 repeated for each of the transport protocols (host to reader, reader to device) explicitly shown in this example. The instruction 510 of FIG. 5 embeds the command CMD inline for somewhere along the transmission path between the host side and the device side of the application, while the instruction 530 presents the extracted form as the application to be used by the application. Used on the side of the device. Figure 16 illustrates that there may be several intermediate agreements and that the actual command (CMD) will remain embedded in a number of such intermediate agreements, even in situations where the embedded commands have analogs in a particular intermediate agreement. As seen by the reader, the first data segment happens to be the first of the N+i segments of the data to be written to the special logical block address. Again, this delivery has not changed. The command part of the instruction is taken by the reader from pC/ 116844. Doc -52- 200809593 The representation in the reader protocol (CMDf) is translated into its representation (CMD) in the card agreement. At this point, the instruction can be passed to the card and the instruction still has (for example) writes to CPTLAB. The command is then in the form of N+1 data sections. Once in the card, the firmware can unlock the actual command. When it decides that the command uses a particular address, it then goes to the first data section, checks the CPT signature and extracts the actual specific media command. This then forms the actual command of the command, which will be followed by N actual data segments. Thus, as described with reference to Figure 16, the particular media write command with N data sectors becomes embedded as N+1 data segments in the transport protocol used between the PC and the reader. In order to read N data sections, a particular media read command is embedded as one of the data sections in the transport protocol used to read (or receive other data) or between the PC and the reader. Thus, a particular media read command can be implemented as a write command with a particular media read command embedded in only the data section. Again based on the specific logical address (CPTLBA) and signature, the card will extract the specific media command and respond with data from the requested logical block address specified in the particular media read. The method of reading the details of the implementation and handling complex problems such as write or read failures is further developed with reference to the first exemplary embodiment. A particular logical address (CPTLBA) is preferably a segment that is not commonly used in a file system because it avoids conflicts with standard read commands or write commands that can be sent to this segment. For example, in DOS, after the master initiates a record, there are typically some hidden sections that are not normally accessed. (In some operating systems, access to this area may require administrator privileges, which is a potentially complex issue that can be bypassed in the next file-based implementation.) By 116844. Doc -53- 200809593 Treat this logical address as a specific logical address. If it is not for the purpose of checking the actual command to embed a specific media command, access to this address will not actually be read or written here. Enter the information. The reader will only pass this command as normal data access and the card will sort everything. Figures 17A through 17L show an embodiment of how various examples of commands can be embedded in a data section. As described above, when performing a write to a media card, the first section of the data portion contains a CPT (Card Transfer) command. It indicates the CPT function to be executed. Therefore, in order to write 10 sectors, 11 segments are actually written because the first sector is a CPT header. To read 10 segments, the user needs to send one of the CPT commands to write and then read 10 segments. The actual application is a specific command that cannot be reached by a normal read command or a write command. For example, the CPT mode can be used for specific media commands, such as AKE (Authenticated Key Exchange) or SD card application commands. Figure 17A shows an embodiment of an embedded command format. The CPT signature in bytes 0 through 31 is a string depending on the command used to check that the signature matches the command. The commands in the byte 32 may include: 0 - CPT mode check: CPT mode support signature for checking the media card "card transfer mode check" '1 - data output: data will be written to the media card signature" card delivery output command 2 - Data input: The data will be read from the media card. The card is passed to the input command '' 3 - Command signature without data transmission. The card passes no I/O command" 116844. Doc -54- 200809593 4 · CPT command aborted signature "card delivery abort command, 5 - CPT mode reset signature ''card pass reset command'' 6 - CPT state capture * signature " card delivery status read Take - Data Transfer Length (bytes 33 to 35) specifies φ the amount of data to be transferred (such as the number of bytes); since the data is transmitted in segments, the incomplete section Filled by 〇. Data (byte 36, bit 1) is the flag of the data transfer and if there is no data transfer on the next command, it is "i" if there is data transfer on the next command. Similarly, Dir (byte 36, bit 0) is the flag of the direction of data transfer and if the data transfer is for the input on the next command, it is, 〇", if the data is transmitted For the output on the next command, it is "Γ,. The media card specific command area (bytes 48_511) is the actual command that the media card will execute when it is extracted. The media card specific flag area (bytes 36, bit 〇) is used for media related flags. If the media card support card passes the command agreement before the actual command is sent, • the media card must be checked. As described above, LBA (cpTLBA_Card Pass LBA) is specified for this protocol. The LBA can be any number from the low to the last segment of the card. In the example, this would be LB A 2, which is the second hidden segment after the master boot record in the FAT file system and is typically not used to hold the bedding. Note that this agreement will retain its value even if the LB A contains valid data. There are two options for checking mode support. I16844. Doc •55- 200809593 The first choice for query protocol support is when the media card places the CPT mode support signature in the CPTLBA section. However, this is not preferable if CPTLBA is a section with valid information; for example, a section in the FAT/directory or user profile area. If the CPT mode is supported, the card may return to the CPTLBA section having the signature as shown in FIG. 17B, where the byte 0-31 is ''support card delivery mode (filled with blanks)" and the byte 32-5 11 is 0. If the CPTLB A section does not contain a signature that supports the CPT mode, then the second option supported by the query protocol can be used. In this case, the following agreement is used to check mode support: a) Read the CPTLBA section and store it in the host memory area. (Signature not supported) b) Write to CPTLAB with a section containing the signature used to query CPT mode support. c) Read the CPTLBA section to check the response of the CPT mode support. d) Write a CPTLAB with an original segment from the stored memory region. When the host reads the CPTLBA segment and stores it in memory, step a) allows a specific logical address (CPTLBA) to be checked for support while still retaining any data that can be contained therein. This is used to restore a zone when the media card does not support card transfer mode. This write does not use the CPT mode command. Figure 17C shows step b) with a CPTLBA write containing a section for the signature of the query. The host writes the byte 0-31 of the CPTLBA section as "card transfer mode check π (filled with blanks), and then writes 116844 in bytes 32-47. Doc -56- 200809593 Order and flag. Bits 48-511 are zero. In step c), the host reads the CPTLBA section to respond. If the response has a bit 〇_31 for the "support card transfer mode" (filled with blanks) and a byte 32_511 for the 如图 as shown in Fig. 17D, the card transfer mode is supported; otherwise, the card is not Support for the CPT Agreement. Note that this agreement is different from the first option used to query the agreement support. The signature is responded when a CPT mode check command is issued. In step d), the host writes the original data in the cpTLBA section from the stored memory area. Note that even if the card supports the card delivery mode, this write will not be interpreted as a specific cpT command because there is no proper signature. The input/output protocol is described with reference to FIGS. 17E to 17G. To output the data to the media card, the CpTLBA is first written with the signature for output, and then the data is written based on the length of the data transfer. In order to write to the CPTLBA' host with a signature for output, a write command is sent to the media card, where the material has a CPT command format with embedded media card specific commands. The length is a section of "data transfer length" plus the CPT command format. This is shown in Figure 17E, where 1 of the bytes 32 corresponds to "data to be written to the media card," Figure 17F The actual write based on the length of the data transfer is shown, wherein how the media card processes the data depends on the media card specific command. As mentioned in Figure 17a, the "data transfer length" in this example is based on the byte. It is represented in bytes 33-35 (MSB, LMSB, LSB). However, since the read/write data is transferred in sections between the card and the picker, the incomplete section can be filled with 0 as needed. For example, in an SD card, the authentication key exchange (AKE) process uses 8 bytes for inquiry and response. Therefore, the host 116844. Doc -57- 200809593 Fill the data section with 0 04 bytes of 0 to query 1 and respond to 2 data, where the card similarly fills the query 2 and response 1 data. In order to input data from the media card, the host writes the CPTLBA with the signature for the input and then reads the data based on the length of the data transfer. Figure 17G shows a CPT command to be sent to indicate that the material will be read, where 2 of the bytes 32 correspond to "data to be read from the media card". In order to read data based on the length of the data transfer, after the host sends a read command to the media card, the number of extents to be read is [(data transfer length) / 512]. (This assumes 5 12 bytes per segment; more generally, if it is a different segment, the actual segment length will replace 512.) The starting segment is CPTLBA. Since the previous command entered a command for the CPT, the card will send the data to the host based on the media card specific command. Examples of commands that do not have input or output include "commands without data transfer,"CPT command aborts, and "CPT mode reset". Figure 17H shows "Command without data transfer" as indicated by 3 at byte 32. Figure 171 shows the "Status Read' command (indicated by 6 at byte 32), which Allows the host to read the CPT status. For example, in an SD card, the status can be implemented as a response data. This status will be the first few bytes of the read back data. Although the SD card is referenced when a specific instance is needed, 17A-171 are not limited to any particular media protocol and are not limited to a particular media command. To give an example of a particular media command, Figure 17J shows an inline command dedicated to an SD or MMC card and Figure 17L shows a dedicated fast Flash card embedded command. In Figure 17J, the command format of the SD/MMC instance is shown. Bits 0-35 116844. Doc -58- 200809593 is as described above. The SD/MMC command populates the media card specific command field. Bytes 48-53 are SD commands, such as for secure reading. Certain flags are required and defined in the media card specific flag block. BLKH indicates whether the command is for a single zone or for multiple zones: 使用 if a single zone command is used, and 丨 if multiple zone commands are used. For application commands, APPM. The response type is §1> response type depending on the command index. Each of the bytes 48_52 is the actual element of the SD command, wherein the CRC7 of the byte illusion can be set to 〇 〇 In order to obtain the response data of the SD command, the user can send a status _ to obtain a response. This is shown in Figure 17K. # The response data will be returned when the most (four) bytes of the segment are read. Figure 17L shows the Compact Flash (CF) command format for embedded commands. In this case, the commands are in bytes 48-54 and provide the elements needed to contain the CF commands. In Figure 17L, the media card specific flag (bit 2 to byte 37 of the bitstream) is reserved for additional commands specific to the various card formats. Third Exemplary Embodiment The third exemplary embodiment is implemented at a file level, as in the first exemplary embodiment: The discussion here will focus more on the details placed in the host side file. Since device-specific commands are embedded in the audit file, there is no way to compromise specific data such as files in the FAT area. From the point of view of the card, the exemplary embodiment will look similar, with the difference being more about how to load information on the host (4). When it is desired to refer to the (4) program, the third exemplary embodiment will be a secure connection to a secure bus such as the US Provisional Patent Application No. 116844 filed on December 21, 2004. Doc-59-200809593 60/638, 804, which is called illusion, is incorporated herein by reference. In the case of using the file level level of the main 1 and the private, in addition to overcoming the use of the device driver level implementation, there may be a problem of "class permissions", but also overcome the need to send specific commands. The specific needs of a particular hardware. For example, in some cases, there is a need to send a specific designation to access the security card of the SD card in the 'installer 1 driver level', but in In the case of file level implementation, because the Teng Sun & Begong is packaged in the file, it no longer exists.

需要。所以,只要可宜Λ “ ^ j冩入及碩取檔案,便可以此實施來發 送及接收任何命令集。 先刖&之κ &例為卡驅動程式實施,其操作於裝置輸入/ 輸出層級。主機或Pc應用程式與裝置或卡驅動程式之間為 作業系、洗(OS)4备案系統。第三組實施例為標案實施,其 對OS播案系統進行操作。在此等實施例中,主機僅告知槽 案系統將一檔案寫入至記憶體裝置,彡中再次内嵌裝置特 定命令。關於將檔案寫入至快閃記憶體的更多細節係描述 於白在2005年2月16日申請之美國專利申請案第11/〇6〇249 號、第11/G6G,174號及第U/_,248號中,該等案以引用的 方式全部併入本文中。儘管此等實施例可需要比裝置層級 實施例多一些的韌體額外耗用,但其可具有若干優點❶舉 例而言,在裝置層級,當開發應用程式時,需要瞭解一些 有關硬體,而藉由使用檔案系統,此變得與硬體無關並與 底部層級協定之許多細節無關。 如同裝置層級實施例一般,槽案層級實施例可用於將廠 商特定命令發送至各別廢商產品,諸如在wind〇ws 116844.doc 200809593 98/ME/95/DOS及類似實例中所建置的進階^幻程式介面 (ASPI)。在上文描述之裝置層級實施例中,使用至特定邏 輯位址(CPTLBA)之寫入。然而,在許多作業系統中,為存 取此邏輯位址需要某些存取權限。舉例而言,若使用者不 具有管理員權限,則不能夠將某SCSI命令發送至廠商產 品。因為作業系統通常允許寫入檔案,所以本發明之檔案 層級實施例藉由將特定媒體命令内嵌於檔案中、將檔案寫 入至裝置及在裝置上解除内嵌實際命令而防止權限問題的 發生。在Windows作業系統之許多版本中,使用例示性 CPTLBA之卡層級實施例將需要管理員㈣’同時寫入一檔 案將不需要任何此等特定存取權限。如前料,例示性; 施例將特定媒體命令内嵌於指令之資料部分中。 在作業系統之檔案系統層級處的實施可再次由卡之卡動 體加以實施,該卡之卡勒體經調適以遵守並識別協定。使 用至任何LBA之讀取命令/寫人命令,檢終名以判定資料 是否含有内嵌之媒體卡㈣命令。此不同於其中使用特定 位址之裝置驅動程式實施。在其他方面,> 自卡所見的, 在此#又之裝置驅動程式舞级者 Λ曰、、及κ %例與先則段之檔案系統層 級實施例之間存在报少差別。 如在先前段巾,若命令涉及任何資料傳送,則為了保持 與:令相關聯之資料’基於槽案之實施的例示性實施例將 協疋分成’’指令"部分(農中肉%女 刀匕、中内肷有特定媒體命令) 入/輸出"部分。當Α丰社仏^ 接收到協定命令時,在讀取或寫入操 作期間初體檢查特定答么 + 行疋簽名以判定給定LBA是否為指令部 116844.doc -61 - 200809593 分,此僅需要對其中簽名總内嵌於第一資料區段中之實施 例之協定命令的第-資料區段加以執行。自主機側程式員 之觀點而δ,用戶端應用程式發出簡單檔案或具有指令部 刀及(也許具有)貪料輸入/輸出部分的邏輯區段(lba)寫入 操作。若命令涉及讀取資料或寫入資料至媒體,則勃體執 ㈣輯至實體映射。_體將在自傳輸教接收到作為寫入 • 或Ί買取之物期間债測API指令部分。 φ 在例示性實施财,協定命令之指令部分將含有簽名、 查詢命令、廠商特定命令及可更新攔位。此處大小將限於 512個位元組(其為最通f使用之資料塊的大小)之倍數。圖 18A中展不例示性實施例中之指令頁的格式,其除了具有額 外細節之外極類似於圖17八。首先36個位元組未經加密,其 中剩餘部分係根據陳述經支援加密演算法之存在的加密/ 解密資訊而加密/解密。 關於圖18 A中所示之各種攔位,位元組〇及〗為用於指示一 • 可為API指令頁之候選者之LBA的簽名位元組。若此等兩個 位兀組匹配,則韌體將檢查Αρι簽名。在以下實例中,位元 組0為19,且位兀組丨為乃。Αρι簽名位於位元組2_34中且為 單一字符串。在以下實例中,將簽名視為"進階程式介面"。 位το組35為告知韌體隨後指令頁及資料頁是否經加密的 加岔/解密(E/D)資訊。若其未經加密,則應將此攔位設定為 API—ENCRYPTI⑽;否則,應將其設定為加密名稱: 使付韌體可解密及加密自位元組36開始的指令頁或多個指 令頁以及資料頁。位元組36_39為韌體操作狀態攔位 116844.doc • 62 - 200809593 (Operation Status Field)攔位且將基於操作之成功或失敗而 被更新。若一切皆好,則其將被設定為API_〇P_SUCCESS ; 否則’其將被設定為錯誤值或API一OP一NO一SUCCESS。建 議當發出命令時,將其預設值設定為〇xFFFFFFFF。在寫入 之後,調用者可讀取指令頁以驗證所請求之操作是否成 功。可將廠商識別符欄位(位元組40—43)用作唯一廠商識別 符。若韌體亦需要有效廠商ID,則此欄位可由調用環境用 以識別韌體自身。need. Therefore, as long as it is appropriate to "^ j into and master the file, you can use this implementation to send and receive any command set. The first 刖 & κ & example is the card driver implementation, which operates on the device input / output Hierarchy. The host system or the Pc application and the device or card driver are the operating system and the washing (OS) 4 filing system. The third group of embodiments is the standard implementation, which operates the OS broadcast system. In the example, the host only tells the slot system to write a file to the memory device, and the device specific command is embedded again. More details about writing the file to the flash memory are described in 2005. U.S. Patent Application Serial No. 11/6,249, No. 11/G6G, No. 174, and U.S. Serial No. U.S. Other embodiments may require additional firmware overhead than device level embodiments, but may have several advantages. For example, at the device level, when developing an application, it is necessary to understand some hardware. Using the file system, this becomes hard Irrelevant and independent of many details of the bottom level agreement. As with device level embodiments, the slot level embodiment can be used to send vendor specific commands to individual waste product products, such as at wind〇ws 116844.doc 200809593 98/ME/ The Advanced Logic Program Interface (ASPI) built in 95/DOS and similar examples. In the device level embodiment described above, writes to a specific logical address (CPTLBA) are used. However, in many jobs In the system, some access rights are required to access this logical address. For example, if the user does not have administrator rights, a SCSI command cannot be sent to the vendor's product because the operating system usually allows writing to the file. Thus, the file level embodiment of the present invention prevents permission issues by embedding specific media commands in files, writing files to devices, and unembedding actual commands on the device. Many versions of the Windows operating system In the card level embodiment using the exemplary CPTLBA, the administrator (4) will be required to simultaneously write a file without any such specific access rights. An example; the embodiment embeds a specific media command in the data portion of the instruction. The implementation at the file system level of the operating system can be implemented again by the card card body, and the card body of the card is adapted to comply with Identification protocol. Use the read/write command to any LBA to check the final name to determine if the data contains an embedded media card (4) command. This is different from the device driver in which a specific address is used. In other respects, > As seen from the card, there is a discrepancy between the device driver level dancers, and the file system level instance of the κ% instance and the first segment. The order involves any data transfer, in order to maintain the data associated with the 'order', based on the exemplary embodiment of the implementation of the slot case, the agreement is divided into ''instructions" part (Nongzhong meat% female knives, zhongzhong 肷Specific media commands) In/Out " section. When the Α丰社仏^ receives the agreement command, the initial check is performed during the read or write operation to determine whether the given LBA is the instruction part 116844.doc -61 - 200809593, this only It is necessary to perform a first-data section of an agreement command in which the signature is always embedded in the first data section. From the perspective of the host side programmer, δ, the client application issues a simple file or a logical sector (lba) write operation with a command knife and (perhaps with) a greedy input/output portion. If the order involves reading data or writing data to the media, then Bosch (4) compiles to the entity mapping. The _body will receive the debt test API command part during the self-transmission instruction as a write • or Ί buy. φ In the exemplary implementation, the command portion of the agreement order will contain signatures, query commands, vendor-specific commands, and updatable blocks. The size here will be limited to a multiple of 512 bytes, which is the size of the data block used by the most f. The format of the instruction page in the exemplary embodiment is shown in Fig. 18A, which is very similar to Fig. 17 except that it has additional details. The first 36 bytes are unencrypted, with the remainder being encrypted/decrypted based on the encryption/decryption information stating the existence of the supported encryption algorithm. With respect to the various blocks shown in Figure 18A, the byte is a signature byte used to indicate an LBA that can be a candidate for an API command page. If these two bit groups match, the firmware will check the Αρι signature. In the following example, byte 0 is 19 and the bit group is 乃. The Αρι signature is located in byte 2_34 and is a single string. In the following example, the signature is treated as a "advanced program interface". The bit το group 35 is an encryption/decryption (E/D) message that informs the firmware whether the page and the data page are subsequently encrypted. If it is not encrypted, this block should be set to API-ENCRYPTI(10); otherwise, it should be set to the encrypted name: Enable the firmware to decrypt and encrypt the instruction page or multiple instruction pages starting from byte 36 And a profile page. Byte 36_39 is the firmware operational status block 116844.doc • 62 - 200809593 (Operation Status Field) The block is updated and will be updated based on the success or failure of the operation. If everything is fine, it will be set to API_〇P_SUCCESS; otherwise it will be set to the error value or API-OP-NO-SUCCESS. It is recommended to set the preset value to 〇xFFFFFFFF when issuing a command. After writing, the caller can read the instruction page to verify that the requested operation was successful. The Vendor Identifier field (Bytes 40-43) can be used as a unique vendor identifier. If the firmware also requires a valid vendor ID, this field can be used by the calling environment to identify the firmware itself.

才曰々頁欄位(位元組44)之數目將指令頁之總數目告知韌 體其中扣令頁以5 12個位元組為邊界。類似地,資料頁欄 位(位元組45-46)之數目將附著至指令部分之資料輸入/輸 出頁的總數目告知韌體。資料頁大小不必意味著以位元組 之資料大心在某些狀況下,可能已將填充添加至資料位 元組之末端》舉例而言,DESf要以位元組之資料大小必 須為^的倍數。位S組欄位(Bytes以⑷(位核47,搁位 中之資料大小將含有效資料之資料頁中的位元組之雄數目 告知動體。在自媒體進行讀取之狀況下,此攔位應由㈣ 使用頁區域中實際處理之位元組大小加以更新。在將資料 寫入至媒體時,此為資料大小之位元組的長度。若加密資 料,騎體首先解密資料頁之全部内容且接著進行提取。、 :元组51中之位元0為資料傳送之旗標,若當前命令 資料傳送則將其設定為"〇U,且若备 則將其設定為卜 料傳送’ 位 元組51中之位元1及2為資料傳送之 方向的旗標The number of page fields (bytes 44) tells the firmware the total number of pages in the command, where the button is bounded by 5 12 bytes. Similarly, the number of data page fields (bytes 45-46) will be communicated to the firmware by the total number of data entry/output pages attached to the command portion. The data page size does not have to mean that the data in the byte group is in the strongest. In some cases, the padding may have been added to the end of the data byte. For example, the data size of the DESf to be in the byte must be ^ multiple. The S group field (Bytes is (4) (bit core 47, the size of the data in the shelf will inform the mobile number of the number of the bytes in the data page containing the valid data. In the case of reading from the media, this block The bit should be updated by (4) the size of the byte actually processed in the page area. When writing data to the media, this is the length of the byte of the data size. If the data is encrypted, the rider first decrypts the entire data page. The content is then extracted. , : The bit 0 in the tuple 51 is the flag of the data transmission. If the current command data is transmitted, it is set to "〇U, and if it is prepared, it is set as the data transmission. Bits 1 and 2 in byte 51 are the flags of the direction of data transmission

116844.doc -63- 200809593 "〇〇"指示資料傳送係對於當 Α ^ λ ^ , 之輸入而言,且韌體將 在寫入時間中處理命令 — 無效。值,指示資料傳、J寫入至媒體便將使資料頁 …… 科傳,於當前命令之輸入而言且 孝刃體將在不存在益於的堂 隹黑效的寫入時間中處理命令。值"10"指干 資料傳送係對於當前命令之 心不 p v <翰出而g。保留值” 11 "。位元 、、且51中之位x 3至位元組5 2為媒體卡特定旗標且取決於媒 體卡之類型。位几組仏㈣為將來使用而保留之搁位。116844.doc -63- 200809593 "〇〇" indicates that the data transfer is for the input of Α ^ λ ^ , and the firmware will process the command in the write time — invalid. Value, indicating data transmission, J will be written to the media will make the data page... Ke Chuan, in the input of the current command and the filial blade will process the command in the write time of the black box that does not exist . The value "10" refers to the data transmission system for the current command is not p v < The reserved value "11 ". Bits, and the bit x 3 to the byte 51 in 51 are media card specific flags and depend on the type of media card. The groups of bits (4) are reserved for future use. Bit.

一媒體卡查詢命令攔位(位元組64)將用於查詢媒體卡之* 前狀態及性能。已知支援包括:是否支援Αρι協獲得二 支援之E/D演算法;及去能Αρι協定支援。媒體卡查詢命令 傳回狀態攔位(位元組65_68)可用於保持媒體卡查詢命令之 轉回值。 媒體卡特定命令長度(位元組69及7〇)指定命令攔位所儲 存之命令位元組的總數目,其中媒體卡將執行之實際命令 在媒體卡特定命令(位元組71-5 11)中。 附加至(多個)指令頁的將為任何資料輸入/輸出頁。調用 者環境及韌體將基於所建置之密碼系統演算法而加密/解 禮内谷。在某些狀況下,不需要將資料頁寫入至媒體,在 該狀況下’勃體必須在寫入之前處理命令且接著僅將指令 頁寫入至媒體,使得使用者可讀回命令並看到操作之狀態。 圖18B至圖18F給出特定媒體查詢命令之若干實例,諸如 用於檢查在發送實際命令之前媒體卡是否支援API協定的 API協定支援之查詢。參看圖18B及圖18C而說明特定程 序。當檔案系統用於存取媒體時,將寫入一具有僅一指令 116844.doc -64- 200809593 頁之内容的檔案。圖18B及圖18C之實例將說明如何經由檔 案系統而查詢協定。 調用環境開啟一檔案(例如”myAPi.bin”)。為了查詢協定 之支援,調用者可將512個位元組(圖i8B中所示)寫入至檔 案並發出一寫入檔案命令。在發出該寫入檔案命令之後, 不笞在將枯案寫入至媒體期間或在讀取該檔案期間,媒體 皆將採取適當動作。對於該實例而言,假定在寫入之前, 媒體卡處理指令頁。在此狀況下,將採取以下動作: a) 驗證簽名位元組 b) 若匹配,則驗證API簽名 c) 若匹配,則仔細檢查(g〇 thr〇ugh)特定媒體旗標(若存 在)。 d) 檢查媒體卡查詢命令請求,其為1 e) 當不存在資料傳送時,驗證資料欄位及方向攔位為〇。 f) 處理命令、更新攔位並將檔案寫入至媒體。當使用者自 媒體讀取檔案(myAPI.file)時,調用者需要檢查兩個欄位: (1)勤體操作狀態:若成功完成命令操作,則此欄位將以 API-OP 一 SUCCESS來更新或在失敗時以某些錯誤值來更 新’且(2)僅當成功完成命令操作時才檢查媒體卡查詢命令 傳回狀態。若支援協定則以1更新該欄位,或若不支援協 定,則以0進行更新。見圖18C。 若不支援協定,或卡對於此協定支援已被去能,則此等兩 個可更新欄位將保持其初始預設值〇xFFFFFFFF。 特定媒體查詢命令之第二實例為一用以判定支援哪些加 116844.doc -65- 200809593 密/解密演算法之查詢,其中若支援API協定且在此查詢之 前該API協定為有效的,則必須檢查媒體卡。使用圖18D及 18E對此進行說明。類似於API協定之支援的查詢(參看圖 18B及18C而論述),當使用檔案型系統來存取媒體時,將寫 入具有僅一指令頁之内容的檔案。調用環境將寫入一檔案 (例如myAPLbin),以使用與上文相同之實例。 調用環境將寫入一稽案;例如myAPI.bin。為查詢有關此 命令之支援,使用者將包括如圖18D中所示之512個位元組 且發出一寫入檔案命令。假定媒體卡在寫入之前處理指令 頁,則一例示性組之動作如下: a) 驗證簽名位元組; b) 若匹配,則驗證API簽名; c) 若匹配’則仔細檢查特定媒體旗標(若存在); d) 檢查媒體卡查詢命令請求,其為2 ; e) 當不存在資料傳送時,驗證資料欄位及方向欄位為0 ;及 f) 處理命令、更新欄位並將檔案寫入至媒體。當使用者自 媒體讀取檔案myAPI.bin時,調用者將檢查兩個欄位:(1) 韌體操作狀態:若成功完成命令操作,則將以 API 一 OP—SUCCESS來更新此欄位,或若其失敗,貝1以某些 錯誤值來更新,且(2)僅當成功完成命令操作時才將檢查媒 體卡查詢命令傳回狀態。此攔位將傳回32位元之整數,其 中〇意味著無加密/解密演算法被支援。否則將設定每一預 定加密/解密演算法之每一位元。舉例而言,假定DES在位 元1中,3DES在位元3中且AES在位元32中,貝ij轉回值應為: 116844.doc -66- 200809593 MSB 10000000 000〇〇〇〇〇 〇〇〇〇〇〇〇〇 0〇〇〇1〇1〇 Lsb 圖18E中展示該結果。注意,在例示性實施例中,演算法之 最大數目為32。基於轉回值,可判定經支援之E/D演算法的 類型,使得可耩由在位元組3 5中設定相同預定演算法名稱 而加密指令頁(自位元組36開始)及資料頁。注意:位元組乃 應在任何給定時間具有僅一位元設定。若設定超過i位元, 則其將失敗。 特定媒體查詢命令之另一實例為一用以判定媒體卡是否 支援API協定且若支援則去能該Αρι協定的查詢。類似於用 以判定支援哪些加密/解密演算法之查詢,將開啟一檔案, 其中該檔案之内容將具有僅一指令頁。調用環境將開啟一 檔案,例如再次開啟myAPI.bin。為查詢此命令之支援,使 用者可在一檔案中包括圖18F中所示之512個位元組且發出 一寫入檔案命令。 在寫入檔案之後,使用者可讀取攔位並藉由首先以下檢 查而驗證是否成功完成操作:(1)韌體操作狀態··若成功完 成命令操作,則將以0來更新此攔位,或若其失敗,則以j 來更新,且(2)僅當成功完成命令操作時,才將檢查媒體卡 查”旬印令傳回狀態。若去能協定則其將為〗,或若失敗,則 其將為0。 圖18G及18H展示基於檔案系統之特定媒體讀取命令及 寫入命令的特定實例。在將韌體命令發出至媒體卡之前, 檢查該卡以察看其是否支援Αρι協定。如同先前協定,若將 祂案系統用於存取媒體,則將開啟一具有一或多個指令頁 116844.doc -67 - 200809593 及任何相關聯資粗百β _ 貝料頁之内容的檔案。圖丨8G中展示特定媒體 寫入命令之實例。 更八體σ之,假定調用者希望發出一命令(例如,SD卡命 7木中之D5 )以獲得資料頁並將其寫人至某隱藏區域。調 用晨境將開啟-槽案且使用者將預備如圖! 中所示之資 料頁。位兀組00-34如同圖18A至圖18F一般,其中此實例中 之指令的位7G組35指示無加密正被使用。位元組36_39再次 才曰示韌體之操作狀瘧,其中斜體字(此處斜體字與前述斜體 子)指不攔位為韌體可更新的,且廠商或媒體識別符(該實例 將廠商識別符用作”SNDK”)位於位元組4〇_43中。内嵌命令 接者將專用於此媒體/薇商。位元組44_5〇指示指令頁之數目 (此處僅所示之頁(NIP喝)、資料頁之數目(在實例中亦為一 (NDP=1))及指定為位元組數目之資料大小(此處用作區段 之512個位兀組(〇816 = 512))。指令之位元組51-68視特定命 令之需要而提供先前描述之指令資訊。 實際内嵌命令之長度(以位元組)係以位元組69_7〇而指 疋,其在此狀況下為含有指示至保留區域或安全區域之寫 入的例不性"D5”指令之單一位元組71。接著以零來填充配 置用於特定媒體指令的剩餘區域(位元組72_511)從而形成 π整區段。實際特定命令之資料的(此處)512個位元組係作 為下一區段。 在圖18G中,注意:資料欄位(DATA=1)指示此指令含有 輸入且方向欄位(Direction=〇〇)告知勃體處理資料並將頁 寫入至媒體。由於檔案系統會將資料頁寫入至媒體(如由檔 116844.doc • 68 _ 200809593 案系統所見的1024個位元組,首先5 12個位元級用於内嵌命 令),因此韌體將視需要以0或FF來填充資料頁。 調用者可藉由自媒體卡讀取檔案及檢查韌體操作狀態攔 位而驗證操作是否已成功。若已成功完成操作,則將以 API-OP-SUCCESS來更新此攔位,或若不成功,則將以某 些錯誤值或API-OP—NO 一 SUCCESS對其進行更新。注意: 由於方向為00,所以資料頁應為〇或FF。 假疋在寫入之别媒體卡處理指令頁’則一例示性組之動 作如下: a) 驗證簽名位元組; b) 若簽名匹配,則驗證API簽名; c) 檢查指令頁(來自位元組36)是否被加密; d) 若被加密’則解密指令頁(來自位元組36)及資料頁; e) 驗證廠商ID簽名; f) 若廠商ID匹配,則仔細檢查特定媒體旗標(若存在); g) 檢查方向及資料攔位; h) 處理實際内嵌特定媒體命令;及 1)更新指令頁之韌體操作狀態欄位,加密(若請求)在位元 組36之後的指令頁,且將其寫入至媒體。由於方向為〇〇, 所以視需要將資料頁寫為〇或FF。 了以若干方式實施特定媒體讀取命令,以下段中對某些 該等方式進行更多地論述。參看圖18H描述基於檔案系統之 特定媒體碩取命令的實施,其之結構類似於圖丨8g之寫入結 構〇 116844.doc 200809593 在正自媒體讀取特定媒體命令時,該特定媒體命令現為 D6且方向為10。另外,可靈活地基於使用何命令及建置之 協疋而修改内谷。舉例而言,可告知卡寫入此檔案且該檔 案/、有用以口知朝體在寫入之前加密内容的特定命令。因 此’所寫入之内|在寫入之前可轉換成另一形式。上述情 形亦同樣適用於讀取操作。 圖18H展示其中調用者希望發出-命令(例如,SD卡命令A media card query command block (bytes 64) will be used to query the status and performance of the media card. Known support includes: support for E/D algorithms that support ι ι 协, and support for support. Media Card Query Command The Return Status Bar (Bytes 65_68) can be used to maintain the rollback value of the Media Card Query command. The media card specific command length (bytes 69 and 7) specifies the total number of command bytes stored in the command block, where the media card will execute the actual command on the media card specific command (bytes 71-5 11 )in. The page attached to the (multiple) instruction page will be any data input/output page. The caller environment and firmware will be encrypted/resolved based on the built-in cryptosystem algorithm. In some cases, there is no need to write a data page to the media, in which case the body must process the command before writing and then only write the command page to the media so that the user can read back the command and see To the state of operation. Figures 18B through 18F show several examples of specific media query commands, such as queries for checking API protocol support for whether the media card supports API protocols before the actual command is sent. A specific procedure will be described with reference to Figs. 18B and 18C. When the file system is used to access the media, an archive with only one instruction 116844.doc -64 - 200809593 is written. The examples of Figures 18B and 18C illustrate how the protocol can be queried via the file system. The calling environment opens a file (eg "myAPi.bin"). In order to query the support of the protocol, the caller can write 512 bytes (shown in Figure i8B) to the file and issue a write file command. After issuing the write file command, the media will take appropriate action during the writing of the file to the media or during the reading of the file. For this example, it is assumed that the media card processes the instruction page before writing. In this case, the following actions will be taken: a) Verify the signature byte b) If it matches, verify the API signature c) If it matches, double check (g〇 thr〇ugh) the specific media flag (if it exists). d) Check the media card inquiry command request, which is 1 e) When there is no data transmission, the verification data field and direction block are 〇. f) Process the command, update the block and write the file to the media. When the user reads the file (myAPI.file) from the media, the caller needs to check two fields: (1) Operational status: If the command operation is successfully completed, the field will be API-OP-SUCCESS. Update or update with some error value on failure 'and (2) Check the media card query command return status only when the command operation is successfully completed. If the support agreement is updated, the field is updated by 1 or if the agreement is not supported, it is updated with 0. See Figure 18C. If the agreement is not supported, or if the card has been disabled for this agreement, then these two updateable fields will retain their initial presets 〇xFFFFFFFF. A second example of a particular media query command is a query to determine which of the 116844.doc -65-200809593 secret/decryption algorithms are supported, wherein if the API agreement is supported and the API agreement is valid prior to the query, then Check the media card. This will be explained using Figs. 18D and 18E. Similar to the API-supported queries (discussed with reference to Figures 18B and 18C), when a file-type system is used to access media, an archive having only one instruction page content is written. The calling environment will write to a file (eg myAPLbin) to use the same instance as above. The calling environment will be written to a file; for example, myAPI.bin. To query support for this command, the user will include 512 bytes as shown in Figure 18D and issue a write file command. Assuming that the media card processes the instruction page before writing, the action of an exemplary group is as follows: a) verify the signature byte; b) verify the API signature if it matches, c) check the specific media flag if it matches ' (if present); d) Check the media card query command request, which is 2; e) When there is no data transfer, the verification data field and direction field are 0; and f) process the command, update the field and archive Write to the media. When the user reads the file myAPI.bin from the media, the caller will check two fields: (1) firmware operation status: if the command operation is successfully completed, the field will be updated with API-OP-SUCCESS. Or if it fails, Bay 1 is updated with some error value, and (2) The Check Media Card Query command is returned to the state only when the command operation is successfully completed. This block will return a 32-bit integer, which means no encryption/decryption algorithm is supported. Otherwise each bit of each predetermined encryption/decryption algorithm will be set. For example, suppose DES is in bit 1, 3DES is in bit 3 and AES is in bit 32, and the value of ij back should be: 116844.doc -66- 200809593 MSB 10000000 000〇〇〇〇〇〇 〇〇〇〇〇〇〇0〇〇〇1〇1〇Lsb This result is shown in Figure 18E. Note that in the exemplary embodiment, the maximum number of algorithms is 32. Based on the rollback value, the type of supported E/D algorithm can be determined such that the instruction page (starting from byte 36) and the data page can be encrypted by setting the same predetermined algorithm name in byte 35. . Note: A byte should have only one bit set at any given time. If it is set to exceed i bits, it will fail. Another example of a particular media query command is a query that determines if the media card supports the API protocol and, if so, can negotiate the agreement. Similar to the query used to determine which encryption/decryption algorithms are supported, a file will be opened in which the contents of the file will have only one page of instructions. The calling environment will open a file, such as turning on myAPI.bin again. To query the support of this command, the user can include the 512 bytes shown in Figure 18F in a file and issue a write file command. After writing the file, the user can read the block and verify whether the operation is successfully completed by first checking: (1) firmware operation status. · If the command operation is successfully completed, the block will be updated with 0. , or if it fails, it is updated with j, and (2) the media card check will be checked back to the state only if the command operation is successfully completed. If it can be agreed, it will be 〗, or If it fails, it will be 0. Figures 18G and 18H show specific examples of specific media read commands and write commands based on the file system. Before issuing the firmware command to the media card, check the card to see if it supports Αρι Agreement. As previously agreed, if the system of the case is used to access the media, then a content with one or more pages 116844.doc -67 - 200809593 and any associated joint rough beta _ bedding pages will be opened. Archive. Figure 8G shows an example of a specific media write command. More sigma, suppose the caller wants to issue a command (for example, D5 in SD card life) to get the data page and write it to a hidden area. Calling the morning The slot is opened and the user will prepare the profile as shown in Figure! The bits 00-34 are as in Figures 18A-18F, where the bit 7G group 35 of the instruction in this example indicates that no encryption is being used. The byte 36_39 again shows the operational malaria of the firmware, where the italicized words (the italicized font and the oblique body above) refer to the non-blocking firmware updateable, and the manufacturer or media identifier ( This example uses the vendor identifier as "SNDK") in the byte 4〇_43. The inline commander will be dedicated to this media/wei. The byte 44_5〇 indicates the number of command pages (here only The page shown (NIP drink), the number of data pages (also in the example (NDP=1)) and the size of the data specified as the number of bytes (here used as the 512-bit group of the segment ( 〇 816 = 512)). The bytes of the instruction 51-68 provide the previously described instruction information as needed for the particular command. The length of the actual embedded command (in bytes) is indicated by the byte 69_7〇 , in this case, a single bit containing an example of a caseless "D5" instruction indicating a write to a reserved area or a secure area 71. The remaining area (bytes 72_511) configured for the particular media instruction is then padded with zeros to form a π-segment. The (here) 512-bits of the actual command-specific data are used as the next section. In Figure 18G, note that the data field (DATA=1) indicates that the command contains an input and the direction field (Direction=〇〇) tells the body to process the data and write the page to the media. Since the file system will have the data The page is written to the media (such as the 1024 bytes seen by the file 116844.doc • 68 _ 200809593 system, first 5 12 bits for the embedded command), so the firmware will be 0 or FF as needed To populate the data page. The caller can verify that the operation was successful by reading the file from the media card and checking the firmware operation status check. If the operation has been successfully completed, the block will be updated with API-OP-SUCCESS or, if unsuccessful, it will be updated with some error value or API-OP-NO-SUCCESS. Note: Since the direction is 00, the data page should be 〇 or FF. The hypothesis is written in the media card processing instruction page', and the action of the exemplary group is as follows: a) verify the signature byte; b) verify the API signature if the signature matches; c) check the instruction page (from the bit Group 36) is encrypted; d) if encrypted 'recrypts the instruction page (from byte 36) and the data page; e) verifies the vendor ID signature; f) carefully checks the specific media flag if the vendor ID matches ( g) check direction and data block; h) process the actual embedded specific media command; and 1) update the firmware operation status field of the command page, encrypt (if requested) the instruction after byte 36 Page and write it to the media. Since the direction is 〇〇, the data page is written as 〇 or FF as needed. Specific media read commands are implemented in a number of ways, some of which are discussed in more detail in the following paragraphs. Referring to FIG. 18H, an implementation of a specific media master command based on a file system is described, which is similar in structure to the write structure of FIG. 8g. 116844.doc 200809593. When a specific media command is being read from the media, the specific media command is D6 and the direction is 10. In addition, you can flexibly modify the inner valley based on the commands used and the associations you build. For example, the card can be informed to write to the file and the file/, a specific command that is useful to encrypt the content prior to writing. Therefore, the 'written in' can be converted to another form before writing. The same applies to the read operation. Figure 18H shows where the caller wishes to issue a - command (for example, an SD card command)

集中之D6 )以自隱藏區域讀取一資料區段並將其置放於 貪料頁之下的狀況。調用環境將開啟—檔案且使用者將預 備如圖18H中所不之資料頁,其中再次將廠商識別符用作 ,,SNDKn 〇 資料棚位指*此為"輸Π吏得資料頁將被更新且方向 攔位告知韋刃體在讀取期間處理資料。勃體之另一可能性為 處理命令、更新資料頁並將其寫入至媒體。因A,韌體會 將1〇24個位元組寫入至媒體。當動體讀取檔案時,其將摘 測到此為心令頁’接著其將讀取命令並適當地更新資料攔 位。则者可藉由自媒體卡讀取檔㈣驗證操作是否已成 功〜旦頃取檔案,調用者便可檢查韌體操作狀態欄位。 若印7 一致成功完成之操作,則將以Αρι 一 〇p—succEss來 更新此攔位,若未成功,則將以諸如 之某些錯誤值對其進行更新。亦可藉由檢查腦關位來驗 證資料讀取之數量從而察看是否其已經更新為512。 儘官已參考特定實施例描述了本發明之各種態樣,但將 瞭解,本發明係保護於附加申請專利範圍之全部範疇内。 116844.doc 200809593 【圖式簡單說明】 圖1為主機-卡系統之示意性表示。 圖2為主機-卡系統之方塊圖。 圖3為其中使用讀取器或硬體配接器而使卡與另一主機 通信之系統的方塊圖。 圖4為在圖3系統中傳送資料及命令之先前技術的示意性 表示。 圖5展示可如何根據本發明之例示性實施例内嵌特定應 用程式命令。 '' 圖6為展示韌體層之關係的例示性結構之方塊圖。 圖7為裝置驅動程式層之示意性表示。 圖8展示回應於分割狀態命令而含有的資訊。 圖9展示自變數資料區段之例示性格式。 圖10A、10B-1及10B-2展示主機側通信流程。 圖11A至11C說明主機應用程式-裝置應用程式協定。 圖12為隱藏分割應用程式之命令的狀態機圖。 圖13A至13D展示在隱藏分割協定中之一組命令的處理 流程。 圖14為圖4之簡化版本。 圖15為根據本發明之態樣用於在圖3之系統中傳送資料 及命令的技術之示意性表示。 圖16提供根據特定實施例之圖15之細節。 圖17 A至17L給出對於若干命令的圖16之實施例之結構 的詳細說明。 116844.doc -71- 200809593 圖18A至18H類似於檔案層級實施例之圖17A至17L。 【主要元件符號說明】Concentrated D6) reads a data section from the hidden area and places it under the greedy page. The calling environment will open the file and the user will prepare the data page as shown in Figure 18H, where the vendor identifier will be used again, and the SNDKn 〇 data shed will be *this is the " The update and direction block tells Wei blade that the data is processed during the reading. Another possibility for Bodhidharma is to process commands, update material pages, and write them to the media. Because of A, the firmware will write 1 to 24 bytes to the media. When the mobile reads the file, it will extract this as the heartbeat page' and then it will read the command and update the data block appropriately. Then, by reading the file from the media card (4) to verify whether the operation has been successful, the caller can check the firmware operation status field. If the print 7 successfully completes the operation, the block will be updated with Αρι 〇p-succEss, and if it is not successful, it will be updated with some error values such as some. The number of data reads can also be verified by examining the brain level to see if it has been updated to 512. Various aspects of the invention have been described with reference to the specific embodiments thereof, but it is understood that the invention is in the scope of the appended claims. 116844.doc 200809593 [Simple Description of the Drawings] Figure 1 is a schematic representation of a host-card system. Figure 2 is a block diagram of a host-card system. Figure 3 is a block diagram of a system in which a card or hardware adapter is used to communicate a card to another host. 4 is a schematic representation of the prior art of transmitting data and commands in the system of FIG. Figure 5 shows how a particular application command can be embedded in accordance with an illustrative embodiment of the present invention. '' Figure 6 is a block diagram showing an exemplary structure of the relationship of the firmware layers. Figure 7 is a schematic representation of the device driver layer. Figure 8 shows the information contained in response to the split state command. Figure 9 shows an exemplary format of an argument data section. 10A, 10B-1 and 10B-2 show the host side communication flow. Figures 11A through 11C illustrate a host application-device application agreement. Figure 12 is a state machine diagram of the command to hide the split application. Figures 13A through 13D show the processing flow of a group of commands in a hidden partitioning agreement. Figure 14 is a simplified version of Figure 4. Figure 15 is a schematic representation of a technique for transmitting data and commands in the system of Figure 3 in accordance with aspects of the present invention. Figure 16 provides details of Figure 15 in accordance with a particular embodiment. Figures 17A through 17L show a detailed description of the structure of the embodiment of Figure 16 for a number of commands. 116844.doc -71- 200809593 Figures 18A through 18H are similar to Figures 17A through 17L of the file level embodiment. [Main component symbol description]

101 卡 105 韌體 151 主機 153 槽 201 、 203 指令 331 讀取器 333 插座 335 韌體 351 PC 401 命令 403 USB包裝 405 命令 510 指令 511 命令部分 513a 資料部分之第一部分 513b 資料部分之第二部分 530 實際指令 531 命令部分 533 資料部分 601 命令 1001 卡/裝置 1011 記憶體 116844.doc -72- 200809593 1021 FE層 1023 裝置應用程式 1025 媒體層 1027 BE層 1051 主機 1053 主機應用程式 1055 裝置驅動程式 1057 檔案系統 1059 裝置應用程式層 116844.doc -73-101 card 105 firmware 151 host 153 slot 201, 203 command 331 reader 333 socket 335 firmware 351 PC 401 command 403 USB package 405 command 510 instruction 511 command part 513a first part of the data part 513b second part of the data part 530 Actual command 531 Command part 533 Data part 601 Command 1001 Card/device 1011 Memory 116844.doc -72- 200809593 1021 FE layer 1023 Device application 1025 Media layer 1027 BE layer 1051 Host 1053 Host application 1055 Device driver 1057 File system 1059 device application layer 116844.doc -73-

Claims (1)

200809593 十、申請專利範圍: 1 · 一種操作一系統之方法,兮会处— 凌該糸統包含一記憶卡及一可與 該卡父換資料及命令之jrA,甘ju 卩7之主機,其中在該主機與該卡之間 的該資料及命令交換在傳輸過程中之某階段使用一第一 協:中之一第一命令集且其中該主機及該卡包括-使用 -第二協定中之一第二命令集的應用程式,該方法包含·· —將:來自該第二命令集之命令内嵌於一來自該第一協 定之第-指令中,該命令不具有在該第—命令集中之一 相應命令; 將該第-指令自該主機傳輸至該記憶卡;及 在該卡中提取該内嵌命令。 2. 如請求項1之方法,其中使用一第二協定中之-第二命令 集的該應用程式為複數個應用程式中之一者且該第二協 定為,數個相應第二協定中之各別的第二協^,且其中 可同時操作該複數個刺程式中的多個應用程式。 3. 如請求们之方法,其中由該主機在檀案系統層級實施該 内嵌。 、,月求項3之方法,其中該命令係用於將資料自該主機傳 达至該卡,該資料係置放於一對應於該第一指令之檔案 的一貧料部分中,該方法進—步包含判定該卡上之一足 以在分段之情況下容納該檔案之邏輯位址。 5·如請求項1之方法,其進一步包含: Α Λ中々疋否係用於將資料自該卡傳送至該主機; 回應於判定該命令係用於將資料自該卡傳送至該主 116844.doc 200809593 機,設定-用於該傳送之旗標; 自該卡傳送與該命令相關聯之資料。 6·如明求項5之方法,其中該經傳送之資料小盥 關聯之全部資料。 、之貝枓>於與該命令相 7·如:求項5之方法,其進一步包含: %、於 苐二命令而自該卡重新傳 的該資料。 新傳运與該命令相關聯 8 ·如請求項1夕士 該内锬其中由該主機在卡驅動程式層級實施 9. Γ1Γ之方法’其中該系統進-步包含-硬體配接 等二機與該卡經由該硬體配接器而交換該資料及該 ’其中該主機與該硬體配接器藉由該第一協定而 :::且其中該將該第-指令自該主機傳輸至該記憶卡 將該第一指令自該主機傳輸至該硬體配接器; 在該硬體配接器中將該第一指令轉譯為該第二協定中 之一相應指令;及 將该相應指令自該硬體配接器傳輸至該記憶卡。 1〇·如凊求項1之方法,其中來自該第一協定之該指令包含一 =括一來自該第-協定之命令的命令部分及_資料部 分’其中該内嵌命令係内嵌於該資料部分中。 11·如請求項1〇之方法,其中該資料部分進一步包括鱼該内 嵌命令相關聯之資料。 入 12·如請求項11之方法,該方法進—步包含判定包括於該賓 116844.doc 200809593 料邛分中之與該内嵌命令相關聯的該資料是否為與該内 嵌命令相關聯之全部資料。 3 ·如月求員12之方法,該方法進一步包含,回應於判定包 括於該貝料邛分中之與該内嵌命令相關聯的該資料並非 與該内敗命令相關聯的全部資料,設定一旗標以用於與 該内嵌命令相關聯之額外資料之接收。 ’、 14·如明求項1〇之方法,其中該在該卡中提取該内喪命令包 含: 判定該資料部分包括一簽名;及 回應於確認該指令中之該簽名而自該資料部分提取該 内嵌命令。 15. 如明求項10之方法,其中該相應指令包含一包括一來自 :第二協定之命令的命令部分及一資料部分,其中該内 肷印令係内嵌於該資料部分中。 16.200809593 X. The scope of application for patents: 1 · A method of operating a system, at the meeting place - Ling's system contains a memory card and a host that can exchange information and commands with the card parent, jrA, Ganju 卩7, among which The data and command exchange between the host and the card uses a first command set in a first phase of the transmission process and wherein the host and the card include-use-second agreement a second command set application, the method comprising: embedding: a command from the second command set embedded in a first instruction from the first agreement, the command not having the first command set a corresponding command; transmitting the first instruction from the host to the memory card; and extracting the embedded command in the card. 2. The method of claim 1, wherein the application using the second command set in the second protocol is one of a plurality of applications and the second agreement is in a plurality of corresponding second agreements Each of the plurality of second programs, and wherein the plurality of applications of the plurality of thorn programs are simultaneously operated. 3. As in the method of the requester, the host implements the embedding at the level of the system. The method of claim 3, wherein the command is for transmitting data from the host to the card, the data being placed in a poor portion corresponding to the file of the first instruction, the method The step-by-step includes determining that one of the cards is sufficient to accommodate the logical address of the file in the case of a segment. 5. The method of claim 1, further comprising: Α Λ 々疋 is used to transfer data from the card to the host; in response to determining that the command is for transmitting data from the card to the primary 116844. Doc 200809593 Machine, set - the flag used for this transfer; the data associated with the command is transmitted from the card. 6. The method of claim 5, wherein the transmitted data is less than all of the information associated with the data. And the method of claim 5, wherein the method of claim 5 further comprises: %, the data re-transmitted from the card in the second command. The new transport is associated with the command. 8. If the request item 1 ‧ 锬 锬 锬 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 由 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 其中 其中Exchanging the data with the card via the hardware adapter and wherein the host and the hardware adapter are by the first agreement: and wherein the first command is transmitted from the host to Transmitting, by the memory card, the first instruction from the host to the hardware adapter; translating the first instruction into a corresponding one of the second protocols in the hardware adapter; and the corresponding instruction Transfer from the hardware adapter to the memory card. 1. The method of claim 1, wherein the instruction from the first agreement includes a command portion including a command from the first agreement and a data portion, wherein the embedded command is embedded in the command In the data section. 11. The method of claim 1, wherein the data portion further comprises data associated with the fish embedded command. 12. The method of claim 11, the method further comprising determining whether the material associated with the embedded command included in the object 116844.doc 200809593 is associated with the embedded command All information. 3. The method of claim 12, the method further comprising, in response to determining that the material associated with the embedded command included in the bedding component is not all data associated with the internal defeat command, setting one The flag is used for the receipt of additional material associated with the embedded command. The method of claim 1, wherein the extracting the internal command in the card comprises: determining that the data portion includes a signature; and extracting from the data portion in response to confirming the signature in the instruction The inline command. 15. The method of claim 10, wherein the corresponding instruction comprises a command portion including a command from the second agreement and a data portion, wherein the internal print order is embedded in the data portion. 16. 如睛求項1之方法,其中來自該第一協定之該命令係至一 預定邏輯位址。 月求項16之方法,其進一步包含,在該卡中接收該經 傳輸相應指令之後並在該卡中提取該内嵌命令之前: 判定該相應命令係至該預定邏輯位址;及 回應於該判定該相應命令係至該預定邏輯位址,確認 該指令中之, 食名’其中回應於確認該簽名而提取該内 嵌命令。 求項17之方法’其中該判定該相應命令係至該預定 迷輯位址、該確認該指令中之一簽名及該提取該内嵌命 116844.doc 200809593 令係由該卡之韌體加以執行。 19·如凊求们之方法,其進—步包含執行該内敌命令。 2〇·如::求項1之方法’其中該第二協定為一 SD協定。 求員2〇之方法,其中該内嵌命令為一安全資料存取。 22. 如請求項1之古生 社a ^ 、 ^ 、 法,中該第二協定為一 MMC協定。 23. 如清未項1之方法,其中該第二協定為-ΑΤΑ協定。 J求項1之方法’其中該第-協定為- SCSI協定。 月长項1之方法,其中該命令係用於在該主機與該卡之 ㈣送資料’其巾織料未快取於該主機中。 26. 種操作一系統之方法,該系統包含一記憶卡及一可斑 該:交換資料及命令之主機,其中該主機與該 : 該貝料及命令交換在傳輸過程中之某階段使用一第一協 ::之-第一命令集,且其中該主機及該卡包括 -弟一協定中之—第二命令集的應用程式,該方法包八 將-來自該第二命令集之命令及一簽名内嵌3 . 該第-協定之第一指令中,其中該第一指令包括―合: 部分及-資料部分,且其中料名及來自該第二命2 之該命令係内嵌於該資料部分中; 7市 將該第-指令自該主機傳輪至該記憶卡; 判定該第-指令之該資料部分是否含有該簽名;及 回應於該第一指令含有該簽名,自該第一指令之 料部分提取來自該第二命令集的該命令。 〜賁 27. 如請求項26之方法,其中使用一第二協定中之一第二八 令集的s亥應用程式為複數個應用程式中之一者且診第咔 116844.doc -4- 200809593 協定為複數個相應第二協定中之各別第二協定,且其中 可同時操作該複數個應用程式中的多個應用程式。 如明求項26之方法’其中該資料部分亦包括與來自該第 一中令集之該命令相關聯的資料。 π求項28之方法,該方法進一步包含判定包括於該資 料=刀中之與來自該第二命令集之該命令相關聯的該資 枓是否為與來自該第二命令集之該命令相關聯的全部資 料0The method of claim 1, wherein the command from the first agreement is to a predetermined logical address. The method of claim 16, further comprising: after receiving the corresponding instruction transmitted in the card and extracting the embedded command in the card: determining that the corresponding command is to the predetermined logical address; and responding to the Determining that the corresponding command is to the predetermined logical address, confirming the food name in the instruction, wherein the embedded command is extracted in response to confirming the signature. The method of claim 17, wherein the determining that the corresponding command is to the predetermined ambiguous address, the confirming one of the signatures of the instruction, and the extracting the embedded life 116844.doc 200809593 is performed by the firmware of the card . 19. If the method of begging is requested, the further step involves executing the internal enemy command. 2〇·如:: Method of claim 1 wherein the second agreement is an SD agreement. A method of requesting a user, wherein the embedded command is a secure data access. 22. In the case of the ancient government of a request for a ^, ^, law, the second agreement is an MMC agreement. 23. The method of claim 1, wherein the second agreement is a -ΑΤΑ agreement. J. The method of claim 1 wherein the first agreement is a SCSI protocol. The method of the term 1 of the month, wherein the command is used to send data to the host and the card (4), and the towel woven material is not cached in the host. 26. A method of operating a system, the system comprising a memory card and a host for exchanging data and commands, wherein the host and the: the beaker and the command exchange use a first stage at a certain stage of the transmission process The first command set, and wherein the host and the card include an application of the second command set in the protocol, the method includes eight commands - a command from the second command set and a signature Embedded in the first instruction of the first-agreement, wherein the first instruction includes a "combination" portion and a data portion, and wherein the material name and the command from the second life 2 are embedded in the data portion 7; the city transmits the first instruction from the host to the memory card; determines whether the data portion of the first instruction contains the signature; and responds to the first instruction containing the signature, from the first instruction The material portion extracts the command from the second command set. ~贲27. The method of claim 26, wherein one of the second eight sets of the second agreement is used as one of the plurality of applications and the diagnosis is 咔116844.doc -4- 200809593 The agreement is a second of the plurality of respective second agreements, and wherein the plurality of applications of the plurality of applications can be simultaneously operated. The method of claim 26 wherein the portion of the data also includes information associated with the order from the first set of orders. The method of claim 28, the method further comprising determining whether the asset associated with the command from the second command set included in the data=knife is associated with the command from the second command set All information 0 30.如請求項29之方法,該方法進—步包含,喊於判定包 括於該資料部分中之與來自該第二命令集之該命令相關 聯的該貧料並非與來自該第二命令集之該命令相關聯的 全部資料’設定-旗標以用於與來自該第二命令集之該 命令相關聯的額外資料之接收。 31·如請求項26之方法,其進一步包含: 判定該命令是否係用於將資料自該卡傳送至該主機; 回應於判定該命令係用於將資料自該卡傳送至該主 機,設定一用於該傳送之旗標,· 32. 自該卡傳送與該命令相關聯之資料。 如請求項31之方法, 相關聯之全部資料。 其中該經傳送之資料少於與該命令 33·如請求項31之方法’其進一步包含: 之=:第二命令而自該卡重新傳送與該命令相關聯 34·如請求項26之方法 其中該第一指令為一寫入。 116844.doc 200809593 35·如請求項26之方法,其中來自該第二命令集之該命令為 一讀取。 36. 如請求項26之方法,其中該簽名包含於該資料部分之— 預定區段中。 37. 如請求項26之方法’其中該指令係用以存取在一第 邏 輯位址 輯位址處^資料’且其中該判定該指令之該資料部分是 否3有|名係回應於該第一邏輯位址對應於一預定 38·如請求項26之方法,甘士丄斗4 μ 八中由該主機在該檔案驅動程式屑 級實施該内嵌。 9 39·如:求項38之方法,其中該命令係用於將資料自該主機 傳运^該卡,該資料置放於—對應於該第—指令之 的一貢料部分中,兮古、土、仓 JK > , 、 甲該方法進一步包含判定該卡上之一足 以在分段之情況下容納該檔案之邏輯位址。 實二::二之方去,其中由該主機在該卡驅動程式層級 41.如請求項26之方法,其中該系統進—步包含—硬體配接 器丄該主機與該卡經由該硬體配接器而交換該資料及該 等命令’其中該主機及該硬體配接器藉 通信:且其中該將該第-指令自該主機傳輸至該IS 包含· 將該第一指令自該主機傳輸至該硬體配接器; 在該硬體配接器中將該第-指令轉譯為該第’二協定中 之一相應指令;及 116844.doc 200809593 將該相應指令自該硬體配接器傳輸至該記憶卡。 42. 如請求項26之方法,其中來自該第一協定之該指令包含 一包括一來自該第一協定之命令的命令部分及一資料部 分,其中該内嵌命令係内嵌於該資料部分中。 43. 如請求項26之方法,其中來自該第一協定之該命令係至 、一預定邏輯位址。 : 44·如請求項26之方法,其進一步包含執行該内後命令。 45,如請求項26之方法,其中該第二協定為一 SD協定。 ⑩ 46.如請求項45之方法,其中該内嵌命令為一安全資料存取。 47.如請求項26之方法,其中該第二協定為一 MMC協定。 48·如請求項26之方法,其中該第二協定為一 ΑΤΑ協定。 49.如請求項26之方法,其中該第一協定為一 SCSI協定。 50·如請求項26之方法,其中該命令係用於在該主機與該卡 之間傳送資料,其中該資料未快取於該主機中。 5 1. —種操作一非揮發性記憶卡之方法,其包含: 0 接收一指令,其中該指令包括一命令部分及一資料部 分; 判定該指令之該資料部分是否含有一簽名;及 二 回應於該指令含有該簽名而自該指令之該資料部分提 • 取一命令。 52·如請求項51之方法,其進一步包含: 判定該命令是否係用於自該卡傳送資料; 回應於判定該命令係用於自該卡傳送資料,設定一用 於該傳送之旗標; 116844.doc 200809593 自該卡傳送與該命令相關聯的資料。 53·如請求項52之方法,其中該經傳送之資料少於與該命令 相關聯的全部資料。 P 7 54·如請求項53之方法,其進一步包含: 回應於一第 的該資料。 二命令而自該卡重新傳送與該命令相關聯 55·如請求項51之方法’其中該資料部分進一步包括與該經 提取命令相關聯之資料。 二 56. 如,求項55之方法,該方法進一步包含判定包括於該資 料部分中之與該經提取命令相關聯的該資料是否為與該 經提取命令相關聯之全部資料。 η Μ 57. 如請求項56之方法’該方法進一步包含,回應於判定包 括於該資料部分中之與該經提取命令相關聯的該資料並 非與該經提取命令相關聯之全部資料,設定一旗標以用 於與該經提取命令相關聯之額外資料之接收。 58. 如請求項51之方法,其中該㈣包含於該資料部分之一 預定區段中。 59·如請求項51之方法,苴由 屯兵中該指令係在一具有一第一命令 集之第協疋中’且其中該經提取之命令係來自一第二 協定中之一第二命令集且不具有在該第-命令集中的一 相應命令。 60·如請求項59之方法,甘士斗# 、 ,、中該弟二協定用於複數個應用程 式中之者且該第二協定為複數個相應應用程式協定中 之各別應用程式協定,Β甘+ _ μ 士作仏 、肠疋,且其中可同時操作該複數個應用 116844.doc 200809593 程式中的多個應用程式。 如月求員5 1之方法,其中該指令係用以存取在一第 邏 輯位址:之貝料且其中該判定該指令之該資料部分是否 含有一簽名係回應於該第—邏輯位址對應於-預定邏輯 位址。 62. ^請求項51之方法,其中該判定該指令含有—簽名及該 提取-來自該指令之該資料部分之命令係由該卡之拿刃體 來執行。30. The method of claim 29, the method further comprising, shouting that the poor material associated with the command from the second command set included in the data portion is not from the second command set All of the data associated with the command is set-flagged for receipt of additional material associated with the command from the second set of commands. 31. The method of claim 26, further comprising: determining whether the command is for transmitting data from the card to the host; in response to determining that the command is for transmitting data from the card to the host, setting one The flag used for the transmission, · 32. The material associated with the order is transmitted from the card. As with the method of claim 31, all the information associated. Wherein the transmitted data is less than the method of the command 33, such as the method of claim 31, which further comprises: the =: the second command is retransmitted from the card associated with the command. 34. The method of claim 26 The first instruction is a write. The method of claim 26, wherein the command from the second set of commands is a read. 36. The method of claim 26, wherein the signature is included in a predetermined section of the data portion. 37. The method of claim 26, wherein the instruction is used to access a data at a logical address address and wherein the data portion of the instruction determines whether the file has a name of A logical address corresponds to a predetermined 38. As in the method of claim 26, the host is implemented by the host at the file driver level. 9 39. The method of claim 38, wherein the command is used to transfer data from the host to the card, and the data is placed in a tribute portion corresponding to the first instruction, , the earth, the warehouse JK > , A. The method further comprises determining that one of the cards is sufficient to accommodate the logical address of the file in the case of a segment. Real 2:: The second party goes, wherein the host is at the card driver level 41. The method of claim 26, wherein the system further includes a hardware adapter, the host and the card via the hard The body adapter exchanges the data and the commands 'where the host and the hardware adapter communicate: and wherein the first instruction is transmitted from the host to the IS include · the first instruction from the Transmitting the host to the hardware adapter; translating the first instruction into a corresponding one of the second protocol in the hardware adapter; and 116844.doc 200809593 assigning the corresponding instruction from the hardware The connector is transferred to the memory card. 42. The method of claim 26, wherein the instruction from the first agreement comprises a command portion including a command from the first agreement and a data portion, wherein the embedded command is embedded in the data portion . 43. The method of claim 26, wherein the command from the first agreement is to a predetermined logical address. 44. The method of claim 26, further comprising executing the post-inner command. 45. The method of claim 26, wherein the second agreement is an SD agreement. The method of claim 45, wherein the embedded command is a secure data access. 47. The method of claim 26, wherein the second agreement is an MMC agreement. 48. The method of claim 26, wherein the second agreement is a one-by-one agreement. 49. The method of claim 26, wherein the first agreement is a SCSI protocol. 50. The method of claim 26, wherein the command is for transferring data between the host and the card, wherein the data is not cached in the host. 5 1. A method for operating a non-volatile memory card, comprising: 0 receiving an instruction, wherein the instruction comprises a command portion and a data portion; determining whether the data portion of the command contains a signature; and The instruction contains the signature and a command is taken from the data portion of the instruction. 52. The method of claim 51, further comprising: determining whether the command is for transmitting data from the card; and in response to determining that the command is for transmitting data from the card, setting a flag for the transmission; 116844.doc 200809593 The material associated with the order is transmitted from the card. 53. The method of claim 52, wherein the transmitted data is less than all of the material associated with the command. P 7 54. The method of claim 53, further comprising: responding to the first data. The second command is retransmitted from the card associated with the command. 55. The method of claim 51 wherein the data portion further includes material associated with the extracted command. The method of claim 55, wherein the method further comprises determining whether the material associated with the extracted command included in the portion of the material is all of the material associated with the extracted command. η Μ 57. The method of claim 56, wherein the method further comprises, in response to determining that the data associated with the extracted command included in the data portion is not all of the data associated with the extracted command, setting one The flag is used for receipt of additional material associated with the extracted command. 58. The method of claim 51, wherein the (d) is included in a predetermined section of the data portion. 59. The method of claim 51, wherein the instruction is in a first agreement set having a first command set and wherein the extracted command is from a second command set in a second agreement And does not have a corresponding command in the first command set. 60. The method of claim 59, the Ganshidou #, , , the middle two agreement is used in a plurality of applications and the second agreement is a respective application agreement in a plurality of corresponding application agreements, + _ μ 士 仏 疋, 疋 疋, and can be used to operate multiple applications in the application 116844.doc 200809593 program. The method of claim 5, wherein the instruction is used to access a logical address: and wherein the data portion of the instruction determines whether the signature portion corresponds to the first logical address - Pre-determined logical address. The method of claim 51, wherein the determining that the instruction includes a signature and the extracting - the command from the data portion of the instruction is performed by the blade of the card. 63·如明求項51之方法,其進一纟包含執行該經提取之命令。 64·如明求項51之方法,其中該指令在一 sd協定中。 65.如請求項51之方法,其中該經提取之命令為—安全資料 存取。 、 66·如明求項51之方法,其中該指令在一 協定中。 67. 如請求項51之方法,其中該指令在—縫協定中。 68. -種傳輸-來自—第一協定之命令的方法,其包含: • %成一來自一第二協定之指令,該指令包括一接受一 相關聯資料部分的命令; 將來自該第-協定之該命令及一指示該指令含有一來 吞第協疋之中令的簽名置放於該指令之該相關聯資 料部分中;及 傳輸該指令。 •如喷求項68之方法’其中該第_協定係用於複數個應用 程式中之-者且該第—協定為複數個相應應用程式協定 中之各別應用程式協^,且其中可同時操作該複數個應 116844.doc 200809593 用程式中的多個應用程式。 70· 71· 72. 如請求項68之方法,其進一步包含將與來自該第一協定 之該命令相關聯之資料置放於該相關聯的資料部分中。 如請求項70之方法,該方法進一步包含判定包括於謗資 料邛刀中之與來自該第一協定之該命令相關聯的該 日不炎命十 貝 '' 自該弟一協定之該命令相關聯的全部資料。63. The method of claim 51, further comprising executing the extracted command. 64. The method of claim 51, wherein the instruction is in a sd agreement. 65. The method of claim 51, wherein the extracted command is a secure data access. 66. The method of claim 51, wherein the instruction is in an agreement. 67. The method of claim 51, wherein the instruction is in a seaming agreement. 68. A method of transmitting - from - an order of a first agreement, comprising: - % into an instruction from a second agreement, the instruction comprising an order accepting an associated data portion; from the first agreement The command and a signature indicating that the instruction contains a command to be swallowed in the associated data portion of the instruction; and transmitting the instruction. • The method of claim 68, wherein the first agreement is used in a plurality of applications and the first agreement is a respective application agreement in a plurality of corresponding application agreements, and wherein Operate the multiple applications in the program 116844.doc 200809593. 70. The method of claim 68, further comprising placing information associated with the command from the first agreement in the associated data portion. The method of claim 70, the method further comprising determining that the day of the non-inflammation of the order associated with the command from the first agreement is included in the data file. All the information of the association. 月求項71之方法,該方法進一步包含:回應於判定勹 括於該資料部分中之與來自該第一協定之該命令相關: 的忒貝料並非與來自該第一協定之該命令相關聯之全部 貧料,設定一旗標以用於與來自該第一協定之命令相 聯的額外資料之接收。 73. 如請求項68之方法,其中來自該第二協定之該指令為〜 寫入。 74·如明求項68之方法,其中來自該第一協定之該命令為— 讀取。 一— 75·如請求項68之方法,其中將該簽名置放於該相關聯 部分之一預定區段中。 76·如請求項68之方法,其中由該主機在該檔案驅動程式居 級實施該内嵌。 曰 77·如請求項68之方法,其中該相關聯資料部分係形成為一 檔案之部分。 78.如請求項68之方法’其中將來自該第二協定之該指令傳 輸至一預定邏輯位址。 79·如靖求項68之方法,其中來自該第—協定之該命令係用 116844.doc 200809593 於該資料傳送且其中該資料未快取於該傳輸裝置中。 80· —種操作一系統之方法,該系統包含一記憶卡及一可與 該卡交換資料及命令之主機,其中在該主機與該卡之間 的該資料及命令交換在傳輸過程中之某階段使用一第一 協定中之一第一命令集且,其中該主機及該卡包括一使 用一第二協定中之一第二命令集的應用程式,該方法包 含··The method of claim 71, the method further comprising: in response to determining that the data contained in the data portion is associated with the command from the first agreement: the mussel material is not associated with the command from the first agreement All of the poor materials are set a flag for receipt of additional information associated with commands from the first agreement. 73. The method of claim 68, wherein the instruction from the second agreement is ~ write. 74. The method of claim 68, wherein the command from the first agreement is - read. The method of claim 68, wherein the signature is placed in a predetermined section of the associated portion. 76. The method of claim 68, wherein the embedding is performed by the host at the file driver level. The method of claim 68, wherein the associated data portion is formed as part of a file. 78. The method of claim 68, wherein the instruction from the second agreement is transmitted to a predetermined logical address. 79. The method of claim 68, wherein the command from the first agreement is transmitted at 116844.doc 200809593 and wherein the data is not cached in the transmission device. 80. A method of operating a system, the system comprising a memory card and a host for exchanging data and commands with the card, wherein the data and command exchange between the host and the card are in the process of transmission The stage uses a first command set of a first agreement and wherein the host and the card include an application that uses a second command set of one of the second protocols, the method comprising 將一來自該第二命令集之命令内欲於—來自該第—協 定之第一指令中; 將該第一指令自該主機傳輸至該記憶卡中之一第一邏 輯位址; 判定該内嵌命令是否係用於將資料自該卡傳送至該立 機, Ik後將一第二指令自該主機傳輸至該記憶卡; 回應於判定該内嵌命令係用於將資料自該卡傳送至錢 主機,判疋该第二指令是否係至該記憶卡中之該第 輯位址;及 口應於該第:指令係至該記憶卡中之該第— 址,將資料自該卡傳送至該主機。 81·如請求項80之方法,其中該第一指令為一寫入。 82. ::求項8〇之方法’其中來自該第二指令之該命令為一 83. 如請求⑽之㈣,其巾該簽名包含於㈣ 預定區段中。 伯7之一 116844.doc 200809593 84. 如請求項80之方法,其中由該主機在該槽案 級實施該内嵌。 往式層 85. 如請求柳之方法,其中該命令係用於在該 之間傳送資料,其中該資料未快取於該主機卜Ί卡 8 6. —種記憶卡結構,其包含: 一非揮發性記憶體; -可端層’其用於根據—第_協定與_與 的主機交換指令,中第一声刹 — 相連接 ,、甲弟一層判定該第一協定中 入指令的資料部分是否含有一簽座 汶石五用於回應於判定 無該簽名而根據該第一協定中的該指令來存取 體;及 心 一應用程式層’其中回應於判定該第-協定中之一傳 入指令含有-簽名,將該傳入指令自該前端層傳送至該 應用程式’其中自該傳人指令之該資料部分提取一第二 協定中之-指令且根據該第二協定中的該指令而存取該 記憶體。 87.如請求項86之記憶卡結構’其中該簽名係包含於該資料 部分之一預定區段中。 88·如作求項86之纪憶卡結構,其中該指令係在一具有一第 一命令集之第一協定中,且其中該經提取之命令係來自 一第二協定中之一第二命令集且不具有該第一命令集中 之一相應命令。 89·如請求項86之記憶卡結構,其中該指令係用以存取在一 第一邏輯位址處之資料且其中該判定該指令之該資料部 分是否含有一簽名係回應於該第一邏輯位址對應於一預 116844.doc -12· 200809593 定邏輯位址。 90.如請求項86 層係以^ 結構,其中該前端層及該應用程式 層你U靭體予以實施。 求項86之,己憶卡結構,其中該記憶 理多個此等指令。 稱了冋時處Passing a command from the second command set to the first instruction from the first protocol; transmitting the first instruction from the host to a first logical address of the memory card; determining the inner Whether the embedded command is used to transfer data from the card to the stand-alone machine, and Ik transmits a second command from the host to the memory card; in response to determining that the embedded command is used to transfer data from the card to the card The money host determines whether the second instruction is to the first address in the memory card; and the mouth is to transmit the data from the card to the first address in the memory card The host. 81. The method of claim 80, wherein the first instruction is a write. 82. The method of claim 8 wherein the command from the second instruction is a 83. (4), if the request (10) is (4), the signature is included in the (4) predetermined section. 84. The method of claim 80, wherein the embedding is performed by the host at the slot level. To the layer 85. The method of requesting Liu, wherein the command is used to transfer data between the files, wherein the data is not cached on the host card 8 6. A memory card structure, which includes: Volatile memory; - the end layer 'is used to exchange instructions according to the -_ agreement with the host of the _, the first sound brake is connected, and the first layer determines the data portion of the incoming instruction in the first agreement Whether or not a sign of Wenshiwu is used to access the body according to the instruction in the first agreement in response to determining that the signature is absent; and the application layer is in response to determining that the first agreement is passed The incoming command contains a signature, and the incoming command is transmitted from the front end layer to the application 'where the information in the second protocol is extracted from the data portion of the relay instruction and according to the instruction in the second protocol Access this memory. 87. The memory card structure of claim 86 wherein the signature is included in a predetermined section of the data portion. 88. The memory card structure of claim 86, wherein the instruction is in a first agreement having a first set of commands, and wherein the extracted command is from a second command in a second agreement The set does not have a corresponding command in one of the first command sets. 89. The memory card structure of claim 86, wherein the instruction is to access data at a first logical address and wherein the determining whether the data portion of the instruction contains a signature system is responsive to the first logic The address corresponds to a pre-116844.doc -12· 200809593 logical address. 90. If the request item 86 is structured by a ^ structure, the front end layer and the application layer are implemented by your U firmware. In the case of item 86, the card structure is recalled, wherein the memory manages a plurality of such instructions. Weighed 92.m:91之記憶卡結構,其中該應用程式層包括多個 且其中經同時處理之該等多個指令來自該等應 用耘式中的一個以上應用程式。 93·如研求項86之記憶卡結構,其中回應於判定該傳入指令 係用於自該卡之資料傳送,該應用程式層設定_用= 傳达之旗標並自胃卡傳送與該傳入指令相關聯的資料/ 如明求項93之§己憶卡結構,其中回應於一第二傳入指令 而自該卡重新傳送與該傳入指令相關聯之該資料。曰7 95.如明求項86之記憶卡結構,其中該應用程式層判定該資 料部分是否進一步包括與該第二協定中之該指令相關: 的資料。 96·如請求項95之記憶卡結構,其中該應用程式層判定包括 於該資料部分中之與該第二協定中之該指令相關聯的該 貪料是否為與該第二協定中之該指令相關聯之全部資 料。 ' 97·如请求項96之記憶卡結構,其中回應於判定包括於該資 料部分中之與該第二協定中之該指令相關聯的該資料並 非與該第二協定中之該指令相關聯之全部資料,該應用 程式層設定一旗標以用於與該第二協定中之該指令相關 聯的額外資料之接收。 116844.doc •13-92. m: The memory card structure of 91, wherein the application layer comprises a plurality of and wherein the plurality of instructions processed simultaneously are from more than one of the applications. 93. The memory card structure of claim 86, wherein in response to determining that the incoming command is for data transfer from the card, the application layer sets _ with a flag to convey and transmits from the stomach card The data associated with the incoming instruction/the memory card structure of claim 93, wherein the data associated with the incoming instruction is retransmitted from the card in response to a second incoming instruction. The memory card structure of claim 86, wherein the application layer determines whether the data portion further includes information relating to the instruction in the second agreement: 96. The memory card structure of claim 95, wherein the application layer determines whether the greed associated with the instruction in the second agreement included in the data portion is the same as the instruction in the second agreement All relevant information. 97. The memory card structure of claim 96, wherein the information associated with the instruction in the second agreement that is included in the data portion is not associated with the instruction in the second agreement For all data, the application layer sets a flag for receipt of additional material associated with the instruction in the second agreement. 116844.doc •13-
TW95146174A 2005-12-08 2006-12-08 Media card with command pass through mechanism TW200809593A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US11/299,186 US20070168668A1 (en) 2005-12-08 2005-12-08 Media card with command pass through mechanism
US11/298,349 US20070136501A1 (en) 2005-12-08 2005-12-08 Media card command pass through methods

Publications (1)

Publication Number Publication Date
TW200809593A true TW200809593A (en) 2008-02-16

Family

ID=38201318

Family Applications (1)

Application Number Title Priority Date Filing Date
TW95146174A TW200809593A (en) 2005-12-08 2006-12-08 Media card with command pass through mechanism

Country Status (5)

Country Link
EP (1) EP1958049A2 (en)
JP (1) JP2009518759A (en)
KR (1) KR20080089586A (en)
TW (1) TW200809593A (en)
WO (1) WO2007076214A2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI464566B (en) * 2009-12-17 2014-12-11 Toshiba Kk Semiconductor system, semiconductor device, and electronic device initializing method

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9032154B2 (en) 2007-12-13 2015-05-12 Sandisk Technologies Inc. Integration of secure data transfer applications for generic IO devices
US8880483B2 (en) * 2007-12-21 2014-11-04 Sandisk Technologies Inc. System and method for implementing extensions to intelligently manage resources of a mass storage system
DE102009019982A1 (en) 2009-05-05 2010-11-18 Giesecke & Devrient Gmbh Method for accessing a portable storage medium with an add-on module and a portable storage medium
CN102014528B (en) 2010-04-28 2012-04-18 华为终端有限公司 Wireless internet equipment, system and method
TWI526838B (en) 2013-02-27 2016-03-21 東芝股份有限公司 Memory device
US9824004B2 (en) 2013-10-04 2017-11-21 Micron Technology, Inc. Methods and apparatuses for requesting ready status information from a memory
US10108372B2 (en) 2014-01-27 2018-10-23 Micron Technology, Inc. Methods and apparatuses for executing a plurality of queued tasks in a memory
US9454310B2 (en) 2014-02-14 2016-09-27 Micron Technology, Inc. Command queuing
JP2019191804A (en) * 2018-04-23 2019-10-31 大日本印刷株式会社 Secure element issue system, secure element, issue data generating device and issuing device
CN114928377B (en) * 2022-05-11 2023-04-21 威创集团股份有限公司 Output transmission method, device and equipment for reducing transparent transmission bandwidth of USB data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040064612A1 (en) * 2002-09-26 2004-04-01 Sandisk Corporation Method and system for using a memory card protocol inside a bus protocol
US7334077B2 (en) * 2003-10-17 2008-02-19 Renesas Technology America, Inc. Method and apparatus for smart memory pass-through communication

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI464566B (en) * 2009-12-17 2014-12-11 Toshiba Kk Semiconductor system, semiconductor device, and electronic device initializing method
US9141398B2 (en) 2009-12-17 2015-09-22 Kabushiki Kaisha Toshiba System, device, and method for initializing a plurality of electronic devices using a single packet
TWI510904B (en) * 2009-12-17 2015-12-01 Toshiba Kk Host controller and semiconductor device
TWI582572B (en) * 2009-12-17 2017-05-11 東芝股份有限公司 Semiconductor system, semiconductor device, and electoronic device initializing method
USRE47598E1 (en) 2009-12-17 2019-09-10 Toshiba Memory Corporation System, device, and method for initializing a plurality of electronic devices using a single packet
USRE48495E1 (en) 2009-12-17 2021-03-30 Toshiba Memory Corporation System, device, and method for initializing a plurality of electronic devices using a single packet
USRE49682E1 (en) 2009-12-17 2023-10-03 Kioxia Corporation System, device, and method for initializing a plurality of electronic devices using a single packet

Also Published As

Publication number Publication date
WO2007076214A3 (en) 2007-11-01
WO2007076214A2 (en) 2007-07-05
EP1958049A2 (en) 2008-08-20
KR20080089586A (en) 2008-10-07
JP2009518759A (en) 2009-05-07

Similar Documents

Publication Publication Date Title
TW200809593A (en) Media card with command pass through mechanism
US8417866B2 (en) Media card command pass through methods
US20070136501A1 (en) Media card command pass through methods
US20070168668A1 (en) Media card with command pass through mechanism
US8560852B2 (en) Method and system for communication between a USB device and a USB host
TWI353522B (en) Method and apparatus for interfacing with a restri
TWI417732B (en) Memory device with near field communications, method of communicating wireless network settings between devices, and universal serial bus flash drive related therewith
JP4308551B2 (en) Memory card and host device
US20060253620A1 (en) Data structure of flash memory having system area with variable size in which data can be updated, USB memory device having the flash memory, and method of controlling the system area
TW201212617A (en) Host device and method for securely booting the host device with operating system code loaded from a storage device
TW200837602A (en) Cryptographic key containers on a USB token
TW200928750A (en) System and method for updating read-only memory in smart card memory modules
US20120124380A1 (en) Usb composite device and method therefor
JP2007510201A (en) Data security
JP2006344206A (en) Universal serial bus data transmission method and device performing its method
EP1997083B1 (en) Automatically configurable smart card and method of automatically configuring a smart card
US20080126810A1 (en) Data protection method for optical storage media/device
US8402284B2 (en) Symbiotic storage devices
KR20200104885A (en) Safe end-to-end personalization of smart cards
US20160234185A1 (en) Storage device, information processing system, authentication method, and non-transitory computer readable medium
KR101936194B1 (en) SD Memory Control Method having Authentication-based Selective-Activation Function of Multi-Partitioned Memory
CN102034054A (en) Information authentication system
US11914879B2 (en) Storage controller and storage system comprising the same
JP4807667B2 (en) Communication system and peripheral device used therefor
JP2008033451A (en) Detachable storage medium