目次: Zephyr
導入、ブート周り
ボード、ドライバなど
SMP対応編
浮動小数点数命令など
その他
目次: Zephyr
昨日(2020年2月20日の日記参照)の続きです。
シリアルのみですが、ZephyrをQEMU RISC-V 32のvirtモードに移植しました。やっとZephyrが4 CPUで動くぞ、などと思っていましたが、全然ダメでした。2つ目以降のCPUは全く動きませんでした。
$ riscv64-zephyr-elf-gdb zephyr/build/zephyr/zephyr.elf (gdb) info threads Id Target Id Frame * 1 Thread 1.1 (CPU#0 [halted ]) 0x80000f70 in arch_cpu_idle () at zephyr/soc/riscv/riscv-privilege/common/idle.c:21 2 Thread 1.2 (CPU#1 [halted ]) loop_slave_core () at zephyr/arch/riscv/core/reset.S:45 3 Thread 1.3 (CPU#2 [halted ]) loop_slave_core () at zephyr/arch/riscv/core/reset.S:45 4 Thread 1.4 (CPU#3 [halted ]) loop_slave_core () at zephyr/arch/riscv/core/reset.S:45
理由は簡単で、ZephyrのRISC-V版はSMPに対応していないからです。何を言ってるんだ?って?ええ、実は私も今この瞬間まで知りませんでした。ビックリしました。
リセット付近のソースコードをみると、
// zephyr/arch/riscv/core/reset.S
/*
* Remainder of asm-land initialization code before we can jump into
* the C domain
*/
SECTION_FUNC(TEXT, __initialize)
/*
* This will boot master core, just halt other cores.
* Note: need to be updated for complete SMP support
*/
csrr a0, mhartid
beqz a0, boot_master_core
loop_slave_core:
wfi
j loop_slave_core
以上のように、はっきり書いてあります。SMPは一番大事な機能だと思っていただけに、未対応とは思わなんだ。
あー、今日の16550との戦いは一体何だったんだろう。しょんぼりですわ……。
メモ: 技術系の話はFacebookから転記しておくことにした。大幅に加筆した。
< | 2020 | > | ||||
<< | < | 03 | > | >> | ||
日 | 月 | 火 | 水 | 木 | 金 | 土 |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | - | - | - | - |
合計:
本日:
管理者: Katsuhiro Suzuki(katsuhiro( a t )katsuster.net)
This is Simple Diary 1.0
Copyright(C) Katsuhiro Suzuki 2006-2023.
Powered by PHP 8.2.15.
using GD bundled (2.1.0 compatible)(png support.)