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

Add application to the rootfs #25

Open
mathmax12 opened this issue Oct 11, 2019 · 8 comments
Open

Add application to the rootfs #25

mathmax12 opened this issue Oct 11, 2019 · 8 comments

Comments

@mathmax12
Copy link

mathmax12 commented Oct 11, 2019

Hi,
I tried to add an application to the rootfs, by doing which when the Linux system boot up the binary file of the application can be found and executed.

I notice the Line 92 in Makefile gives such an example.

So after compiled my application with riscv64-unknown-linux-gnu-gcc I got a binary file. Then I copied this binary file to the ./rootfs, which is used to overlay the rootfs generated in the Buildroot.

After run the ""make vmlinux" and "make bbl.bin" I got bbl.
But after the linux OS boot up using this bbl, I can not find the binary file that I put to the rootfs. However, the tetris and cachtest are in the system.

Did I do something wrong?

@Moschn
Copy link
Contributor

Moschn commented Oct 11, 2019

Your steps should work... did you run make clean before? maybe he uses a cached rootfs.cpio

If you want to put your own executable onto the fpga you could also just put it into the second partition of the FPGA. The second partition should get mounted on boot.

@mathmax12
Copy link
Author

mathmax12 commented Oct 11, 2019

I am booting from the flash.
I checked the buildroot/output/images/rootfs.cpio generated from buildroot.
I can see my application is there
sdf
But after the bbl used for the system booting, I didn't find that application in the system on ariane:
sadf
.

@Moschn
Copy link
Contributor

Moschn commented Oct 14, 2019

Are you sure you are booting the correct bbl? If you want you could boot your vmlinux using spike or qemu and then check there if your executable is there. I suspect that somehow you are not booting the correct image.

@mathmax12
Copy link
Author

The correct bbl is used. Confirmed that!
I wonder the process of adding a new application to the rootfs is

  1. cross-compile the application go generate the binary file
  2. copy the binary file to the roofs which will be used to overlay the rootfs from the Buildroot.

Do we need anything else?

@Moschn
Copy link
Contributor

Moschn commented Oct 15, 2019

Your process seems to be correct.

Can you post your bbl file?

@mathmax12
Copy link
Author

Thanks.
Here it is:

bbl.zip

@Moschn
Copy link
Contributor

Moschn commented Oct 16, 2019

You seem to have made multiple changes to the build image. I cannot boot it in qemu or spike. It hangs at ifconfig: SIOCSIFHWADDR: No such device.

I know that the flow in this repo did not work for you before but I cannot really help you with the lowrisc flow. I am preparing an update to the ariane-sdk repo though so maybe it will work then

@mathmax12
Copy link
Author

The bbl that I send to you gave me the same issue hangs at ifconfig: SIOCSIFHWADDR: No such device.
But I am sure the enthernet is fine.
After I add the crossed-compiled binary file to the rootfs, which is used to overlay the rootfs from buildroot, there will be such an issue.
But after I removed the binary file then it will work.

Ok I will try with the new one.
Thanks.

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