![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
オープンデベロッパーズカンファレンス2020 Online NetBSDのご紹介&名古屋*BSDユーザグループ(NBUG)2020/12月例会の記録
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
"カーネルクラッシュダンプのデバッグの方法" jp.netbsd.org/ja/docs/kernel… いつも忘れて調べている
2020-12-17 00:14:34![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
sti_region_setup: regno = 0, addr = 00614000, len = 00000000 sti_region_setup: regno = 2, addr = 00653000, len = 00000000 sti_region_setup: regno = 3, addr = 008d3000, len = 00000000 sti_region_setup: regno = 4, addr = 008d4000, len = 00000000 一応なんか見えてるのか
2020-12-17 00:38:16![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
sti_region_setup: regno = 0, paddr = 2c000000, addr = 0060f000, len = 0003f000 regno = 2, paddr = 2c100000, addr = 0064e000, len = 00280000 regno = 3, paddr = 2c03f000, addr = 008ce000, len = 00001000 regno = 4, paddr = 2c380000, addr = 008cf000, len = 00001000 んー……
2020-12-17 00:57:50![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
とりあえずなんか出ました。(心の中で静かにガッツポーズを決めた) pic.twitter.com/YF1ZmSStnc
2020-12-17 01:12:36![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
ちょいちょいといじるとカラーも行けてるっぽい。うはは pic.twitter.com/9BJyhZE4oX
2020-12-17 01:22:34![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
<Gambado-ガンベイド->Honda サイバースポーツCR-X キット abchobby.com/productimg/gam… CR-X 背景画像はこちらから拝借しました
2020-12-17 01:59:38![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
1/8 オープンソースカンファレンス2021 Spring 出展者説明会 に参加を申し込みました! ospn.connpass.com/event/196664/?… #osc21on
2020-12-17 15:46:13![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
3/5-6 Open Source Conference 2021 Online/Spring に参加を申し込みまんた! ospn.connpass.com/event/196661/?… #osc21tk
2020-12-17 15:48:16![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
とりあえず何も整理してない diff バックアップ(git を使え、それはそう) gist.github.com/tsutsui/65c712…
2020-12-17 22:15:23![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
HP9000/425t の CRXフレームバッファ、シリアルコンソールだと動くけどフレームバッファコンソールだと panic するというありがちな挙動なのでもう少し調べる必要がある
2020-12-17 22:41:31![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
nxr.netbsd.org/xref/src/sys/a… ここのフレームバッファコンソールのパスだと sti_describe() のあとに sc->sc_scr = sti_attach_screen() で追加の初期化をしてやらないとダメっぽい感じか(雑読み)
2020-12-17 22:53:24![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
んー。 sti_cnattach() で sti_screen_setup() 呼んでるから問題ないはずか? (ちゃんと観測しろと怒られる)
2020-12-17 22:57:55![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
フレームバッファコンソールのときだけ起こる問題、カーネルに細工してコンソール出力をシリアルにも同時に出す、みたいなことが必要なので微妙に面倒
2020-12-17 22:59:01![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
とりあえず sti_cnattach() から sti_region_setup() は呼ばれてて scr->setupfb() も初期化されているっぽい。 フレームバッファコンソールで WSDISPLAYIO_SMODE の WSDISPLAYIO_MODE_DUMBFB を設定すると Illegal instruction で落ちるというのは sti の ROMルーチンがおかしくなっているのか
2020-12-17 23:32:53![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
[ 290.8760570] trap: bad kernel read access at 0x0 [ 290.8901170] trap type 8, code = 0x525, v = 0x0 [ 290.8931530] kernel program counter = 0x149100c [ 290.9061810] kernel: MMU fault trap ぬるぽですね
2020-12-18 00:07:37![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
カーネル起動後に extern void comcnputc(dev_t, int); cn_tab->cn_putc = comcnputc; などという超強引な手法でコンソールを差し換えたのだけれど、なぜか Illegal instruction にならず MMU fault になるのがよーわからんな
2020-12-18 00:09:40![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
bus_space_map(9) がちゃんとできていない、というようにみえるけれど、起動時に sti_region_setup() は実行されてて regno = 2 の region も map されてるんだよな。何かが抜けてるんだろうけど pic.twitter.com/3oQf712LHi
2020-12-18 00:11:26![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
kernel program counter = 0x149100c ってよく見たらカーネルの外か。 ngle_setup_hw() には bus_space_read_1() しかないし、引数の memh には 0x5ed000 が渡されてて正しい CRX のレジスタVAだし、一体何がどうなっているのか
2020-12-18 00:30:51![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
そういや bus_space_read_1() は条件によっては関数を呼ぶのだったか(遠い記憶) nxr.netbsd.org/xref/src/sys/a… sti_sgc_cnattach() に渡してる bus_space_tag が間違っている もしくは 初期化されてない、とかか
2020-12-18 00:35:33![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
ぐはっ nxr.netbsd.org/xref/src/sys/a… コンソール初期化でスタックの値渡してて、それが sti_sgc_cnattach() → sti_cnattach() → sti_rom_setup() で保存されるというトラップか。そりゃよくわからんことが起こる罠😱
2020-12-18 00:46:12![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
firefox 84.0 on NetBSD/i386 9.1 pic.twitter.com/obtHCkDxiz
2020-12-18 01:01:58![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)