📄 design
字号:
/jayacard/proto/bios/fs/DESIGN===============================================================================---[ File Identifier ]---------------------------------------------------------文件标识(FID) : 2 bytes3F00 主文件标识(MF)FFFF reserved RFU3FFF reserved to indicate 'use current EF' in a pathShort File Identifier (SFI) : 5 bits00 用作标识当前FID1F reserved RFU---[ Payment System Environment ]---------------------------------------------- AID = RID | PIX RID = 5 bytes PIX = 0 to 11 bytesPayment System Directory (PSD file) for each DF EF file identified by an SFI in the range 1 to 10. Our implementation use SFI==1 (which is returned in the FCI of the DF) One record : Tag 70 Data Length ( Tag 61 , Length Dir entry, Dir entry ) x n where dir entry could be : DDF: Tag 9D Len 5-16 DDF Name, ex: 1PAY.SYS.DDF01 or ADF: Tag 4F Len 5-16 AID Tag 50 Len 1-16 Application LabelNote: DDF = 目录定义文件(Directory Definition File) ADF = 应用定义文件(Application Definition File)---[ Memory Mapping FS ]-------------------------------------------------------Headers area grows from the top, bodies area grows from the bottom; Out ofmemory when the two areas collision. Header is 16 bytes long.MF <- ADDR_HEADER_MFEF/DF1 <- root EF/DF header address [BASE_HEADER_FILE_ADDR]EF/DF2...EF/DFn <- free EF/DF header address (for next EF/DF creation) [FREE_HEADER_FILE_ADDR]...... <- 未使用的空间(for next EF creation) [FREE_BODY_FILE_ADDR]body EFnbody EFn-1...body EF2body EF1 <- root EF address [BASE_BODY_FILE_ADDR]---[ DF ]----------------------------------------------------------------------DF文件头 FID 2 bytes FDESC 1 byte b7: not used b6/b5: 00 (DF or MF) b4: not used b3: shareable if set b2..b0: not used SFI 1 byte SFI of the PSD File ACS 3 bytes ACSEXT 1 byte NEXT 2 bytes : 指向下一个兄弟DF FREE 2 bytes not used FIRST 2 bytes : 第一个子DF/EF指针 LAST 2 bytes : 最后一个子DF/EF指针 CRC 2 bytes of CRC-A or CRC-B depending on the T=CL protocol---[ MF ]----------------------------------------------------------------------HEADER OF MF = HEADER OF DF with FID 3F00 FDESC master file 00 SFI not used 00 ACS not used 000000 ACSEXT not used 00 NEXT 缺省DF指针 FREE not used 0000 FIRST 第一个子DF/EF指针 LAST 最后一个子DF/EF指针 CRC 2 bytes of CRC-A or CRC-B depending on the T=CL protocol---[ EF ]----------------------------------------------------------------------支持的文件类型: . 透明二进制文件EF . 定长记录文件EF . 循环EFEF Body : CRC of body (transparent or record) must be managed by the COS layeritself. BIOS FS makes no assumption on body CRC.EF文件头 FID 2 bytes FDESC 1 byte b7: 内部(1)/外部(0) EF b6/b5: 文件类型 01: 二进制 10: 定长记录文件 11: 循环记录文件 b4: 如果设置 事务性 b3: 可共享的 b2: 一个EF文件别名 if set b1/b0: not used SFI 1 byte b4..b0: SFI ACS 3 bytes ACSEXT 1 byte NEXT 2 bytes : pointer on the next DF/EF of the parent DF BODY 2 bytes : pointer on the body of the EF or pointer on the aliased EF file (Aliased file must have shareable bit set) SIZE 2 bytes : binary 二进制文件大小 linear fixed 记录大小 | 记录数 cyclic 记录大小 | 最大记录数 REC 2 bytes linear fixed 当前记录号 | 00 cyclic current num of record | top record CRC 2 bytes of CRC-A or CRC-B depending on the T=CL protocol==============================================================================================================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -