博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OK6410A 开发板 (三) 24 u-boot-2021.01 boot 解析 U-boot 镜像运行部分 fs-fat
阅读量:4285 次
发布时间:2019-05-27

本文共 2996 字,大约阅读时间需要 9 分钟。

  • 相关配置
CONFIG_CMD_FAT=y
  • 相关文件
fs/fat/fat.cfs/fs_internal.cfs/fs.ccmd/fat.c
  • 命令及命令的使用
fatinfo   - print information about filesystemfatload   - load binary file from a dos filesystemfatls     - list files in a directory (default /)fatsize   - determine a file's size=> fatinfo mmc 0:1 Interface:  MMC  Device 0: Vendor: Man 0000fe Snr 00023d01 Rev: 0.0 Prod: SD16G             Type: Removable Hard Disk            Capacity: 30474.0 MB = 29.7 GB (62410752 x 512)Filesystem: FAT16 "NO NAME => fatload mmc 0:1 0x50008000 uImage1828792 bytes read in 277 ms (6.3 MiB/s)=> fatls mmc 0:1                      1828792   uImage1 file(s), 0 dir(s)=> fatsize mmc 0:1 uImage// 没有任何打印

命令解析

可以从命令解析的角度了解 fat fs
  • fatinfo
do_fat_fsinfo											cmd/fat.c	blk_get_device_part_str								disk/part.c 								fat_set_blk_dev 									fs/fat/fat.c	file_fat_detectfs 									fs/fat/fat.c		printf("\n  Device %d: ", cur_dev->devnum);		dev_print(cur_dev);								disk/part.c		read_bootsectandvi(&bs, &volinfo, &fatsize)		fs/fat/fat.c		memcpy(vol_label, volinfo.volume_label, 11)		vol_label[11] = '\0';		volinfo.fs_type[5] = '\0';		printf("Filesystem: %s \"%s\"\n", volinfo.fs_type, vol_label);
  • fatls
do_fat_ls																cmd/fat.c	do_ls 																fs/fs.c		fs_set_blk_dev 													fs/fs.c			blk_get_device_part_str 									disk/part.c			info->probe/fat_set_blk_dev 								fs/fat/fat.c		fs_ls 															fs/fs.c			struct fstype_info *info = fs_get_info(fs_type); 			fs/fs.c			info->ls(dirname);/fs_ls_generic							fs/fs.c				fs_opendir												fs/fs.c					struct fstype_info *info = fs_get_info(fs_type); 	fs/fs.c					info->opendir(filename, &dirs);/fat_opendir			fs/fat/fat.c											dirs->desc = fs_dev_desc;							fs/fs.c					dirs->part = fs_dev_part; 							fs/fs.c				while(dent = fs_readdir(dirs))							fs/fs.c					switch(dent->type){
case FS_DT_DIR: printf(" %s/\n", dent->name);break; case FS_DT_LNK: printf("
%s\n", dent->name);break; default: printf(" %8lld %s\n", dent->size, dent->name);break; } fs_closedir fs/fs.c printf("\n%d file(s), %d dir(s)\n\n", nfiles, ndirs);
  • fatload
do_fat_fsload															cmd/fat.c	do_load 															fs/fs.c		_fs_read														fs/fs.c			fs_read_lmb_check											fs/fs.c			info->read/file_fat_read_at									fs/fat/fat.c				malloc_cache_aligned									include/memalign.h				fat_itr_root// 填充itr									fs/fat/fat.c				fat_itr_resolve											fs/fat/fat.c				get_contents // 搬运数据									fs/fat/fat.c					get_cluster											fs/fat/fat.c						disk_read(startsect, idx, buffer);				fs/fat/fat.c							blk_dread									drivers/block/blk-uclass.c						if (size)disk_read(startsect, 1, tmpbuf);						memcpy(buffer, tmpbuf, size);		printf("%llu bytes read in %lu ms", len_read, time);

应用

=> fatload mmc 0:1 51000000 2led_c.bin1049 bytes read in 20 ms (50.8 KiB/s)=> go 51000000## Starting application at 0x51000000 ...// 此时会看到 led灯闪烁// 一定要主要加载地址和链接地址和运行地址的关系

转载地址:http://gbigi.baihongyu.com/

你可能感兴趣的文章
beego实战笔记
查看>>
提取非行间样式
查看>>
<<go语言实战>>读书笔记
查看>>
makefile的学习
查看>>
ascll和unicode对应的char,wchar_t存储字符
查看>>
vc滚动条 WM_VSCROLL消息16位屏障问题
查看>>
mfc CEdit焦点获取
查看>>
mfc动态按钮
查看>>
vs 获取当前程序文件的路径方法
查看>>
vc 回调函数
查看>>
Marddown学习
查看>>
Mac os中idea使用try catch快捷键
查看>>
无器械健身读后精简
查看>>
狂神说java,html5基础知识讲解全总结
查看>>
Mac idea 替换快捷键
查看>>
CSS3 position sticky固定定位失败的原因
查看>>
狂神说Java CSS3讲解综合代码
查看>>
springboot-mybaits 的mapper文件中使用insert into xx values(xxx) on duplicate key update
查看>>
python-day2 python的基本语法(注释,运算符,数据类型,在python中,定义变量时,不需要指定变量的类型的)
查看>>
Springboot-data-es 自动创建mapping(mapping的数据结构为空)以及自动添加新字段(生成mapping的数据结构)
查看>>