{"id":79,"date":"2018-03-10T14:32:04","date_gmt":"2018-03-10T06:32:04","guid":{"rendered":"http:\/\/www.max-shu.com\/blog\/?p=79"},"modified":"2018-03-10T14:32:04","modified_gmt":"2018-03-10T06:32:04","slug":"nucleus%e7%9a%84flash-media%e7%ae%a1%e7%90%86fmm","status":"publish","type":"post","link":"http:\/\/www.max-shu.com\/blog\/?p=79","title":{"rendered":"Nucleus\u7684flash media\u7ba1\u7406FMM"},"content":{"rendered":"<p>\u8fc1\u79fb\u81ea<a href=\"http:\/\/adaishu.blog.163.com\/blog\/static\/17583128620114382015423\/\">http:\/\/adaishu.blog.163.com\/blog\/static\/17583128620114382015423\/<\/a><\/p>\n<h1>1\uff0eFMM\u00a0\u00a0\u00a0\u00a0\u00a0\uff08Flash Media Manage\uff09<\/h1>\n<p style=\"font-weight: 400;\">FMM\u662f\u5c06Flash Memory\u00a0\u8bbe\u5907\u4f5c\u4e3aNucleus Plus\u6587\u4ef6\u7cfb\u7edf\u7684\u5b58\u50a8\u4ecb\u8d28\uff0c\u5feb\u901f\uff0c\u7b80\u5355\uff0c\u5b89\u5168\u6027\u597d\u3002\u5e76\u6709\u5982\u4e0b\u7279\u70b9\uff1a<\/p>\n<p style=\"font-weight: 400;\">l\u00a0\u00a0\u81ea\u52a8\u6807\u6ce8\u8bbe\u5907\u57df\u4e0a\u7684OS\u00a0\u6bb5\uff1b<\/p>\n<p style=\"font-weight: 400;\">l\u00a0\u00a0\u8ddf\u8e2a\u8bbe\u5907\u7ecf\u5386\u8fc7\u7684\u8bfb\/\u5199\u6b21\u6570\uff1b<\/p>\n<p style=\"font-weight: 400;\">l\u00a0\u00a0\u6389\u7535\u6062\u590d\uff1b<\/p>\n<p style=\"font-weight: 400;\">l\u00a0\u00a0\u8fa8\u8ba4\u4f7f\u7528\u7684\u5757\u7684\u597d\u574f\uff1b<\/p>\n<h1>2\uff0e\u6240\u9700\u652f\u6301\uff1a<\/h1>\n<p style=\"font-weight: 400;\">Nucleus Plus\uff1b<\/p>\n<p style=\"font-weight: 400;\">Nucleus Plus\u6587\u4ef6\u7cfb\u7edf\uff1b<\/p>\n<p style=\"font-weight: 400;\">FMM\u6a21\u5757\uff1b<\/p>\n<h1>3\uff0eFMM\u6a21\u5757\uff1a<\/h1>\n<h2>1\uff0e\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6587\u4ef6\uff1a<\/h2>\n<p style=\"font-weight: 400;\">dev_intf.c\uff1a\u00a0\u5b9a\u4e49\u4e86\u8bbe\u5907\u63a5\u53e3\u51fd\u6570\uff0cAMD\u548cIntel\u7c7b\u578b\u7684FLASH\uff0c8\uff0c16\uff0c32\u4f4d\u7684\u547d\u4ee4\u5b57\u7b49\u3002<\/p>\n<p style=\"font-weight: 400;\">fmm.c\u00a0\uff1aFMM\u7684\u7279\u6b8a\u51fd\u6570\uff0c\u5305\u62ecformatflash\uff0cclrdirtysec\uff0cRegister_FMM\u7b49\u53ef\u5e94\u7528\u7684\u51fd\u6570\uff0c\u4f46\u4e0e\u6587\u4ef6\u7cfb\u7edf\u65e0\u5173\u3002<\/p>\n<p style=\"font-weight: 400;\">fmmflash.c\uff1aFMM\u7684\u63a7\u5236\u51fd\u6570\uff0c\u4e3b\u8981\u662fFlashInit\u00a0\uff0cFlashIoct\uff0cFlashIo\uff0cFlashOpen\uff0c\u7528\u4e8eFLASH\u8bbe\u5907\u8fd8\u6ca1\u6709\u767b\u8bb0\u4e3aFMM\u4e4b\u524d\u3002<\/p>\n<p style=\"font-weight: 400;\">os_intf.c\uff1a\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u7684\u63a5\u53e3\uff1b<\/p>\n<p style=\"font-weight: 400;\">flsutil.c\uff1aFMM\u5728\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u5e94\u7528\uff0c\u5982fmm_dos_format\uff0cfinfo\uff0cfmemtst\uff0cclrdsec\u7b49\uff0c\u8fd8\u6709\u4e00\u6587\u4ef6\u6d4b\u8bd5\u7a0b\u5e8f\uff1b<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\">dev_intf.h<\/p>\n<p style=\"font-weight: 400;\">fmm.h<\/p>\n<p style=\"font-weight: 400;\">flsutil.h<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0devtable.c\uff1a\u7f6e\u4e8e\u6587\u4ef6\u7cfb\u7edf\u7684\u76ee\u5f55\u4e0b\uff0c\u4f5c\u4e3aFLASH\u8bbe\u5907\u5230\u6587\u4ef6\u7cfb\u7edf\u7684\u63a5\u53e3\u3002<\/p>\n<h2>2\uff0e\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u51e0\u4e2a\u91cd\u8981\u7684\u6570\u636e\u7ed3\u6784\uff1a<\/h2>\n<p style=\"font-weight: 400;\">\u51e0\u4e2a\u5b9a\u4e49\uff1a<\/p>\n<p style=\"font-weight: 400;\"><strong>sector<\/strong>\uff1a\u7531FMM\u5b9a\u4e49\uff0c\u9690\u542b\u957f\u5ea6\u5b9a\u4e49\u4e3a512 + 4\u5b57\u8282\uff0c\u5176\u4e2d512\u662f\u5185\u5bb9\uff0c4\u662f\u4e00\u4e2a32\u4f4d\u7684\u5b57\uff0c\u5bf9sector\u6807\u8bb0\uff0c\u7f16\u53f7\u548c\u72b6\u6001\uff08INUSE\u6216FREE\u6216DIRTY\u7b49\u7b49\uff09\uff1b<\/p>\n<p style=\"font-weight: 400;\"><strong>block<\/strong>\uff1a\u4e3a\u5b9e\u9645\u7684\u8bbe\u5907\u7684\u6bb5\uff0c\u5982AMD29F040\uff0c\u603b\u957f512K\u5b57\u8282\uff0c\u52068\u4e2a\u6bb5\uff0c\u6bcf\u4e2a\u6bb5\u957f64K\u3002<\/p>\n<p style=\"font-weight: 400;\"><strong>driveno<\/strong>\uff1a\u4e3aA\uff0cB\uff0cC\uff0c\u5728\u6b64\uff0cFALSH\u5b9a\u4e49\u4e3a\u201cC\uff1a\u201d\uff0cA\u662f0\uff0c\u5219C\u4e3a2\uff1b<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\">\u5728FMM\u4e2d\uff0c\u6709\u4e09\u4e2a\u8d2f\u7a7f\u5168\u5c40\u7684\u6570\u636e\u7ed3\u6784\uff1a<\/p>\n<p style=\"font-weight: 400;\"><strong>format_info<\/strong>\uff1a<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0flag\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0FMM_INUSE\u6807\u8bb0<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0reg_fmm_t dev_char\uff1a\u89c1\u00a0\u00a0fmm_reg\uff1b<\/p>\n<p style=\"font-weight: 400;\">numsect\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8981\u8bfb\u5199\u7684sec\u7684\u6570\u91cf\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0nextsect\uff1a<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0numfreesect\uff1a\u8bbe\u5907\u4e2d\u7a7a\u95f2\u6bb5\u7684\u6570\u91cf\uff0c\u6267\u884c\u8bfb\u5199\u65f6\u7cfb\u7edf\u4f1a\u91cd\u65b0\u8ba1\u7b97\uff1b<\/p>\n<p style=\"font-weight: 400;\">numdirtysect\uff1adirtysect\u662f\u4e00\u4e9b\u5783\u573e\u6570\u636e\u7684\u6bb5<\/p>\n<p style=\"font-weight: 400;\">numbadsect\uff1a\u8bbe\u5907\u4e2d\u635f\u574f\u6bb5\u7684\u6570\u91cf\uff0c\u6267\u884c\u8bfb\u5199\u65f6\u7cfb\u7edf\u4f1a\u91cd\u65b0\u8ba1\u7b97\uff1b<\/p>\n<p style=\"font-weight: 400;\">num_id_sect\uff1a\u6bcf8\u4e2asector\u5c31\u8981\u7528\u4e00\u4e2a\u5b57\u8282\u6765\u6807\u8bb0\u662f\u5426\u662fbad\u5f62\u5f0f\uff0c\u8ba1\u7b97\u65b9\u5f0f\u662f\uff1a<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u603b\u5171\u9700\u8981\u7684id_sect\u6570\u00a0\/ INT_FMM_SECTOR &#8211; sizeof(id_hdr_t)<\/p>\n<p style=\"font-weight: 400;\">*sec_map_ptr\uff1asector translation table<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0*id_sect\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0bad sector table<\/p>\n<p style=\"font-weight: 400;\">*swap_area\uff1a\u00a0\u00a0swap for data during erase<\/p>\n<p style=\"font-weight: 400;\">fmm_smid\uff1a\u00a0\u00a0\u00a0fmm\u00a0\u4e2d\u7684semaphore id\uff0c\u76f8\u5f53\u4e8esemaphore\u4e2d\u8fd4\u56de\u7684\u6307\u9488\uff1b<\/p>\n<p style=\"font-weight: 400;\">erasecount\uff1a\u00a0\u00a0\u00a0\u64e6\u9664\u8bb0\u6570\uff0c\u6bcf\u6267\u884c\u4e00\u6b21\u52a01\uff1b<\/p>\n<p style=\"font-weight: 400;\">eraseblks\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u64e6\u9664\u7684block\u7684\u603b\u957f\u5ea6\uff08\u5355\u4f4d\uff1a\u5b57\u8282\uff09\uff1b<\/p>\n<p style=\"font-weight: 400;\">secperblk\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u6bcf\u4e2a\u64e6\u9664\u7684block\u7684sector\u6570\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0secperwin\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0sectors in window<\/p>\n<p style=\"font-weight: 400;\">nextersblk\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u4e0b\u4e00\u4e2a\u64e6\u9664\u7684\u5757\uff08\u7b2c1\uff0c2&#8230;&#8230;\u5757\uff09\uff1b<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\"><strong>formflash<\/strong><strong>\uff1a<\/strong><\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0mode\uff1a\u00a0\u662f\u5426\u4e3aMS-DOS\u683c\u5f0f\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0sectors\uff1a\u8fd4\u56de\u503c\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0flag\uff1a\u00a0\u00a0\u00a0user string\u00a0\u662f\u5426\u6709\u6548\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0erase_count\uff1a\u6b64\u524dFLASH\u64e6\u9664\u7684\u6b21\u6570\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0*user_string\uff1a\u683c\u5f0f\u5316\u65f6\u5199\u5728\u7b2c\u4e00\u6bb5\u7684\u4e00\u4e2a\u5b57\u7b26\u4e32\uff1b<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\"><strong>fmm_reg:<\/strong><\/p>\n<p style=\"font-weight: 400;\">socket\uff1a\u00a0\u56e0\u4e3a\u662fonboardflash\uff0c\u5b9a\u4e49\u4e3a0x80\uff1b<\/p>\n<p style=\"font-weight: 400;\">handle\uff1a\u00a0\u00a0PCMCIA\u5361\u7684\u7528\u6237\u6307\u9488\uff1b<\/p>\n<p style=\"font-weight: 400;\">size\uff1a\u00a0\u00a0\u00a0FLASH\u7684\u603b\u957f\u5ea6\uff1b<\/p>\n<p style=\"font-weight: 400;\">read_blk\u00a0\u3001write_blk\uff1a\u5b9a\u4e49\u6570\u636e\u4f4d\uff0c1-&gt;8\u4f4d\uff1b2-&gt;16\u4f4d&#8230;&#8230;\uff1b<\/p>\n<p style=\"font-weight: 400;\">erase_blk\uff1a\u64e6\u9664\u65f6\u6bcf\u4e2aBLK\u7684\u957f\u5ea6\uff1b\uff08\u5355\u4f4d\uff1a\u5b57\u8282\uff09<\/p>\n<p style=\"font-weight: 400;\">dev_size\uff1a\u00a0\u6bcf\u7247FLASH\u7684\u957f\u5ea6\uff0c\u4e00\u7247\u65f6\u540csize\uff1b<\/p>\n<p style=\"font-weight: 400;\">flash_start\uff1aFLASH\u7684\u8d77\u59cb\u5730\u5740\uff1b<\/p>\n<p style=\"font-weight: 400;\">flash_offset\uff1a<\/p>\n<p style=\"font-weight: 400;\">flash_size\uff1a\u00a0\u00a0\u00a0\u540csize\uff1b<\/p>\n<p style=\"font-weight: 400;\">secperwrite\uff1a\u00a0\u6bcf\u6b21\u5199\u7684SEC\u6570\u91cf\u6700\u5927\u503c\uff0c\u5b9a\u4e49\u5b83\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u8d85\u51fabuffer\u7684\u5927\u5c0f\u3002<\/p>\n<p style=\"font-weight: 400;\">reclaimcount\uff1a<\/p>\n<p style=\"font-weight: 400;\">vppctrl vpp_control\uff1a<\/p>\n<p style=\"font-weight: 400;\">ERWfunc ERWflash\uff1a\u64cd\u4f5c\u7684\u547d\u4ee4\uff0c\u8bfb\u5199\u7b49\u7b49\uff1b<\/p>\n<p style=\"font-weight: 400;\">mapaddr map_addr\uff1a\u5c06\u865a\u5730\u5740\u8f6c\u6362\u4e3a\u5b9e\u5730\u5740\uff1b<\/p>\n<p style=\"font-weight: 400;\">\n<h2>3\uff0e\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5e94\u7528\uff1a<\/h2>\n<p style=\"font-weight: 400;\">\u5728FMM\u7684\u5e94\u7528\u65f6\uff0c\u5e94\u5f53\u5148\u8c03\u7528\u4ee5\u4e0b\u51e0\u4e2a\u51fd\u6570\uff1a<\/p>\n<p style=\"font-weight: 400;\">FlashInit(dummy)\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u786c\u4ef6\u4fe1\u606f\u7684\u521d\u59cb\u5316\uff1b<\/p>\n<p style=\"font-weight: 400;\">pc_memory_init()\uff1a\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728\u8c03\u7528\u4efb\u4f55\u6587\u4ef6\u7cfb\u7edf\u7684\u7a0b\u5e8f\u4e4b\u524d\u90fd\u5fc5\u987b\u8c03\u7528\u8be5\u51fd\u6570\uff0c\u5b83\u5b8c\u6210\u7684\u662f\u6587\u4ef6\u7cfb\u7edf\u6240\u9700\u7684\u5206\u914d\u8868\uff1b<\/p>\n<p style=\"font-weight: 400;\">NU_Become_File_User()\uff1a\u5728\u591a\u4efb\u52a1\u7cfb\u7edf\u4e2d\uff0c\u5fc5\u987b\u5728\u4efb\u52a1\u91cc\u8c03\u7528\u8be5\u7a0b\u5e8f\uff0c\u624d\u80fd\u4f7f\u7528API\uff1b\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8c03\u7528\u8be5\u51fd\u6570\u5c31\u662f\u5c06\u8be5\u4efb\u52a1\u767b\u8bb0\u4e3aRTFS\u7684\u7528\u6237\u3002<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\">\u6b64\u5916\uff0c\u8981\u6ce8\u610f\u5c06FLASH\u8bbe\u7f6e\u4e3aC\uff1a\u9a71\u52a8\u5668\uff0c\u8981\u5728C\uff1a\u4e0b\u5b8c\u6210\u5bf9\u6587\u4ef6\u7684\u64cd\u4f5c\uff0c\u5c31\u5fc5\u987b\u5148\u8c03\u7528NU_Open_Disk(&#8220;C:&#8221;)\u548cNU_Set_Default_Drive( 2 )\u3002<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\">FMM\u7684\u63a5\u53e3\uff1a<\/p>\n<p style=\"font-weight: 400;\">1\uff0e\u4e0e\u786c\u4ef6\u7684\u63a5\u53e3\uff1a\u5728dev_intf.c\u00a0\u5b9a\u4e49\uff1b<\/p>\n<p style=\"font-weight: 400;\">2\uff0e\u4e0efile\u7684\u63a5\u53e3\uff1adevtable.c\u4e2d\uff0c\u5b9a\u4e49FLASH\u4e3a\u4e00\u4e2a\u8bbe\u5907\uff1b<\/p>\n<p style=\"font-weight: 400;\">3\uff0e\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u7684\u63a5\u53e3\uff1aos_intf.c\u4e2d\u3002<\/p>\n<p style=\"font-weight: 400;\">FMM\u7684API\u00a0\u00a0\uff08flsutil.c\uff09<\/p>\n<p style=\"font-weight: 400;\">ffms\u00a0\u00a0\uff1a\u683c\u5f0f\u5316DISK\uff0c\u4e4b\u524d\u5e94\u5f53\u4f7f\u7528\u5173\u95ed\u8be5\u6253\u5f00\u7684DISK\uff1b<\/p>\n<p style=\"font-weight: 400;\">finfo\u00a0\u00a0\uff1a\u663e\u793aFMM\u9a71\u52a8\u5668\u7684\u7edf\u8ba1\u4fe1\u606f\uff1b<\/p>\n<p style=\"font-weight: 400;\">sdelete\u00a0\uff1a\u5220\u9664\u90a3\u4e9b\u9884\u5b9a\u4e49\u7684sector\uff1b<\/p>\n<p style=\"font-weight: 400;\">clrdsec\u00a0\uff1a\u6e05\u9664\u90a3\u4e9b\u88ab\u6807\u8bb0\u4e3adirty\u7684sector\uff0c\u4f7f\u4e4b\u88ab\u91ca\u653e\uff1b<\/p>\n<p style=\"font-weight: 400;\">fmemtst\u00a0\uff1a\u67e5\u770b\u5b58\u50a8\u5668\u662f\u5426\u6709\u635f\u574f\uff0c\u6267\u884c\u5b83\u65f6\uff0c\u8bbe\u5907\u4f1a\u88ab\u683c\u5f0f\u5316\uff1b<\/p>\n<p style=\"font-weight: 400;\">cmp\u00a0\uff1a\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\uff1b<\/p>\n<p style=\"font-weight: 400;\">\n<p style=\"font-weight: 400;\">\u6839\u636eflsutil.c\u4e2d\u7684API\uff0c\u4ee5\u53cademo\u5b50\u76ee\u5f55\u4e0b\u7684nu_shell.c\uff0c\u5b9a\u5236\u4e86\u4e00\u7ec4API\uff1a<\/p>\n<p style=\"font-weight: 400;\">1\uff0e\u5728dskutil.c\u4e2d\uff1a<\/p>\n<p style=\"font-weight: 400;\">ll_format\uff0c\u5b8c\u6210\u7684\u662f\u4f4e\u7ea7\u7684\u683c\u5f0f\u5316\uff0c\u8981\u5c06FLASH\u5168\u90e8\u64e6\u9664\u4e00\u904d<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0dos_format\uff0c\u5b8c\u6210\u4e86\u9ad8\u7ea7\u683c\u5f0f\u5316\u3002<\/p>\n<p style=\"font-weight: 400;\">2\uff0e\u5728ftest\u4e2d<\/p>\n<p style=\"font-weight: 400;\">writefile\u00a0\uff1a\u5199\u4e00\u4e2a\u6587\u4ef6\u5230FLASH\uff0c\u8f93\u5165\u53c2\u6570\u662f\u6587\u4ef6\u7d22\u5f15\uff1b\u8c03\u7528\u7684\u662f\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684NU_Write\uff0c\u5f15\u5165\u7684\u53c2\u6570\u662f\u6587\u4ef6\u63cf\u8ff0\u6307\u9488\uff0c\u6e90\u6587\u4ef6\u7684buffer\u8d77\u59cb\u5730\uff0c\u4ee5\u53ca\u5199\u7684\u957f\u5ea6\uff1b<\/p>\n<p style=\"font-weight: 400;\">verifyfile\u00a0\u00a0\uff1a\u5b8c\u6210\u5199\u6587\u4ef6\u540e\u7684\u6821\u9a8c\uff0c\u8f93\u5165\u53c2\u6570\u662f\u6587\u4ef6\u7d22\u5f15\uff1b<\/p>\n<p style=\"font-weight: 400;\">deletefile\u00a0\u00a0\uff1a\u5b8c\u6210\u6587\u4ef6\u7684\u5220\u9664\uff0c\u8f93\u5165\u53c2\u6570\u662f\u6587\u4ef6\u7d22\u5f15\uff1b\u8c03\u7528\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684NU_Delete\uff0c\u5f15\u5165\u7684\u53c2\u6570\u4ec5\u4ec5\u662f\u6587\u4ef6\u540d\uff1b<\/p>\n<p style=\"font-weight: 400;\">cmp\u00a0\u00a0\uff1a\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\uff0c\u8f93\u5165\u7684\u53c2\u6570\u662f\u6587\u4ef6\u540d\uff1b<\/p>\n<p style=\"font-weight: 400;\">3\uff0e\u5728dtest\u4e2d\uff1a<\/p>\n<p style=\"font-weight: 400;\">fn_mkdir\u00a0\uff1a\u521b\u5efa\u5b50\u76ee\u5f55\uff0c\u8f93\u5165\u53c2\u6570\u662f\u5b50\u76ee\u5f55\u7684\u540d\u79f0\uff1b<\/p>\n<p style=\"font-weight: 400;\">fn_cd\u00a0\uff1a\u00a0\u8fdb\u5165\u5b50\u76ee\u5f55\uff0c\u8f93\u5165\u53c2\u6570\u662f\u5b50\u76ee\u5f55\u7684\u540d\u79f0\uff1b<\/p>\n<p style=\"font-weight: 400;\">fn_pwd\u00a0\uff1a\u663e\u793a\u5f53\u524d\u8def\u5f84\uff0c\u5b9a\u4e49\u4e86\u4e00\u4e2acur_dir\u5b58\u50a8\u8be5\u4fe1\u606f\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0fn_ls\u00a0\uff1a\u663e\u793a\u5f53\u524d\u8def\u5f84\u4e0b\u7684\u5b50\u76ee\u5f55\u6216\u6587\u4ef6\uff0c\u8c03\u7528\u4e86\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684NU_Get_First\uff0c\u5176\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e2d\u7684\u00a0\u53c2\u6570path\u53ef\u5b9a\u4e49\u4e3a\u201c*.*\u201d\u6216\u5176\u5b83\u5b57\u7b26\u3002<\/p>\n<h1>4\uff0e\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0FMM\u8c03\u8bd5\u95ee\u9898\u8bb0\u5f55<\/h1>\n<p style=\"font-weight: 400;\">1\uff0e\u5728\u67d0\u4e9b\u6587\u4ef6\u4e2d\u7c7b\u578b\u5b9a\u4e49\u9519\u8bef\uff1a\u4f8b\u5982Fmm.c\u4e2d\uff1a<\/p>\n<p style=\"font-weight: 400;\">rc == ERR_NOSEM\uff0c<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0rc = fmm_create_sem(&amp;name[0],1,SM_FIFO,&amp;fmm_info[unit].fmm_smid);\u7b49\u7b49\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0rc\u5b9a\u4e49\u4e3aULONG\uff0c\u4f46\u5728\u5f15\u7528\u65f6\uff0c\u53c8\u4e0e\u8d1f\u6570\u76f8\u6bd4\u8f83\u3002<\/p>\n<p style=\"font-weight: 400;\">2\uff0e\u5728FlashInit\u51fd\u6570\u4e2d\uff0c\u6d89\u53ca\u5230samphore\uff0c\u56e0\u6b64\u4e0d\u80fd\u5728Application_Initialize\u4e2d\u8c03\u7528\uff0c\u800c\u8981\u5728\u4efb\u52a1\u4e2d\u8c03\u7528\u8be5\u51fd\u6570\uff0c\u5e76\u4e14\u4e4b\u524d\u5e94\u6e05\u6389\uff1asm_id = 0x53454d41\uff08\u8be5\u503c\u5728\u521b\u5efasemphore\u65f6\u6240\u8d4b\u503c\uff09\uff0c\u6240\u91c7\u7528\u65b9\u5f0f\u662f\u5728\u4e4b\u524d\u6e05\u6389first_available_memory\u4e4b\u540e\u7684\u5185\u5b58\u533a\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5982\u679cFlashInit\u5b8c\u6210\u7684\u4e0d\u597d\uff0cformatflash\u4e2d\u4f1a\u51fa\u73b0FMM_NOTINUSE\u7684\u9519\u8bef\u3002<\/p>\n<p style=\"font-weight: 400;\">3\uff0e\u5728PCDISK.H\u4e2d\uff0c<\/p>\n<p style=\"font-weight: 400;\">\/* ============= ATI DRIVERS =============== *\/<\/p>\n<p style=\"font-weight: 400;\">\/* Set the following line to 1 if you purchased the IDE driver *\/<\/p>\n<p style=\"font-weight: 400;\">#define EBS_IDE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00<\/p>\n<p style=\"font-weight: 400;\">\/* Set the following line to 1 if you purchased the FLOPPY driver *\/<\/p>\n<p style=\"font-weight: 400;\">#define EBS_FLOPPY\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00<\/p>\n<p style=\"font-weight: 400;\">\/* Set the following line to 1 if you purchased the RAMDISK driver *\/<\/p>\n<p style=\"font-weight: 400;\">#define RAMDISK\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00<\/p>\n<p style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8981\u6dfb\u52a0\uff1a<\/p>\n<p style=\"font-weight: 400;\">#define INC_TRI_FMM\u00a0\u00a0\u00a0\u00a0\u00a01<\/p>\n<p style=\"font-weight: 400;\">4\uff0e\u6587\u4ef6\u7cfb\u7edf\u4e2d\u6240\u5f15\u7528\u7684\u6587\u4ef6\u540d\u548c\u76ee\u5f55\u540d\u90fd\u662f\u5927\u5199\u7684\uff0c\u56e0\u6b64\u5982\u679c\u8f93\u5165\u662f\u5c0f\u5199\uff0c\u5e94\u5f53\u505a\u4e00\u4e9b\u8f6c\u6362\uff0c\u5176\u4e2dstr2upper\u5c31\u662f\u4e3a\u6b64\u800c\u8c03\u7528\u7684\u3002<\/p>\n<p style=\"font-weight: 400;\">5\uff0e\u5bf9\u6bcf\u4e2asector\u524d\u7684\u4e00\u4e2a32\u4f4d\u7684\u5b57\uff0c\u540e8\u4f4d\u5728formsecmap\u4e2d\u5b9a\u4e49\uff0c\u5305\u62ecFMM_SECTOR_FREE\u00a0\u00a0\u00a0\u00a00xf0000000<\/p>\n<p style=\"font-weight: 400;\">FMM_SECTOR_DVALID\u00a0\u00a00xe0000000<\/p>\n<p style=\"font-weight: 400;\">FMM_SECTOR_INUSE\u00a0\u00a0\u00a00xc0000000<\/p>\n<p style=\"font-weight: 400;\">FMM_SECTOR_DIRTY\u00a0\u00a0\u00a00x80000000<\/p>\n<p style=\"font-weight: 400;\">\u5982FMM_SECTOR_DIRTY\uff0c\u5219\u4e3a0x80\uff1b<\/p>\n<p style=\"font-weight: 400;\">\u524d\u97628\u4f4d\u4ece0\u52300xff\u8bb0\u6570\u3002<\/p>\n<p style=\"font-weight: 400;\">6\uff0e\u5bf9Dirty sector\u6709\u4e00\u4e2a\u6e05\u9664\u7684\u547d\u4ee4\uff0c\u53ea\u6709\u5728\u4e00\u4e2aBLOCK\u4e2d\u88abDirty sector\u586b\u6ee1\u540e\u624d\u80fd\u6267\u884c\uff1b<\/p>\n<p style=\"font-weight: 400;\">7\uff0e\u5728file system\u4e2d\uff0c\u4e00\u4e9b\u7cfb\u7edf\u8c03\u7528NU_*\u51fd\u6570\uff0c\u90fd\u6709\u76f8\u5e94\u7684po??_*\u5185\u90e8\u51fd\u6570\uff0c\u57281.0\u7248\u672c\u4e2d\uff0c\u6ca1\u6709NU_Truncate\u53ea\u6709PO?_\uff0c\u5c06\u5b83\u6539\u4e3aNU?_\u3002\u4f46\u8981\u6ce8\u610f\u8fd9\u4e24\u7c7b\u51fd\u6570\u7684\u8fd4\u56de\u503c\u6b63\u597d\u76f8\u53cd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fc1\u79fb\u81eahttp:\/\/adaishu.blog.163.com\/blog\/static\/175831286201 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[26,27,25],"class_list":["post-79","post","type-post","status-publish","format-standard","hentry","category-6","tag-flash","tag-fmm","tag-necleus"],"views":1745,"_links":{"self":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/79","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79"}],"version-history":[{"count":1,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":80,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions\/80"}],"wp:attachment":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}