本篇根據 buildroot user manual,實驗建置 qemuarm 的流程,記錄操作過程。
2018年3月4日 星期日
2018年2月18日 星期日
MAC OS 避免 USB NTFS 唯讀的方法
步驟記錄如下:
1. $ diskutil list
2. $ sudo vi /etc/fstab
4. $ sudo ln -s /Volumes ~/Desktop/Volumes
參考資料:
1. $ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 499.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.6 GB disk1
1: Windows_NTFS KINGSTON 15.6 GB disk1s1
此時可以得知 USB 碟的標籤是 KINGSTON
2. $ sudo vi /etc/fstab
LABEL=KINGSTON none ntfs rw,auto,nobrowse
注意:因為設定為 nobrowse,所以以後插入此 USB碟的時候,在 finder 內不會顯示此 USB 碟。3. 移除 USB, 重新插入一次
4. $ sudo ln -s /Volumes ~/Desktop/Volumes
參考資料:
2018年2月13日 星期二
[Embedded] build tiny ffmpeg library
This article describe how to configure a tiny ffmpeg library for embedded system.
2018年1月30日 星期二
[Embedded] convert binary data to c array
將二進位資料轉換成 C 語言的陣列,是程序員常會用到的一個小技巧。本篇以一個例子說明如何在 linux 環境下達到此目的。
2018年1月27日 星期六
2018年1月14日 星期日
2017年12月28日 星期四
[QEMU] 模擬一個實際的 ARM Linux 嵌入式系統
本篇紀錄手動自行建置系統的過程。若想盡可能的自動化進行建置,請使用 yocto 或是 buildroot。
1. 安裝 qemu
2. 建立測試目錄,下載 toochain 以及 kernel
3. 修改環境變數
4. 編譯 kernel
5. 建立虛擬網卡介面
6. 建立 nfs 使用的 rootfs (之前已經透過 yocto 建立,此步驟省略)
7. 執行程式
參考資料:
http://awe31402-blog.logdown.com/posts/528593
http://daydreamer.idv.tw/rewrite.php/read-42.html
1. 安裝 qemu
$ sudo apt-get install qemu-system-arm
2. 建立測試目錄,下載 toochain 以及 kernel
$ mkdir qemu_test
$ cd qemu_test
$ wget https://releases.linaro.org/components/toolchain/binaries/6.4-2017.11/arm-linux-gnueabihf/ gcc-linaro-6.4.1-2017.11-i686_arm-linux-gnueabihf.tar.xz
$ tar xvf gcc-linaro-6.4.1-2017.11-i686_arm-linux-gnueabihf.tar.xz
$ wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz
$ tar xvf ./linux-4.14.tar.xz
3. 修改環境變數
$ vi ~/.bashrcexport ARCH=arm$ source ~/.bashrc
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=$PATH:/home/albert/qemu_test/gcc-linaro-6.4.1-2017.11-i686_arm-linux-gnueabihf/bin
4. 編譯 kernel
$ cd linux-4.14
$ vi arch/arm/configs/vexpress_defconfig
參考此篇 http://awe31402-blog.logdown.com/posts/528593
$ make vexpress_defconfig
$ make clean;make
$ ls -al arch/arm/boot/dts/*.dtb
此時應該會出現 vexpress-v2p-ca9.dtb
$ ls -al ./arch/arm/boot/
此處應該會出現 zImage
5. 建立虛擬網卡介面
$ sudo apt-get install uml-utilities
$ sudo tunctl -t tap0 -u albert
$ sudo ifconfig tap0 192.168.7.1 netmask 255.255.255.0 promisc
6. 建立 nfs 使用的 rootfs (之前已經透過 yocto 建立,此步驟省略)
7. 執行程式
$ cd ~/qemu_test
$ QEMU_AUDIO_DRV=none qemu-system-arm -kernel ./linux-4.14/arch/arm/boot/zImage -M vexpress-a9 -m 512 \
-dtb ./linux-4.14/arch/arm/boot/dts/vexpress-v2p-ca9.dtb \
-append "/dev/nfs nfsroot=192.168.7.1:/srv/nfs/qemuarm rw ip=192.168.7.2:192.168.7.1:255.255.255.0 console=ttyAMA0,115200" \
-smp 1 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no -nographic
參考資料:
http://awe31402-blog.logdown.com/posts/528593
http://daydreamer.idv.tw/rewrite.php/read-42.html
訂閱:
文章 (Atom)