qe express全部
5、
Structure needs cleaning
重新挂载,
还不行的话重新
dd if=/dev/zero of=rootfs.ext3 bs=1M count=32 mkfs.ext3 rootfs.ext3
4、
-/bin/sh: : not found
把依赖的两个动态库都拷贝进去(弄完应看起来ok了)
cp 直接把库拷贝进去
cp -d 拷贝的只是符号链接
[10145657@zte.intra@LIN-2F8AC9DC590 01_chrdevbase]$ arm-linux-gnueabihf-readelf -d a.out Dynamic section at offset 0x704 contains 24 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000c (INIT) 0x10378 0x0000000d (FINI) 0x10660 0x00000019 (INIT_ARRAY) 0x206f8 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x0000001a (FINI_ARRAY) 0x206fc
[ 01_chrdevbase]$ arm-linux-gnueabihf-readelf -d /mymnt/lib/libc.so.6 Dynamic section at offset 0xdaf10 contains 26 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3] 0x0000000e (SONAME) Library soname: [libc.so.6] 0x0000000c (INIT) 0x16205 0x0000001a (FINI_ARRAY) 0xe96ac 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x00000004 (HASH) 0xd5c00 0x6ffffef5 (GNU_HASH) 0x1b8 0x00000005 (STRTAB) 0xc5e8 0x00000006 (SYMTAB) 0x3be8 0x0000000a (STRSZ) 22969 (bytes) [01_chrdevbase]$ arm-linux-gnueabihf-readelf -d /mymnt/lib/ld-linux-armhf.so.3 Dynamic section at offset 0x17f44 contains 19 entries: Tag Type Name/Value 0x0000000e (SONAME) Library soname: [ld-linux-armhf.so.3] 0x00000004 (HASH) 0x138 0x6ffffef5 (GNU_HASH) 0x1f8 0x00000005 (STRTAB) 0x4a4 0x00000006 (SYMTAB) 0x2d4 0x0000000a (STRSZ) 419 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000003 (PLTGOT) 0x28000
3
busybox文系主要看这个
https://www.zhaixue.cc/qemu/qemu-build_busybox_rootfs.html
2、
qemu vexpress 主要看这个
https://www.jianshu.com/p/94833e841742
编busybox make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j32 install mkdir mnt proc root sys tmp var #不加dev下面没东西 dd if=/dev/zero of=rootfs.ext3 bs=1M count=32 mkfs.ext3 rootfs.ext3 sudo mount -t ext3 rootfs.ext3 /mymnt -o loop sudo umount /mymnt
# sudo mount -t ext3 rootfs.ext3 /mymnt -o loop
# sudo cp -rf rootfs/* /mymnt/
# sudo umount /mymnt
du -h --max-depth=0
1、
[XXX tools]$ sudo umount /mymnt
umount: /mymnt: target is busy.
[ tools]$ fuser -mv /mymnt/ 用户 进程号 权限 命令 /mymnt: root kernel mount /mymnt 10145657@zte.intra 15025 ..c.. bash [ tools]$ fuser -kv /mymnt/ 用户 进程号 权限 命令 /mymnt: root kernel mount /mymnt 10145657@zte.intra 15025 ..c.. bash [ tools]$ sudo umount /mymnt [ tools]$ sudo mount -t ext3 rootfs.ext3 /mymnt -o loop [ tools]$
6、第一个test
[root@vexpress my]# cat /proc/devices Character devices: 1 mem 2 pty 3 ttyp 4 /dev/vc/0 4 tty 5 /dev/tty 5 /dev/console 5 /dev/ptmx 7 vcs 10 misc 13 input 29 fb 90 mtd 116 alsa 128 ptm 136 pts 180 usb 189 usb_device 200 chrdevbase 204 ttyAMA 251 rpmb 252 usbmon 253 rtc 254 gpiochip Block devices: 8 sd 31 mtdblock 65 sd 66 sd 67 sd [root@vexpress my]# mknod /dev/chrdevbase c 200 0 [root@vexpress my]# ls /dev/chr* /dev/chrdevbase [root@vexpress my]# ./a.out /dev/chrdevbase 1 kernel senddata ok! read data:kernel data!