Skip to content

Is environment call "sbrk" supported on Ripes? #176

Answered by mortbopet
asahsieh asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @asahsieh
Thank you for using Ripes!
Venus' use of sbrk as ecall code 9 is a bit unconventional and (as far as i am aware of) Venus is the only simulator that actually does this. As mentioned in the issue, Ripes/RARS/... follow the riscv-proxy kernel ABI (as does the GCC toolchain) for system calls (https://github.com/riscv-software-src/riscv-pk/blob/master/pk/syscall.h).

Is there any suggestion to implement malloc() on assembly code and run it on Ripes?

The brk syscall is implemented in Ripes here. This is what is used by the C standard library to implement malloc

As such, if you have registered a compiler in Ripes and compile a simple program such as the following:

#include <stdlib.h>

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@asahsieh
Comment options

Answer selected by asahsieh
Comment options

You must be logged in to vote
1 reply
@asahsieh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants