-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv-qemuでUARTに文字出力する #3
Comments
https://github.com/michaeljclark/riscv-probe そうか、ベアメタルサンプルとか言って、elfロードしてるのか。まぁ最初の一歩としてはありか? |
http://msyksphinz.hatenablog.com/entry/2018/05/07/040000
|
これで、仮想hard driveを読み込むかな。
|
https://www.slideshare.net/ssuser479fa3/riscv-berkeley-boot-loader-proxy-kernel berkeley boot loader、これ読めば少しはわかるかな? |
https://groups.google.com/a/groups.riscv.org/forum/#!msg/sw-dev/IET9LBFJohU/U0wCmCOsBwAJ
spikeは0x200からブートするらしい。 |
https://github.com/riscv/riscv-qemu/blob/riscv-all/hw/riscv/virt.c#L46-L55 あー、virtだとROMが0x1000に0x11000 bytes (68KB) あるんだな。 じゃあそこは気にせず、0x1000にブートローダーを置けば良いわけだ。 |
https://github.com/fractalclone/zephyr-riscv zephyrはriscv-qemu sifive modelで動作する。 |
/**
*
* @brief Copy the data section from ROM to RAM
*
* This routine copies the data section from ROM to RAM.
*
* @return N/A
*/
void _data_copy(void)
{
memcpy(&__data_ram_start, &__data_rom_start,
((u32_t) &__data_ram_end - (u32_t) &__data_ram_start));
#ifdef CONFIG_APPLICATION_MEMORY
memcpy(&__app_data_ram_start, &__app_data_rom_start,
((u32_t) &__app_data_ram_end - (u32_t) &__app_data_ram_start));
#endif
} あー、なるほど、ROMからデータをRAMにコピーしてあげるのか。で、その後は? |
zephyrをビルドして、動かしてみよう。 https://github.com/fractalclone/zephyr-riscv
自分でビルドしたriscv-toolchainも利用できるが、OSをnoneで作っておかないといけないみたい。linux用にツールチェーンを構築してしまったので、大人しくzephyrのSDKを使う。 |
うーん、.binが最終成果物かなぁ?0x80000000にBSS領域とかあるから、生だと2.1GBになるのか…?
むむむ。 |
どうもqemu-riscv用のバイナリは手抜きしているっぽい。 |
とりあえず、elfとvirtの組み合わせでいいから、UARTでhello worldするか。 |
RISC-V、Atomicサポートされていない? |
ぐげぇ、uart_16550、x86_64 crateに依存しとるやんけ。 |
OK! |
ターゲットは、virtでもいいかな。追々考えよう。
https://github.com/riscv/riscv-qemu/wiki
The text was updated successfully, but these errors were encountered: