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

Booting Linux #21

Closed
wangliwei-intel opened this issue Mar 1, 2022 · 9 comments
Closed

Booting Linux #21

wangliwei-intel opened this issue Mar 1, 2022 · 9 comments

Comments

@wangliwei-intel
Copy link

Is it capable of booting linux right now? thanks.

@nmeum
Copy link
Member

nmeum commented Mar 1, 2022

Yes, we successfully booted Linux using linux-vp (which models a HiFive Unleashed) in the past:

linux-vp.mp4

However, we experiment more with embedded operating systems like Zephyr and RIOT in our own work at the moment. For this reason, depending on your Linux image and your Kernel config, you might run into some minor issues here and there when attempting to boot Linux using linux-vp.

If you have any specific questions regarding linux-vp let us know.

@Cirromulus
Copy link
Member

If this answered your question, please close this Issue.

@wangliwei-intel
Copy link
Author

@Cirromulus
Sorry, I reopen this issue.
The riscv-toolchain described in README is a Newlib cross-compiler, so I think that process is for
bare-metal or RTOS mode.
As you said, I'm interested in linux-vp, Is there any document showing me how to do that?

B. R.
Liwei

@Cirromulus
Copy link
Member

Yes, the toolchain mentioned in the Readme is for embedded / bare-metal applications (FE320).
The linux-vp is compatible to the Sifive Unmatched (FU540), so if you follow tutorials to building linux for that, this will help.
You will have to build an ELF file with integrated rootfs which you can boot. You can then use this file together with the DTB to run on the linux-vp.
@nmeum might have a more detailed build process.

@wangliwei-intel
Copy link
Author

@Cirromulus Thank you.
The system bus is TLM bus, is it possible to replace it with CHI or AXI model?

@Cirromulus
Copy link
Member

I get the impression that you did not understand what TLM stands for.
This VP is a loosely-timed SystemC TLM model. The actual bus protocol is irrelevant.

@wangliwei-intel
Copy link
Author

wangliwei-intel commented Mar 15, 2022

Hi, @nmeum
I followed Freedom-U-SDK to build the kernel image and rootfs for U540.
Everything looks good, I end up with those files:
image

Then I ran the command:
linux-vp --use-data-dmi --tlm-global-quantum=1000 --dtb-file=hifive-unleashed-a00-microsemi.dtb fw_payload.elf

I got this error:
linux-vp: /MyHostHome/Desktop/DockerHome/SystemC-HOME/riscv-vp-rv64/vp/src/platform/common/memory.h:49: void SimpleMemory::write_data(unsigned int, const uint8_t*, unsigned int): Assertion `addr + num_bytes <= size' failed.
Aborted (core dumped)

I know I missed something, e.g. specify the kernel image and rootfs.
I also need to build something specific for linux-vp.
Could you please tell me how?

B. R.
Liwei

@nmeum
Copy link
Member

nmeum commented Mar 24, 2022

I actually used buildroot instead of the Freedom-U-SDK in the past. Attached is an older image I generated a few years ago which should boot with current linux-vp (see README.md in the attached tarball). As I mentioned in the earlier comment, we are currently not actively working with Linux, hence you might run into bugs with newer Linux versions or different configurations. If your employer is interested in improving linux-vp feel free to reach out to us via email at riscv@informatik.uni-bremen.de.

Attachments:

  • linux64-mc-slip.tar.gz (takes a while to boot since it uses multicore linux-vp and SystemC doesn't parallelize the different cores, login is root:agra)

@wangliwei-intel
Copy link
Author

@nmeum Thank you very much.

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

3 participants