⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bfsa_api.lst

📁 at91sam7x256 FREERTOS sd卡的读写程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
    178              BFSABuffer.BFSA_fatBuff[0x1CA] = (UCHAR) NB_BLOCK;
    179              BFSABuffer.BFSA_fatBuff[0x1CB] = ((UCHAR)(NB_BLOCK>>8));
   \   0000004A   4673               STRB        R6,[R0, #+13]
    180              BFSABuffer.BFSA_fatBuff[0x1CC] = 0x00;
   \   0000004C   0021               MOV         R1,#+0
   \   0000004E   C181               STRH        R1,[R0, #+14]
    181              BFSABuffer.BFSA_fatBuff[0x1CD] = 0x00;
    182            // ************* END First partition *************
    183          
    184            // ************* Identification code : 0xAA55 = good partition *************
    185              BFSABuffer.BFSA_fatBuff[0x1FE] = 0x55;
   \   00000050   FF20               MOV         R0,#+255
   \   00000052   4000               LSL         R0,R0,#+1          ;; #+510
   \   00000054   2F18               ADD         R7,R5,R0
   \   00000056   5520               MOV         R0,#+85
   \   00000058   3870               STRB        R0,[R7, #+0]
   \   0000005A   AA20               MOV         R0,#+170
   \   0000005C   7870               STRB        R0,[R7, #+1]
    186              BFSABuffer.BFSA_fatBuff[0x1FF] = 0xAA;
    187            // ************* End Identification code *************
    188          
    189            po_lock();
   \   0000005E   ........           _BLF        po_lock,??po_lock??rT
    190            value = 0x00;
   \   00000062   0020               MOV         R0,#+0
   \   00000064   0090               STR         R0,[SP, #+0]
   \   00000066   0023               MOV         R3,#+0
   \   00000068   2A1C               MOV         R2,R5
   \   0000006A   6108               LSR         R1,R4,#+1
    191          
    192            // free the FATs sector and root dir
    193          #ifdef NANDFLASH
    194            for (count=0; count<64; count++)
    195            {
    196              AT91F_Flash_Write_Address((unsigned int)FILE_MGR_BEGIN_ADDRESS+(2+count)*MBR_SIZE, MBR_SIZE, (unsigned char*) &value, TRUE);
    197            }
    198          #else
    199            #ifdef AT91SAM9265
    200            // Erase all HD Flash size
    201            if( FALSE == AT91F_Flash_Write_Address((unsigned int)FILE_MGR_BEGIN_ADDRESS, HD_SIZE, (unsigned char*) &value, TRUE) )
    202            {
    203              TRACE_ERROR( "FT_PB\n\r");
    204            }
    205            else
    206            #endif
    207          #endif
    208            // Write Boot Sector
    209            if( TRUE == AT91F_Flash_Write_Address((unsigned int)BASE_mmc_Add, MBR_SIZE /*sizeof(BFSA_fatBuff)*/, (unsigned char*)BFSABuffer.BFSA_fatBuff, FALSE ) )
   \   0000006C   ........           _BLF        AT91F_Flash_Write_Address,??AT91F_Flash_Write_Address??rT
   \   00000070   0128               CMP         R0,#+1
   \   00000072   53D1               BNE         ??BFSA_format_1
    210            {
    211              // Erase table BFSA_fatBuff
    212              for (count=0; count < sizeofBFSA_fatBuff; count++)
   \   00000074   0020               MOV         R0,#+0
   \   00000076   0021               MOV         R1,#+0
    213              {
    214                BFSABuffer.BFSA_fatBuff[count] = (unsigned char)0x00;
   \                     ??BFSA_format_2:
   \   00000078   2954               STRB        R1,[R5, R0]
    215              }
   \   0000007A   401C               ADD         R0,R0,#+1
   \   0000007C   A042               CMP         R0,R4
   \   0000007E   FBD3               BCC         ??BFSA_format_2
    216          
    217          
    218              // Jump to boot routine BS_jmpBoot
    219              BFSABuffer.BFSA_fatBuff[0x00] = 0xEB;  // jmpBoot[0] = 0xEB, jmpBoot[1] = 0x??, jmpBoot[2] = 0x90
   \   00000080   EB20               MOV         R0,#+235
   \   00000082   2870               STRB        R0,[R5, #+0]
    220              BFSABuffer.BFSA_fatBuff[0x01] = 0x3C;
   \   00000084   3C20               MOV         R0,#+60
   \   00000086   6870               STRB        R0,[R5, #+1]
    221              BFSABuffer.BFSA_fatBuff[0x02] = 0x90;
   \   00000088   9020               MOV         R0,#+144
   \   0000008A   A870               STRB        R0,[R5, #+2]
    222              // Manufacturer name and version number // BS_OEMName "MSWIN4.1"
    223              //BFSA_fatBuff[0x03] = 'M'; BFSA_fatBuff[0x04] = 'S'; BFSA_fatBuff[0x05] = 'W'; BFSA_fatBuff[0x06] = 'I';
    224              //BFSA_fatBuff[0x07] = 'N'; BFSA_fatBuff[0x08] = '4'; BFSA_fatBuff[0x09] = '.'; BFSA_fatBuff[0x0A] = '1';
    225          
    226              // ************* "BIOS Parameter Block" (BPB) *************
    227                // BPB_BytsPerSec: Count of bytes per sector (512, 1024, 2048 or 4096)
    228                BFSABuffer.BFSA_fatBuff[0x0B] = 0x00; BFSABuffer.BFSA_fatBuff[0x0C] = 0x02;
   \   0000008C   E972               STRB        R1,[R5, #+11]
   \   0000008E   0220               MOV         R0,#+2
   \   00000090   2873               STRB        R0,[R5, #+12]
    229                // BPB_SecPerClus: Number of sectors per allocation unit (1, 2, 4, 8, 16, 32, 64, and 128)
    230          #if defined(NANDFLASH)
    231                BFSABuffer.BFSA_fatBuff[0x0D] = 0x20;
    232          #else
    233                BFSABuffer.BFSA_fatBuff[0x0D] = 0x01;
   \   00000092   0120               MOV         R0,#+1
   \   00000094   6873               STRB        R0,[R5, #+13]
    234          #endif
    235                // BPB_RsvdSecCnt: 0x01 Number of reserved sectors in the Reserved region of the volume starting at the first sector of the volume
    236                BFSABuffer.BFSA_fatBuff[0x0E] = 0x01; BFSABuffer.BFSA_fatBuff[0x0F] = 0x00;
   \   00000096   A873               STRB        R0,[R5, #+14]
   \   00000098   E973               STRB        R1,[R5, #+15]
    237                // BPB_NumFATs   : The count of FAT data structures on the volume
    238                BFSABuffer.BFSA_fatBuff[0x10] = 0x02;
   \   0000009A   0220               MOV         R0,#+2
   \   0000009C   2874               STRB        R0,[R5, #+16]
    239          
    240                // BPB_RootEntCnt: For FAT12 and FAT16 volumes, this field contains the count
    241                // of 32-byte directory entries in the root directory (224 = 0x00E0) (512=0x0200)
    242          #if defined(NANDFLASH)
    243                BFSABuffer.BFSA_fatBuff[0x11] = 0xE0; BFSABuffer.BFSA_fatBuff[0x12] = 0x01;
    244          #else
    245                BFSABuffer.BFSA_fatBuff[0x11] = 0x00; BFSABuffer.BFSA_fatBuff[0x12] = 0x02;   // 15 Ko lost
   \   0000009E   6974               STRB        R1,[R5, #+17]
   \   000000A0   A874               STRB        R0,[R5, #+18]
    246                //BFSA_fatBuff[0x11] = 0xE0; BFSA_fatBuff[0x12] = 0x00; //  7 Ko lost, not format by windows
    247          #endif
    248          
    249                // BPB_TotSec16: Number of sector (cluster) in volume
    250                BFSABuffer.BFSA_fatBuff[0x13] = (UCHAR) NB_BLOCK;
   \   000000A2   8020               MOV         R0,#+128
   \   000000A4   E874               STRB        R0,[R5, #+19]
    251                BFSABuffer.BFSA_fatBuff[0x14] = ((UCHAR)(NB_BLOCK>>8));
   \   000000A6   2E75               STRB        R6,[R5, #+20]
    252          
    253                // BPB_Media 0xF0 for removable, 0xF8 for non removable media
    254                BFSABuffer.BFSA_fatBuff[0x15] = 0xF0;
   \   000000A8   F020               MOV         R0,#+240
   \   000000AA   6875               STRB        R0,[R5, #+21]
    255          
    256                // BPB_FATSz16 This field is the FAT12/FAT16 16-bit count of sectors occupied by ONE FAT.
    257                // On FAT32 volumes this field must be 0, and BPB_FATSz32 contains the FAT size count.
    258          #if defined(NANDFLASH)
    259                BFSABuffer.BFSA_fatBuff[0x16] = 0x10; BFSABuffer.BFSA_fatBuff[0x17] = 0x00;
    260          #else
    261                BFSABuffer.BFSA_fatBuff[0x16] = 0x02; BFSABuffer.BFSA_fatBuff[0x17] = 0x00;  // 47 Ko more for 256Ko Flash
   \   000000AC   0220               MOV         R0,#+2
   \   000000AE   A875               STRB        R0,[R5, #+22]
   \   000000B0   E975               STRB        R1,[R5, #+23]
    262            #ifdef AT91SAM7S32
    263                BFSABuffer.BFSA_fatBuff[0x16] = 0x01; BFSABuffer.BFSA_fatBuff[0x17] = 0x00;  //  1 Ko more
    264            #endif
    265            #ifdef AT91SAM7S64
    266                BFSABuffer.BFSA_fatBuff[0x16] = 0x01; BFSABuffer.BFSA_fatBuff[0x17] = 0x00;  //  1 Ko more
    267            #endif
    268          #endif
    269                BPB_FATSz16 = BFSABuffer.BFSA_fatBuff[0x16] + BFSABuffer.BFSA_fatBuff[0x17]*0x100;
    270          
    271                // BPB_SecPerTrk : Sectors per track for interrupt 0x13
    272                BFSABuffer.BFSA_fatBuff[0x18] = 0x01; BFSABuffer.BFSA_fatBuff[0x19] = 0x00;
   \   000000B2   0120               MOV         R0,#+1
   \   000000B4   2876               STRB        R0,[R5, #+24]
   \   000000B6   6976               STRB        R1,[R5, #+25]
    273                // BPB_NumHeads  : Number of heads for interrupt 0x13
    274                BFSABuffer.BFSA_fatBuff[0x1A] = 0x01; BFSABuffer.BFSA_fatBuff[0x1B] = 0x00;
   \   000000B8   A876               STRB        R0,[R5, #+26]
   \   000000BA   E976               STRB        R1,[R5, #+27]
    275                // BPB_HiddSec : 0x00 Count of hidden sectors preceding the partition that contains this FAT volume
    276                BFSABuffer.BFSA_fatBuff[0x1C] = 0x00; BFSABuffer.BFSA_fatBuff[0x1D] = 0x00; BFSABuffer.BFSA_fatBuff[0x1E] = 0x00; BFSABuffer.BFSA_fatBuff[0x1F] = 0x00;
   \   000000BC   E961               STR         R1,[R5, #+28]
    277                // BPB_TotSec32 : This field is the new 32-bit total count of sectors on the volume.
    278                BFSABuffer.BFSA_fatBuff[0x20] = 0x00; BFSABuffer.BFSA_fatBuff[0x21] = 0x00;
   \   000000BE   281C               MOV         R0,R5
   \   000000C0   2030               ADD         R0,#+32
   \   000000C2   0160               STR         R1,[R0, #+0]
    279                BFSABuffer.BFSA_fatBuff[0x22] = 0x00; BFSABuffer.BFSA_fatBuff[0x23] = 0x00;
    280              // ************* END "BIOS Parameter Block" (BPB) *************
    281          
    282              // ************* "extended BIOS Parameter Block" (EBPB) *************
    283                BFSABuffer.BFSA_fatBuff[0x24] = 0x00; // BS_DrvNum : Int 0x13 drive number BootIndicator (0x00: floppy, 0x80: hard drive)
   \   000000C4   8180               STRH        R1,[R0, #+4]
    284                BFSABuffer.BFSA_fatBuff[0x25] = 0x00; // BS_Reserved1: not used (only for winNT, control by chkdsk)
    285                BFSABuffer.BFSA_fatBuff[0x26] = 0x29; // BS_BootSig: Extended boot signature (0x29)
   \   000000C6   2921               MOV         R1,#+41
   \   000000C8   8171               STRB        R1,[R0, #+6]
    286                // BFSA_fatBuff[0x27] = ; BFSA_fatBuff[0x28] = ; BFSA_fatBuff[0x29] = ; BFSA_fatBuff[0x2A] = ;  // BS_VolID: Volume serial number
    287                // BS_VolLab : Volume label. This field matches the 11-byte volume label recorded in the root directory.
    288                // The setting for this field when there is no volume label is the string "NO NAME    ".
    289                BFSABuffer.BFSA_fatBuff[0x2B] = 'N';
   \   000000CA   4E21               MOV         R1,#+78
   \   000000CC   C172               STRB        R1,[R0, #+11]
    290                BFSABuffer.BFSA_fatBuff[0x2C] = 'O';
   \   000000CE   4F22               MOV         R2,#+79
   \   000000D0   0273               STRB        R2,[R0, #+12]
    291                BFSABuffer.BFSA_fatBuff[0x2D] = ' ';
   \   000000D2   2022               MOV         R2,#+32
   \   000000D4   4273               STRB        R2,[R0, #+13]
    292                BFSABuffer.BFSA_fatBuff[0x2E] = 'N';
   \   000000D6   8173               STRB        R1,[R0, #+14]
    293                BFSABuffer.BFSA_fatBuff[0x2F] = 'A';
   \   000000D8   4126               MOV         R6,#+65
   \   000000DA   C673               STRB        R6,[R0, #+15]
   \   000000DC   4D21               MOV         R1,#+77
   \   000000DE   0174               STRB        R1,[R0, #+16]
   \   000000E0   4521               MOV         R1,#+69
   \   000000E2   4174               STRB        R1,[R0, #+17]
    294                BFSABuffer.BFSA_fatBuff[0x30] = 'M';
    295                BFSABuffer.BFSA_fatBuff[0x31] = 'E';
    296                BFSABuffer.BFSA_fatBuff[0x32] = 0x20;  // space
   \   000000E4   8274               STRB        R2,[R0, #+18]
    297                BFSABuffer.BFSA_fatBuff[0x33] = 0x20;  // space
   \   000000E6   C274               STRB        R2,[R0, #+19]
    298                BFSABuffer.BFSA_fatBuff[0x34] = 0x20;  // space
   \   000000E8   0275               STRB        R2,[R0, #+20]
    299                BFSABuffer.BFSA_fatBuff[0x35] = 0x20;  // space
   \   000000EA   4275               STRB        R2,[R0, #+21]
    300                // BS_FilSysType : One of the strings "FAT12   ", "FAT16   ", or "FAT     ".
    301                BFSABuffer.BFSA_fatBuff[0x36] = 'F';
   \   000000EC   4621               MOV         R1,#+70
   \   000000EE   8175               STRB        R1,[R0, #+22]
    302                BFSABuffer.BFSA_fatBuff[0x37] = 'A';
   \   000000F0   C675               STRB        R6,[R0, #+23]
   \   000000F2   5421               MOV         R1,#+84
   \   000000F4   0176               STRB        R1,[R0, #+24]
    303                BFSABuffer.BFSA_fatBuff[0x38] = 'T';
    304                BFSABuffer.BFSA_fatBuff[0x39] = '1';
   \   000000F6   3121               MOV         R1,#+49

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -