Fat command in U-boot

Source: Internet
Author: User

[U-boot: v2013.04]

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

1. Source Code

<Common/cmd_fat.c>

This file defines four commands: fatload, fatls, and fatinfo: Definition "# define
Config_pai_fat "is included. Fatwrite requires "# define config_fat_write" to appear.


2. Usage

When using fat-related commands, there must be a storage device of the FAT file system. Here, we use a USB flash disk as an example.

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 (15240576x512) 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 161 Ms (244.3 kib/S) 3. source code go through3.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/common_fat.c> --> get_device_and_partition <Disk/part. c> --> fat_set_blk_dev <fs/fat. c> --> file_fat_detectfs <fs/fat. c> 3.2.1 fat_set_blk_dev <fs/fat. c> --> disk_read <fs/fat. c> 3.2.2 file_fat_detectfs <fs/fat. c> --> dev_print <Disk/part. c> --> read_bootsectandvi <fs/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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.