-
Notifications
You must be signed in to change notification settings - Fork 60
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
Bare-metal C Program compilation fails #5
Comments
Thank you for trying to use this emulator! You can't use bin/raw/simple.c is one of the simplest sample C code. We can compile it with the instructions described in Bare-metal C Program in README. Once simple.c is executed in this emulator, we'll see the value of 42 at x10 (a0) register. The x10 register stores a return value of the main function. |
I was able to generate simple.text myself, but the content and size of my file is different from the official simple.text I did the following to generate simple.text (BTW, I got
The content of my simple.text is
Official simple.text has different content and size
As a result if I run my simple.text in rvemu.app it does not set What I'm doing wrong? My OS is Ubuntu 20.10. riscv64-unknown-elf-gcc (GCC) 10.2.0 my simple.c is the same as the official simple.c
my simple.s is almost the same as the official simple.s
|
Sorry for my late response. I've been busy these days. I think your compiler is using compressed instructions (RV64C). Each length of compressed instructions is 2 bytes and the original The app FYI: If you want to compile code into RV64G (without compressed) instructions, you need to compile RISC-V toolchain with
|
I'm trying to follow the instructions described in Bare-metal C Program in README
I got the following errors (OS: Ubuntu 20.10 x86_64)
foo.c
foo.s
The text was updated successfully, but these errors were encountered: