📄 fs.c
字号:
/*
fs.c copyrigh by robin @2004.6.30
*/
// fs /p
#include "string.h"
#include "txstdio.h"
#include "..\txlib\txlib.h"
#include "..\file\file.h"
#include "..\file\fat.h"
#define printf kprintf
extern VOL SysVolume[] ;
extern char strHelp[];
void FileSystemUsage()
{
printf("Usage : fs [/a],[/help]\n");
printf(" a : show all the file system infomation.\n");
printf(" help : show how to use fs.\n");
}
int FileSystem(int argc,char ** argv)
{
int i = 0;
DWORD dwAll = 0;
DWORD dwHelpFlag = 0;
for( i = 1 ; i < argc ; i++)
{
if(argv[i][0] == '-' || argv[i][0] == '/')
{
if(argv[i][1] == 'a' || argv[i][1] == 'A')
dwAll = 1;
else if(argv[i][1] == 'h' || argv[i][1] == 'H')
{
upcase(argv[i]);
if(strcmp(&(argv[i][1]),strHelp) == 0) dwHelpFlag = 1;
else {
printf("some file system parameter invalid,check it out!");
return 0;
}
}
}
else{
printf("some file system parameter invalid,check it out!");
return 0;
}
}
if( argc == 1 ) {
FileSystemUsage();
return 1;
}
if(dwAll == 1)
{
for ( i = 0 ; i < 8 && SysVolume[i].dwVolType != 0 ; i++)
{
printf("Device name : %s ",SysVolume[i].strName);
printf("Device ID : 0x%02x ", SysVolume[i].dwDevID);
printf("Volume type : 0x%02x\n",(SysVolume[i].dwVolType) & 0xff);
printf("Volume Start: 0x%08x ", SysVolume[i].dwStartSector);
printf("Volume Total: 0x%08x\n", SysVolume[i].dwVolumeTotSec);
printf("Volume parameter block :\n\t Total : 0x%08x , Secperclus : %4d \n\tData region : 0x%08x ,Clustor : 0x%08x\n\n",
((PFATPB)(SysVolume[i].dwVolParam))->dwTotSec,
((PFATPB)(SysVolume[i].dwVolParam))->dwSecPerClus,
((PFATPB)(SysVolume[i].dwVolParam))->dwDataSec,
((PFATPB)(SysVolume[i].dwVolParam))->dwCountofClusters
);
}
return 1;
}
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -