0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

c2kをスタンドアローンでブート

Last updated at Posted at 2023-08-11

デバッグの時はカーネルをtftpで読み込み起動させてましたが、だいたい動くようになったので、flashに焼いてみます。

Bareboxはenv/configファイルを元にflashのパーティションを設定します。

Barebox-C2K >/ ls /dev
zero              defaultenv        mem               phy0
nor0              spi0              fastspi0          env0
nor0.uloader      nor0.barebox      nor0.env          nor0.data
nor0.caldata      nor0.config       nor0.bkpconfig    nor0.kernel
nor0.rootfs       nor0.bkpkernel    nor0.bkprootfs    

ターゲットにはbkrootfsというおそらく予備のパーティションがあるので、ここにNetBSDのカーネルを書き込みます。

何度も行うのでスクリプトにしておきます。

Barebox-C2K >/env/bin cat mmflash
#!/bin/sh

addpart /dev/mem 6M@0x3008000(uImage)
tftp netbsd-M86XXX.bb /dev/mem.uImage
erase /dev/nor0.bkprootfs
cp /dev/mem.uImage /dev/nor0.bkprootfs

これを実行しておくと、flashから起動できます。

Barebox-C2K >/ bootm /dev/nor0.bkprootfs
do_bootm start map_dual_image2
   Verifying Checksum ... OK
   Image Name:   NetBSD/m86xxx 10.99.6
   Created:      2023-08-11   0:33:10 UTC
   Image Type:   <NULL> <NULL> <NULL> (<NULL>)
   Data Size:    4869076 Bytes =  4.6 MB
   Load Address: 03008000
   Entry Point:  03008000
OK

Starting kernel ...

commandline: console=ttyS0,115200n8, init=/sbin/init mac_addr=00:0A:0B:0C:0D:0E,00:1A:1B:1C:1D:1E,
arch_number: 1094
[   1.0000000] uboot arg = 0, 0x446, 0x100, 0x10478b0

[   1.0000000] NetBSD/evbarm (m86xxx) booting ...

flashから起動してもネットワークはちゃんと使えています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?