u-boot中的FAT命令

  • A+
所属分类:Linux编程
摘要

[u-boot: v2013.04] [Author: Bo Shen ] 1. Source Code 此文件中定义了

[u-boot: v2013.04]

[Author: Bo Shen <voice.shen@gmail.com>]

1. Source Code

<common/cmd_fat.c>

此文件中定义了四个命令:fatload,fatls,fatinfo是定义"#define CONFIG_CMD_FAT"后就包括了。而fatwrite是需要再定义"#define CONFIG_FAT_WRITE"才会出现。

 

2. Usage

U-Boot>
fatinfo
usb 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>
fatls
usb 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>
fatload
usb 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)

weinxin
欢迎加入中国站长博客之家
本站的所有资源都会上传分享到博客之家,希望大家互相学习交流进步。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: