Skip to content
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

Port to RISV64 and baremetal run on VF2 #6

Closed
strlcat opened this issue May 24, 2023 · 4 comments
Closed

Port to RISV64 and baremetal run on VF2 #6

strlcat opened this issue May 24, 2023 · 4 comments

Comments

@strlcat
Copy link

strlcat commented May 24, 2023

I'm really interested in this project, unfortunately it seems it is nailed to RV32 as for now.

However, SBCs like VisionFive2 and Star64 emerge, and there will be more RV64 actual hardware in the future.

Are there plans to port it to RV64? Run on real hardware?

@yhzhang0128
Copy link
Owner

I'm really interested in this project, unfortunately it seems it is nailed to RV32 as for now.

However, SBCs like VisionFive2 and Star64 emerge, and there will be more RV64 actual hardware in the future.

Are there plans to port it to RV64? Run on real hardware?

@yhzhang0128
Copy link
Owner

Sorry I accidentally pressed the close button and closed this issue.

Although I don’t have this plan, I think it is not difficult. I guess the key is to modify ‘grass/context.S’ since most other parts of this OS are written in C so that you can compile them to RV64 with the right compiler flag.

@strlcat
Copy link
Author

strlcat commented May 24, 2023

Are there any other specifics to keep in mind? Does it talk 16550A style uart? Is changing base address 0x20400000 is enough to keep it going? So many questions, I hope to see answers :)
VF2's config:
16550A uart is at 0x10000000
Kernel load address 0x40200000 (OpenSBI sits at 0x40000000), S-Mode.
If one might want to run from M-Mode, then SRAM is available at 0x08000000, but idk how U-Boot SPL calls it.

@yhzhang0128
Copy link
Owner

yhzhang0128 commented May 24, 2023

You may wish to take a look at earth/bus_uart.c. In particular, the uart_put and uart_get functions are just few lines and you may need to modify them for VF2. For example, use the address 0x10000000.

In terms of adjusting memory map, please refer to issue #4.

I don’t have a good answer to the S-mode or M-mode part. You may need to modify several assembly. For example, change mret, mstatus, etc. to sret, sstatus, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants