-
Notifications
You must be signed in to change notification settings - Fork 522
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
semihosting_write bug in generic #339
Comments
syscall normally return the number of bytes that are not written Regards, |
In linux, the syscall write returns the true length it writes. |
I'm using the cklink from t-head to debug a riscv core C908. Its implementation complys with the convention of linux write |
opensbi not running on linux. It running on debugger. You need to know how this debugger implements syscall. Like this: https://github.com/openocd-org/openocd/blob/master/src/target/semihosting_common.c#L1365 |
You can download the latest XuanTie Debug Server from https://www.xrvm.cn/ and add the |
XuanTie implements a strange SYS_WRITE. Is this weird stuff going to spread to all software? |
semihosting_write is called in semihosting_puts which expects that semihosting_write returns the length it writes.
Length minus the return value of syswrite trap which is normally the true length the syscall writes according to the convention is returned in the implementation of semihosting_write. So semihosting_write returns zero actually.
When I am debuging the opensbi with a debugger attached, I get infinite loop of printing 'OpenSBI 1.3.1'.
The text was updated successfully, but these errors were encountered: