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?

c2kをブートしてみた

Last updated at Posted at 2023-06-24

とりあえずネットワークは使えるようなので、NetBSDでuimageを作ってブートしてみます。

Barebox-C2K >/ addpart /dev/mem 6M@0x3008000(uImage)
Barebox-C2K >/ tftp netbsd-M86XXX.ub /dev/mem.uImage
Barebox-C2K >/ bootm /dev/mem.uImage
do_bootm start map_dual_image2
Bad Magic Number: /dev/mem.uImage
booting kernel of time image from /dev/nor0.bkpkernel

Bad Magic Numberで失敗してます。

起動されるカーネルのヘッダーを確認してみます。

Barebox-C2K >/ cp /dev/nor0.bkpkernel /dev/mem.uImage
Barebox-C2K >/ md -b 0x3008000
03008000: 6a 31 38 76 31 35 30 2e 30 30 2e 30 30 5f 73 6f    j18v150.00.00_so
03008010: 66 74 62 61 6e 6b 00 56 35 2e 30 2e 30 2e 31 2e    ftbank.V5.0.0.1.
03008020: 56 35 2e 30 2e 30 2e 31 2e 72 63 33 30 5f 62 61    V5.0.0.1.rc30_ba
03008030: 6b 5f 31 2e 30 2e 32 00 b7 90 90 73 b7 d0 ca 72    k_1.0.2....s...r
03008040: 00 22 58 80 07 0b 68 83 00 48 00 04 a6 6f 33 bc    ."X...h..H...o3.
03008050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
03008060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
03008070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
03008080: 27 05 19 56 4c 93 3d e3 57 14 de ac 00 22 58 40    '..VL.=.W...."X@
03008090: 03 00 80 00 03 00 80 00 6c 08 4b 74 05 02 02 00    ........l.Kt....
030080a0: 4c 69 6e 75 78 2d 33 2e 32 2e 32 36 00 00 00 00    Linux-3.2.26....
030080b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
030080c0: 00 00 a0 e1 00 00 a0 e1 00 00 a0 e1 00 00 a0 e1    ................
030080d0: 00 00 a0 e1 00 00 a0 e1 00 00 a0 e1 00 00 a0 e1    ................
030080e0: 02 00 00 ea 18 28 6f 01 00 80 00 03 40 d8 22 03    .....(o.....@.".
030080f0: 01 70 a0 e1 02 80 a0 e1 00 20 0f e1 03 00 12 e3    .p....... ......

なんだか0x80バイトのおまけがついています。同じものをNetBSDでビルドしたuimageに付けてブートしてみました。

ブートしました。

image.png

armv6_start.Sの先頭にuartにNを書き込むコードを入れてあります。

おそらく先頭の0x80バイトのヘッダーはファームウエアアップデートの時に確認していて、Bareboxではとくに処理をしていないように思われます。(空でも問題なく起動できました)

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?