MinixをARM用にcross buildするのだが,重要なのはMinixでやる訳ではないらしい.当方で用いた環境は以下のとおり.
- Mac (OS X 10.9.2)
- VirtualBox 4.3.8
- Ubuntu 12.04
結局のところ,buildは別として,BeagleBone Black用のSD imageを作成するために,FATとminixfsのファイルシステムをディスクイメージのファイル上に作成できる環境が必要ということらしい.ここで,最初にminix上で開発が始まったため,今でもminixfsをサポートしているLinuxのメリットが出てくる.
お気楽にVirtualBox用のディスクイメージをダウンロードする.パーティションサイズはだいたい64GB.これをメモリ512MBで設定する.
さらに,このページに従ってツールをいくつか追加する.
さらに,このページに従ってツールをいくつか追加する.
sudo apt-get install git sudo apt-get install zlibc zlib1g zlib1g-dev sudo apt-get install g++ |
■ Ubuntu上でARM Minixのbuild
gitでMinixのsource codeを丸ごと持って来る.
cd ~ mkdir Minix cd Minix git clone git://git.minix3.org/minix src cd src |
次に,src/releasetools/arm_sdimage.shを編集する.Webではshellで環境変数を設定すれば良いと書いてあったが,一度失敗したので実際にコメントアウトされているBeagleBone用の
U_BOOT_BIN_DIR=build/am335x_evm/
CONSOLE=tty00
CONSOLE=tty00
の2行を有効にし,現在有効になっているBeagleBoard用の2行をコメントアウトする.
releasetoolsの中にあるarm_sdimage.shでbuildする.
bash ./releasetools/arm_sdimage.sh |
/bin/shだと駄目だった.arm_sdimage.shは途中でFTPからU-Bootを持って来る.さらに,通常のMinixのbuild.sh自体がFTPからgccやらbinutilsやらを持って来るので,これらのツールを手作業でMinix上に持ってこない場合にはネットワーク接続が必要.
1時間ぐらいでsrcの下に2GBのイメージ
1時間ぐらいでsrcの下に2GBのイメージ
minix_arm_sd.img
ができる.これをOS Xにscpしてきてddで書き込む.ddコマンドでboot diskを作ってbootなんて,まるでMinixの1.2から1.5を使っていたころみたい.懐かしい.
■ BeagleBone Blackでboot
$ sudo cu -s 115200 -l /dev/tty.usbserial-A702IYA4 Connected. U-Boot SPL 2013.04-dirty (Jul 10 2013 - 14:02:53) musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Peripheral mode controller at 47401000 using PIO, IRQ 0 musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Host mode controller at 47401800 using PIO, IRQ 0 OMAP SD/MMC: 0 mmc_send_cmd : timeout: No status update reading u-boot.img reading u-boot.img U-Boot 2013.04-dirty (Jul 10 2013 - 14:02:53) I2C: ready DRAM: 512 MiB WARNING: Caches not enabled NAND: No NAND device found!!! 0 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 *** Warning - readenv() failed, using default environment musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Peripheral mode controller at 47401000 using PIO, IRQ 0 musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn) musb-hdrc: MHDRC RTL version 2.0 musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory USB Host mode controller at 47401800 using PIO, IRQ 0 Net: <ethaddr> not set. Validating first E-fuse MAC cpsw, usb_ether Hit any key to stop autoboot: 0 gpio: pin 53 (gpio 53) value is 1 mmc0 is current device micro SD card found mmc0 is current device gpio: pin 54 (gpio 54) value is 1 SD/MMC found on device 0 reading uEnv.txt 1334 bytes read in 5 ms (259.8 KiB/s) Loaded environment from uEnv.txt Importing environment from mmc ... Running uenvcmd ... starting from MMC mmc - MMC sub system Usage: mmc read addr blk# cnt mmc write addr blk# cnt mmc erase blk# cnt mmc rescan mmc part - lists available partition on current mmc device mmc dev [dev] [part] - show or set current mmc device [partition] mmc list - lists available devices mmc rstn - enable hardware reset of emmc reading kernel.bin 257088 bytes read in 35 ms (7 MiB/s) reading ds.elf 60452 bytes read in 12 ms (4.8 MiB/s) reading rs.elf 80476 bytes read in 15 ms (5.1 MiB/s) reading pm.elf 57192 bytes read in 12 ms (4.5 MiB/s) reading sched.elf 30500 bytes read in 10 ms (2.9 MiB/s) reading vfs.elf 138400 bytes read in 22 ms (6 MiB/s) reading memory.elf 2496380 bytes read in 290 ms (8.2 MiB/s) reading log.elf 38736 bytes read in 11 ms (3.4 MiB/s) reading tty.elf 46940 bytes read in 11 ms (4.1 MiB/s) reading mfs.elf 84036 bytes read in 16 ms (5 MiB/s) reading vm.elf 149008 bytes read in 23 ms (6.2 MiB/s) reading pfs.elf 238796 bytes read in 33 ms (6.9 MiB/s) reading init.elf 171636 bytes read in 26 ms (6.3 MiB/s) Unknown command 'dcache' - try 'help' Unknown command 'icache' - try 'help' console=tty00 rootdevname=c0d0p1 verbose=3 hz=1000 filemap=0 board_name=A335BNLT ## Starting application at 0x80200000 ... MINIX booting cstart intr_init(0) main() initializing asyncm... done initializing idle... done initializing clock... done initializing system... done initializing kernel... done initializing ds... done initializing rs... done initializing pm... done initializing sched... done initializing vfs... done initializing memory... done initializing log... done initializing tty... done initializing mfs... done initializing vm... done initializing pfs... done initializing init... done system_init()... done MINIX 3.2.1. Copyright 2012, Vrije Universiteit, Amsterdam, The Netherlands MINIX is open source software, see http://www.minix3.org cycles_accounting_init()... done IRQ 72 handler registered by tty / 5 Started VFS: 8 worker thread(s) Starting the mmc driver mmc_block(info)Initializing the MMC block device mmc_host_mmchs(info)Using instance number 0 IRQ 64 handler registered by mmc / 73129 mmc_block(info)System event framework fresh start Root device name is /dev/c0d0p1 mmc_host_mmchs(info)Enabling high speed mode /dev/c0d0p1: clean mmc_host_mmchs(info)Enabling high speed mode mmc_host_mmchs(info)Enabling high speed mode /dev/c0d0p1 is mounted on / none is mounted on /proc /dev/c0d0p2: clean /dev/c0d0p3: clean size on /dev/imgrd set to 0kB Multiuser startup in progress ... Starting services: randomrm /dev/eth0 rm /dev/eth mknod /dev/psip0 c 7 1 ln /dev/psip0 /dev/psip ln /dev/ip0 /dev/ip ln /dev/tcp0 /dev/tcp ln /dev/udp0 /dev/udp inet: unable to read random data from /dev/random: resource temporarily unavailable inet: using current time for random-number seed inet ipc. Starting daemons: update cron syslogd. Starting i2c subsystem: IRQ 70 handler registered by i2c / 73140 i2cIRQ 71 handler registered by i2c / 73141 i2cIRQ 30 handler registered by i2c / 73142 i2c. Running on a BeagleBone Black Starting i2c device drivers: cat24c256IRQ 7 handler registered by tps65217 / 73144 tps65217 tda19988. Starting networking: nonamed. Local packages (start): done. Minix Release 3 Version 2.1 (console) 10.0.0.1 login: root Copyright (c) 2012, Vrije Universiteit, Amsterdam, The Netherlands To install additional packages, run 'pkgin'. To install packages from the online package repository, if you have a working network connection from MINIX: first do a 'pkgin update' to update the list of available packages, and then do a 'pkgin' to get a list of commands. For example, 'pkgin install vim' installs the 'vim' package, and 'pkgin available' will list all available packages. To install packages from the installation CD: same, but use pkgin_cd. To switch to the online repository, do 'pkgin update' again. To install all packages, do pkgin_all. MINIX 3 supports multiple virtual terminals. Just use ALT+F1, F2, F3 and F4 to navigate among them. For more information on how to use MINIX 3, see the wiki: http://wiki.minix3.org. # df Filesystem Size (kB) Free Used % Files% Mounted on /dev/c0d0p1 65536 42904 22632 35% 2% / none 0 0 0 0% 0% /proc /dev/c0d0p2 131072 128968 2104 2% 1% /home /dev/c0d0p3 1572864 1099860 473004 31% 3% /usr # |
動いた!
GPIOとI2Cが両方動いているので,この手の環境を使いたい場合はFreeBSD/NetBSD/OpenBSDよりも進んでいることになるのかな.
0 件のコメント:
コメントを投稿