歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

u-boot中的FAT命令

[u-boot: v2013.04]

[Author: Bo Shen <[email protected]>]

1. Source Code

<common/cmd_fat.c>

此文件中定義了四個命令:fatload,fatls,fatinfo是定義"#define CONFIG_CMD_FAT"後就包括了。而fatwrite是需要再定義"#define CONFIG_FAT_WRITE"才會出現。

 

2. Usage

在使用FAT相關命令的時候,一定會有FAT文件系統的存儲設備,此處舉例使用U盤。

 

U-Boot> fatinfousb 0 Interface: USB Device 0: Vendor: Kingston Rev: PMAP Prod: DataTraveler G3 Type: Removable Hard Disk Capacity: 7441.6 MB = 7.2 GB (15240576 x 512) Filesystem: FAT32 "KINGSTON " U-Boot> fatlsusb 0 166 autorun.inf 39334 tbi.png 43134 tbi_2.png 43006 tms.png 55191 tck.png 57357 rtck.png 53981 tdo.png 7 file(s), 0 dir(s)   U-Boot> fatloadusb 0 0x20000000 tbi.png reading tbi.png 39334 bytes read in 161ms (244.3 KiB/s)   3. Source Code go through 3.1 fatls --> do_fat_ls <common/cmd_fat.c> --> do_ls <fs/fs.c> --> fs_set_blk_dev <fs/fs.c> --> fs_ls <fs/fs.c> --> return 0; 3.1.1 fs_set_blk_dev <fs/fs.c> --> get_device_and_partition <disk/part.c> --> (callback: fstype_info->probe) <fs/fs.c> 3.1.2 fs_ls <fs/fs.c> --> fs_get_info <fs/fs.c> --> (callback: fstype_info->ls) <fs/fs.c>   3.2 fatinfo --> do_fat_fsinfo <common/cmd_fat.c> --> get_device_and_partition <disk/part.c> --> fat_set_blk_dev <fs/fat/fat.c> --> file_fat_detectfs <fs/fat/fat.c> 3.2.1 fat_set_blk_dev <fs/fat/fat.c> --> disk_read <fs/fat/fat.c> 3.2.2 file_fat_detectfs <fs/fat/fat.c> --> dev_print <disk/part.c> --> read_bootsectandvi <fs/fat/fat.c>   3.3 fatload --> do_fat_fsload --> do_load <fs/fs.c> --> fs_set_blk_dev < fs/fs.c> --> fs_read (callback: fstype_info->read)
Copyright © Linux教程網 All Rights Reserved