組込みLinuxを勉強するため「はじめる組込みLinux」の本をやってみた
将来的には任意のマイコンにLinuxを移植できるようにしたい
出来合いのraspbian&armの組み合わせをやってても退屈だから
人が作ったもの(raspbian.img)をやって(raspberrypiを動かすこと)楽しいですか
以下は今後内容を充実させる予定である
条件
Virtualbox、windows10(64bit,4096MB)、ubuntu12.04(32bit版)
①uclinuxのカーネルソースをダウンロードする
②カーネルソースを展開する
③開発ツールをダウンロードし展開する
④gcc類にパスを通す
⑤make menuconfig
→ターゲットボードのベンダーと評価ボードを設定する
→vendorをakizukiにproductsをAE3068にする
→カーネル/ライブラリ/デフォルトセレクションを設定する
→カーネルバージョンをlinux-2.4.xにlibcバージョンをuClibcにする
→デフォルトオールセッティングとカスタマイズオールセッティングにチェックする
→exitを二回する
→ネットワークオプションのTCP/IP networkingのチェックを外す
→exitを二回する
→yesで終わる
⑦$ make dep
⑧$ make
⑨uclinux-distの中のimageフォルダの中のaki3068net-image.binをTFTPかXMODEMでH8/3069に転送する(当方はwindows用のTFTPDソフトの「Tftpd64 by Ph.Jounin」を使用し転送した
⑩exec -c console=ttySC1,38400n81
⑪起動される
以下はログ
RedBoot> load -r -v -m TFTP -b 0x400000 aki3068net-image.bin
/
Raw file loaded 0x00400000-0x004b7c63, assumed entry at 0x00400000
RedBoot> exec -c console=ttySC1,38400n81
Now booting linux kernel:
Entry Address 0x00400000
Cmdline : console=ttySC1,38400n81
Linux version 2.4.31-uc0 (a@localhost) (gcc version 3.4.3) #2 2018? 11キ・7ニ・ソ袁ヒニ・13:07:57 JST
uClinux H8/300H
Target Hardware: AE-3068
H8/300 series support by Yoshinori Sato ysato@users.sourceforge.jp
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
On node 0 totalpages: 1536
zone(0): 0 pages.
zone(1): 1536 pages.
zone(2): 0 pages.
Kernel command line: console=ttySC1,38400n81
virtual vector at 0x00fffd20
Calibrating delay loop... 3.26 BogoMIPS
Memory available: 1116k/1432k RAM, 0k/0k ROM (442k kernel code, 167k data)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
SuperH SCI(F) driver initialized
ttySC0 at 0x00ffffb0 is a SCI
ttySC1 at 0x00ffffb8 is a SCI
ttySC2 at 0x00ffffc0 is a SCI
ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x200000: 00 02 cb 03 d7 00
eth0: NE1000 found at 0x200000, using IRQ 17.
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 499FE4-4D43E3 [VIRTUAL 499FE4-4D43E3] (RO)
VFS: Mounted root (romfs filesystem) readonly.
Freeing unused kernel memory: 20k freed (0x478000 - 0x47c000)
Shell invoked to run file: /etc/rc
Command: hostname AE3068
Command: mount -t proc proc /proc
Command: cat /etc/motd
Welcome to
____ _ _
/ | ||_|
_ | | | | _ ____ _ _ _ _
| | | | | | || | _ | | | |\ / /
| || | || || | | | | || |/
| _||||| ||___|_/_/
| |