该文章介绍了Nor Flash的基本原理、基本操作以及驱动程序的基本使用。它还提供了在用户空间中驱动Nor Flash设备的示例代码。文章还讨论了如何使用MTD设备来模拟Nor Flash,并展示了如何编写简单的用户空间应用程序来与Nor Flash进行通信。
在系统设计时,在PetaLinux工程里,为boot.bin预留多个启动分区。使用命令cat /proc/mtd或者ls /dev/mtd*,看得到多个分区。
1.本节使用的nand flash型号为K9F2G08U0M,它的命令如下: 1.1我们以上图的read id(读ID)为例,它的时序图如下: 首先需要使能CE片选 1)使能CLE 2)发送0X90命
NAND FLASH 原理以及操作详见:https://blog.csdn.net/qq_16933601/article/details/100001443
NAND FLASH版本和eMMC版本核心板使用方法基本一致。本文主要描述U-Boot编译、基础设备树文件编译、固化Linux系统NAND FLASH分区说明和NAND FLASH启动系统、固化Linux系统、AND FLASH读写测试等,NAND FLASH版本与eMMC版本核心板在使用方面的不同之处,相同之处将不重复描述。
NOR FLASH硬件原理参考:https://blog.csdn.net/qq_16933601/article/details/102653367
因为在做系统升级,AOSP的recovery下有一个flash_image工具,这个工具可以在开机状态下刷写系统分区。源码位置在/bootable/recovery/mtdutils/flash_image.c。
查看分区格式 # df -hT // ext4 文件格式 Filesystem Type Size Used Available Use% Mounted on /dev/system ext4 2.0G 112.4M 1.8G 6% / devtmpfs devtmpfs 107.2M 0 107.2M 0% /dev tmpf
下面是小米路由器折腾记录,包括开启 SSH,然后安装 MT 工具箱,主要是为了其中的两个插件,一个是去广告,一个是 SS 代理,不过附带竟然发现了 frp 插件,开心啊。下面就是具体的记录。
Linux ubuntu 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
文件系统是操作系统用于明确磁盘或分区上的文件的方法和数据结构; 即在磁盘上组织文件的方法。也指用于存储文件的磁盘或分区
4# sudo .armmix410-linux.install opthisi-linuxx86-arm 指定安装路径:opthisi-linuxx86-arm,如果不带这个参数默认安装路径为:optlinuxx86-arm
在板子上观察到56M的ubi卷,挂载上ubifs之后,df -h显示可用空间约为50M。 如此计算开销超过了10%,那么这个开销随容量如何变化呢,是固定为10%吗还是有其他规律?
如上图,问题都是出在fs/yaffs2/下,很多error都讲述:调用的成员名,在struct mtd_info结构体里没有定义.
廖威雄,就职于珠海全志科技股份有限公司,负责Linux IO全栈研发、性能优化、开源社区开发交流、Linux 内核开源社区pstore/blk,mtdpstore模块的作者、大客户存储技术支持、全志首个UBI存储方案主导人、全志首个RTOS NFTL主导人
Windows 开发环境: Windows 7 64bit 、Windows 10 64bit
很长一段时间,nand flash都是嵌入式的标配产品。nand flash价格便宜,存储量大,适用于很多的场景。现在很普及的ssd,上面的存储模块其实也是由一块一块nand flash构成的。对于linux嵌入式来说,开始uboot的加载是硬件完成的,中期的kernel加载是由uboot中的nand flash驱动完成的,而后期的rootfs加载,这就要靠kernel自己来完成了。当然,这次还是以三星s3c芯片为例进行说明。
pstore文件系统(是的,这是个文件系统)是Persistent Storage的缩写,最早在2010年由 Tony Luck 设计并合入Linux主分支,设计的初衷是在内核Panic/Oops时能自动转存内核日志(log_buf),在Panic重启后,把转存的日志以文件形式呈现到用户空间以分析内核崩溃问题。
本文打造一个迷你的LINUX系统,讲述了arm嵌入式设备的常用方法和过程。适合新手入门,当然最好还是知道什么是交叉编译,和懂得linux的基本命令。
基于测试板卡:创龙科技TLIMX6U-EVM是一款基于NXP i.MX 6ULL的ARM Cortex-A7高性能低功耗处理器设计的评估板,由核心板和评估底板组成。核心板经过专业的PCB Layout和高低温测试验证,稳定可靠,可满足各种工业应用环境。
之前系列的文章介绍了如何编译Uboot、Kernel以及使用默认的ramdisk根文件系统来构建一个完整的嵌入式Linux系统,本篇文章介绍如何从头制作一个放在NAND Flash上的根文件系统。经过我这段时间的总结,rootfs相关的编译、配置等工作还是比较麻烦的。所以你可能会看到一般做核心板的第三方厂家会建议初学者直接使用现成提供的文件系统,比如一个做NUC972核心板的厂家,其文档里这么描述:
模块被加载后,在/sys/module/目录下降出现以此模块名命名的目录 root@dm368-evm:/sys/module# ls 8250 lockd snd_pcm_oss tuner_simple cmemk mt20xx snd_timer tuner_xc2028 davinci_display mt9p031 soundcore tvp514x davinci_enc_mngr musb_hdrc spurious usb_storage davinci_mmc netpoll sunrpc usbcore davincifb nfs tcp_cubic usbserial dm365_imp option tda8290 usbtest dm365mmap printk tda9887 videobuf_core edmak scsi_mod tea5761 videobuf_vmalloc irqk snd tea5767 vpfe_capture kernel snd_pcm ths7303 xc5000 root@dm368-evm:/sys/module#
内核启动并初始化后,最终目的是像Windows一样能启动应用程序,在windows中每个应用程序都存在C盘、D盘等,而linux中每个应用程序是存放在根文件系统里面,那么挂载根文件系统在哪里,怎么实现
u-boot是一种普遍用于嵌入式系统中的Bootloader,Bootloader是在操作系统运行之前执行的一小段程序。他可以用来恢复小米路由器的固件,可以说只要刷了uboot,你的路由器基本上刷不死了。 以下操作都是在你获取了root信息后才可以实现。 2015年11月10日更: 刷uboot属于高危操作,如果你觉得刷了以后出现问题自己不一定Hold的住,请止步,谢谢合作! 如果造成不可挽回的损失,老高也没辙。。。 2015年9月17日更: 新版固件不要刷uboot了,会造成很多问题。 20
介绍TinaLinux Flash,分区,文件系统等存储相关信息,指导方案的开发定制。
类似于Windows下的C、D、E等各个盘,Linux系统也可以将磁盘、Flash等存储设备划分为若干个分区,在不同分区存放不同类别的文件。与Windows的C盘类似,Linux一样要在一个分区上存放系统启动所必需的文件,比如内核映象文件(在嵌入式系统中,内核一般单独存放在一个分区中)、内核启动后运行的第一个程序(init)、给用户提供操作界面的shell程序、应用程序所依赖的库等。这些必需的、基本的文件,合称为根文件系统,它们存放在一个分区中。Linux系统启动后首先挂接这个分区──称为挂接(mount)根文件系统。其他分区上所有目录、文件的集合,也称为文件系统,比如我们常说:“挂接硬盘第二个分区”、“挂接硬盘第二个分区上的文件系统”。
/*Nand Flash驱动分析*/ /*首先: 市面上的开发板很多,Nand Flash差不多都一样。先说说Nand Flash的特性*/ /* 上图是OK6410开发板的Nand Flash原理图,从上图可知: 1. 数据线和地址线明显是公用的。因为只看见了DATA0-DATA7没看见地址线。作为一个存储芯片当然要写数据,读数据。当然需要地址线。 2. DATA0-DATA7在好多地址被使用了,那怎么区分当前是那个芯片。那当然要CSN2和CSN3来控制当前选中那个芯片,也就是让那个芯片工作。 3.
所用格式”,然后在弹开的窗口上,“预设”项选择“PNG-24”,保存为android_logo.png
本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明.
You can not change the society will have to adapt to the need to be eliminated! This is the survival of the fittest!
我在用TI的dm368开发板,kernel是2.6.32.17,默认的flash文件系统是jffs2,但是jffs2在大分区下,mount速度很慢,而且占用ram较多,因此,我想使用ubifs看看性能是否会更好些。
UBI全称是Unsorted Block Images,上图为UBI在系统中的层次结构,最下面是flash层(包括flash控制器,各个flash驱动代码,spi-mem层等);MTD层是对flash层的抽象,一个flash可能被划分成不同的分区,每一个分区都会对应一个MTD设备;UBI层是基于MTD层之上的更高层,UBI层抽象出一个个逻辑擦写块,每个逻辑擦写块都有一个物理擦写块与之前对应,有了这个映射,我们就可以加一些软件算法,达到擦写均衡的目的,从而提高flash的使用寿命;再往上是基于UBI层实现和各种文件系统,比如UBIFS。
本地用户空间层在 Android 操作系统的安全配置中起到重要作用。 不理解在该层上发生了什么,就不可能理解在系统中如何实施安全架构决策。 在本章中,我们的主题是 Android 引导过程和文件系统特性的,并且描述了如何在本地用户空间层上保证安全性。
本篇继续安全系列之介绍,继续学习用户空间安全!本系列内容比较多,需要一步步的跟进。上期学习了android Linux安全介绍,下篇继续介绍android framwork层安全。
本文主要为嵌入式入门开发者的接口、网口等板卡基础快速测试,当初级学习的开发者拿到板卡,如何在最快时间内测试板卡正常?继续测试教程(1)的系统启动、文件传送、LED等测试部分,接下来是测试板卡的按键、时钟设置、DDR读写、Micro SD接口读写、eMMC读写测试等基础性能、功能是否正常。
1.安装mkyaffsimage, mkyaffs2image命令(用来制作yaffs文件系统)
SWUpdate使用库“libconfig”作为镜像描述的默认解析器。 但是,可以扩展SWUpdate并添加一个自己的解析器, 以支持不同于libconfig的语法和语言。 在examples目录中,有一个用Lua编写的,支持解析XML形式 描述文件的解析器。
上面的Flash: *** failed *** 是属于uboot第二阶段函数board_init_r()里的代码, 代码如下所示(位于arch/arm/lib/board.c):
ntfs-3g 集成 1. 下载 http://www.tuxera.com/community/ntfs-3g-download/ ntfs-3g-2010.8.8 2. 建立makefile a. 参考gstreamer/makefile 大概把 gstreamer改成ntfs_3g和ntfs-3g,GSTREAMER改成NTFS_3G,设置版本,源码包等。 b. 定义option_configure_args c. 取消install过程 根据需要确定是否--enable-debug 3. 编译 $make -C src/thirdparty/ntfs-3g/ remove 在Huangpu/makefile下面加入对ntfs-3g的编译目标,然后$make ntfs-3g 4. 运行 a. 把编译的结果mount到机顶盒 pc: #ln -s /home/qianjiang/apollo/sw/ga300/target/output/objs/summit-dualhd-gnu-4.4.0-linux-debug/comps/generic_apps/ ~/nfsroot/apps apollo: # mount -t nfs -o rw,tcp,nolock,nfsvers=3 192.168.2.2:/home/qianjiang/nfsroot/apps mnt/apps/ b. 把目标文件拷贝到/bin和/lib下面 # cp mnt/apps/ntfs-3g/ntfs-3g-2010.8.8/libntfs-3g/.libs/libntfs-3g.so* /lib/ # cp mnt/apps/ntfs-3g/ntfs-3g-2010.8.8/src/.libs/ntfs-3g /bin/ # ntfs-3g --help 注意: 曾经运行src下面的ntfs-3g得到异常的问题: # /mnt/apps/ntfs-3g/ntfs-3g-2010.8.8/src/ntfs-3g -/bin/sh: /mnt/apps/ntfs-3g/ntfs-3g-2010.8.8/src/ntfs-3g: not found 网上说可能是相关库文件找不到,应该拷贝至/lib或者设置LD_LIBRARY_PATH,但是都未奏效。而且pc下运行也没问题,ldd ntfs-3g表明是无动态链接库。所以,很奇怪! 5. 调试 # ntfs-3g /dev/sda4 mnt/sda/ modprobe: module 'fuse' not found ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root 注: 曾经可没有这么好的出现提示,而是死机,,,所以。。。 6. 加入fuse 6.1 pc #cd target/src/sd/os/oslinux/comps/kernel/linux-2.6.28.10/ #cp target/output/objs/pnx8473_hirf_moca_mp1_mtd_debug/.config ./ #make menuconfig => 选中fuse文件系统 #make modules #cp fs/fuse/fuse.ko /home/qianjiang/nfsroot/appfs/lib/modules/2.6.28.10/extra/ 注:这里对kernel的编译可能不是Official的方式。 6.2 apollo #insmod fuse.ko 7. 测试 7.1写测试 ==> OK 7.2性能测试 ===> 写hello.sh date cp mnt/sda/GA300_full_src.tar.gz mnt/sda/GA300_full_src.tar.gz1 umount mnt/sda date # sh hello.sh Wed Dec 31 17:06:19 MST 1969 Unmounting /dev/sda4 () Wed Dec 31 17:19:44 MST 1969 (read + write)bs = 1608602770(file size) * 8 / 805(time) = 15.3Mbits/s 8. 集成和check in 8.1 file: pnx8473_hirf_moca_mp1_mtd_debug_defconfig enable fuse 8.2 Huangpu/makefile add make target: ntfs-3g
OpenWRT是一个高度模块化、高度自动化的嵌入式Linux系统,可以让路由器变得更智能,简单的说,路由器刷了OpenWrt就相当于一个Linux系统带无线带多网卡的电脑。
NXP i.MX8M Mini烧录固件的方式主要通过uuu工具进行烧录, 这个工具本身开源,但是提供给开发者烧录的方式及其不友好, 不得不吐槽。
在si里搜索上图出现的”S3C2410 flash partition”字段,找到位于common-smdk.c中,里面有个数组smdk_default_nand_part[],内容如下所示:
SPI NOR Framework:这层主要是处理不同厂家的NOR 物理特色差异,初始化SPINOR的工作状态,如工作线宽(1 线、2 线、4 线、8 线)、有效地址位(16M 以上的NOR 需要使用4 地址模式),为上层MTD 提供读写擦接口。
因为mtd的kernel分区只有2M大,而实际内核有2.37MB,所以需要裁剪到小于2M(或者修改mtd分区值)
拿到一块YC2440(s3c2440)的开发板,经过几天的学习,我对arm-linux系统开发步骤有了一些认识。就以开发这个开发板为例,arm-linux开发工作大概分4个部分
刷机 恩山无线论坛 小米路由器4C 刷 OpenWrt 废话不多说哈 dd if=/dev/mtd0 of=/tmp/all.bin dd if=/dev/mtd1 of=/tmp/bootloader.bin dd if=/dev/mtd3 of=/tmp/eeprom.bin # nc -l 9995 > all.bin [ mi4c ] nc 10.0.1.162 9995 < /tmp/all.bin nc -l 9995 > bootloader.bin [ mi4c ] nc 10.0.1.16
SDK切换存储介质需要修改board.dts、sys_config.fex、内核配置、TINA系统配置。另外,在spinor 存储介质下,通过 u-boot-sun8iw21p1.bin 进行烧录,u-boot-spinor-sun8iw21p1.bin 启动,使用sys_partition_nor.fex作为分区表。在非spinor介质(spinand、emmc、sdnand),通过u-boot-sun8iw21p1.bin进行烧录和启动,使用sys_partition.fex作为分区表。下文将介绍spinor切换spinand、spinand切换spinor、spinor切换emmc、spinor切换sdnand四种切换方式。
rdma The RDMA I/O engine supports both RDMA memory semantics (RDMA_WRITE/RDMA_READ) and channel semantics (Send/Recv) for the InfiniBand, RoCE and iWARP protocols. falloc IO engine that does regular fallocate to simulate data transfer as fio ioengine. DDIR_READ does fallocate(,mode = keep_size,) DDIR_WRITE does fallocate(,mode = 0) DDIR_TRIM does fallocate(,mode = punch_hole) e4defrag IO engine that does regular EXT4_IOC_MOVE_EXT ioctls to simulate defragment activity in request to DDIR_WRITE event rbd IO engine supporting direct access to Ceph Rados Block Devices (RBD) via librbd without the need to use the kernel rbd driver. This ioengine defines engine specific options. gfapi Using Glusterfs libgfapi sync interface to direct access to Glusterfs volumes without options. gfapi_async Using Glusterfs libgfapi async interface to direct access to Glusterfs volumes without having to go through FUSE. This ioengine defines engine specific options. libhdfs Read and write through Hadoop (HDFS). The 'filename' option is used to specify host, port of the hdfs name-node to connect. This engine interprets offsets a little differently. In HDFS, files once created cannot be modified. So random writes are not possible. To imitate this, libhdfs engine expects bunch of small files to be created over HDFS, and engine will randomly pick a file out of those files based on the offset generated by fio backend. (see the example job file to create such files, use rw=write option). Please note, you might want to set necessary environment variables to work with hdfs/libhdfs properly. mtd Read, write and erase an MTD character device (e.g., /dev/mtd0). Discards are treated as erases. Depending on the underlying device type, the I/O may have to go in a certain pattern, e.g., on NAND, writing sequentially to erase blocks and discarding before overwriting. The w
领取专属 10元无门槛券
手把手带您无忧上云