第18节:编写一个helloworld通过烧写system.img执行hello程序
1)拷贝hell文件到system的bin目录下
root@ubuntu:/home/linuxsystemcode/helloworld# cp -r hello /home/minilinux/system/bin
root@ubuntu:/home/linuxsystemcode/helloworld# cd /home/minilinux/system/bin
root@ubuntu:/home/minilinux/system/bin# ls -l hello
-rwxr-xr-x 1 root root 648462 Feb 17 00:01 hello
2)通过OTG线将开发板与电脑相连接
3)在超级终端中输入fastboot命令
[Partition table on MoviNAND]
ptn 0 name='bootloader' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
ptn 1 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 2 name='ramdisk' start=N/A len=0x300000(~3072KB) (use hard-coded info. (cmd: movi))
ptn 3 name='Recovery' start=N/A len=0x600000(~6144KB) (use hard-coded info. (cmd: movi))
ptn 4 name='system' start=0x15DDA00 len=0x403B0600(~1052353KB)
ptn 5 name='userdata' start=0x4198E000 len=0x403B0600(~1052353KB)
ptn 6 name='cache' start=0x81D3E600 len=0x1321EC00(~313467KB)
ptn 7 name='fat' start=0x94F5D200 len=0x3BAFB600(~977901KB)
4)烧入system.img文件系统
E:\USB_fastboot_tool\platform-tools>fastboot.exe flash system system.img
sending 'system' (15197 KB)...
OKAY [ 2.298s]
writing 'system'...
OKAY [ 2.585s]
finished. total time: 4.882s
5)重启开发板系统
6)进入bin目录查看并执行hello文件
[root@iTOP-4412]# ls -l hello
-rwxr-xr-x 1 root 0 648462 Feb 17 2018 hello
[root@iTOP-4412]# ./hello
Hello World!
1)拷贝hell文件到system的bin目录下
root@ubuntu:/home/linuxsystemcode/helloworld# cp -r hello /home/minilinux/system/bin
root@ubuntu:/home/linuxsystemcode/helloworld# cd /home/minilinux/system/bin
root@ubuntu:/home/minilinux/system/bin# ls -l hello
-rwxr-xr-x 1 root root 648462 Feb 17 00:01 hello
2)通过OTG线将开发板与电脑相连接
3)在超级终端中输入fastboot命令
[Partition table on MoviNAND]
ptn 0 name='bootloader' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
ptn 1 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 2 name='ramdisk' start=N/A len=0x300000(~3072KB) (use hard-coded info. (cmd: movi))
ptn 3 name='Recovery' start=N/A len=0x600000(~6144KB) (use hard-coded info. (cmd: movi))
ptn 4 name='system' start=0x15DDA00 len=0x403B0600(~1052353KB)
ptn 5 name='userdata' start=0x4198E000 len=0x403B0600(~1052353KB)
ptn 6 name='cache' start=0x81D3E600 len=0x1321EC00(~313467KB)
ptn 7 name='fat' start=0x94F5D200 len=0x3BAFB600(~977901KB)
4)烧入system.img文件系统
E:\USB_fastboot_tool\platform-tools>fastboot.exe flash system system.img
sending 'system' (15197 KB)...
OKAY [ 2.298s]
writing 'system'...
OKAY [ 2.585s]
finished. total time: 4.882s
5)重启开发板系统
6)进入bin目录查看并执行hello文件
[root@iTOP-4412]# ls -l hello
-rwxr-xr-x 1 root 0 648462 Feb 17 2018 hello
[root@iTOP-4412]# ./hello
Hello World!