-
Notifications
You must be signed in to change notification settings - Fork 210
openSBI with sail-riscv #886
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
Comments
The third question is -l option is failed when you are in question 2. |
DYNI think that indicates your executable is dynamically linked... It doesn't really have anything to do with position independent code (although it is true that dynamically linked code is almost always position independent). When I build OpenSBI it gives me a static executable:
I couldn't actually get it to give me a LoopsThis is fairly obvious. Your entry point is 0, but we don't define any memory to exist there. You can change where the RAM is defined but I would recommend just relocating OpenSBI to 0x80000000 (as shown above) because that's also what SPIKE is happy with. Here's the command I use, note
I have a Makefile that builds something that works. I'll clean it up a bit and share it. |
Ok here's the Makefile I use. It doesn't really have all the dependencies set up right so it's fragile, but if you run
You'll get a boot image and then you can try
or
to run it. It is possible to embed the DTB in the image by adding If you want to turn the Makefile into something that actually has all the incremental build stuff set up properly that would be amazing! Also note that there's no userspace so when it eventually gets to running
Here is
|
It would be great to get this cleaned up and then either add it to or maybe even replace what’s in the os-boot directory. |
No, ET_DYN is for PIEs. Well, really it's for shared libraries, but that got repurposed to also be for executables. PDEs use ET_EXEC. I don't know why you're not getting a PIE. OpenSBI these days requires it. |
Passing the dtb to qemu is unlikely to work since QEMU does not interpret that at all and just places devices where they have been programmed. It generates its own device tree blob so should not be needed. Getting a PIE binary to work here shouldn't be too difficult we just need a flag where to load it or default to start of RAM. |
for dyn, try newer version. The pie is added in newer ones. riscv-software-src/opensbi@99aabc6 |
I have done all work with your help. Thank you very much. I will put my work to os-boot. It has linux 6.14.4 and opensbi 1.6.
|
I stand corrected. This stuff seems to be really badly documented and barely understood by anyone, e.g. see this thread. |
I am trying to replace the old
os-boot
with opensbi (with default payload). I'd be very happy if someone can add it to agenda and help me to debug it.There are two problems.
DYN problem
When the ELF is DYN (Position-Independent Executable file) , it can not be loaded by sail-riscv due to
load_elf
sail-riscv/c_emulator/riscv_sim.cpp
Line 346 in 5872942
loops
If you remove all Pies in opensbi you can get a normal elf and put your work into sail-riscv. You will get these above.
The text was updated successfully, but these errors were encountered: