📄 design
字号:
/jayacard/proto/bios/fs/DESIGN===============================================================================---[ File Identifier ]---------------------------------------------------------File Identifier (FID) : 2 bytes3F00 reserved for the Master File (MF)FFFF reserved RFU3FFF reserved to indicate 'use current EF' in a pathShort File Identifier (SFI) : 5 bits00 reserved to indicate current 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]...... <- free EF body address (for next EF creation) [FREE_BODY_FILE_ADDR]body EFnbody EFn-1...body EF2body EF1 <- root EF address [BASE_BODY_FILE_ADDR]---[ DF ]----------------------------------------------------------------------HEADER OF A 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 : pointer on the next sibling DF FREE 2 bytes not used FIRST 2 bytes : pointer on the first child DF/EF LAST 2 bytes : pointer on the last child 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 pointer on the default DF in the card FREE not used 0000 FIRST pointer on the first child DF / EF LAST pointer on the last child DF / EF CRC 2 bytes of CRC-A or CRC-B depending on the T=CL protocol---[ EF ]----------------------------------------------------------------------Supported file type : . transparent EF . linear EF with fixed-size records . cyclic EFEF Body : CRC of body (transparent or record) must be managed by the COS layeritself. BIOS FS makes no assumption on body CRC.HEADER OF AN EF FID 2 bytes FDESC 1 byte b7: internal(1)/external(0) EF b6/b5: kind of file 01: binary 10: linear fixed 11: cyclic b4: transactional if set b3: shareable if set b2: alias of an 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 size of the binary file linear fixed size of record | number max of record cyclic size of record | number max of record REC 2 bytes linear fixed current num of record | 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 + -