Hi,

 

Thanks for helping and sorry for the late response! It took me some time to 
figure it out but now it’s working. Thank you! :-)

 

Jan

 

 

Von: Gabe Black <gabe.bl...@gmail.com> 
Gesendet: Donnerstag, 14. Januar 2021 10:30
An: gem5 users mailing list <gem5-users@gem5.org>
Cc: jan.th...@ruhr-uni-bochum.de
Betreff: Re: [gem5-users] Implementation of write() Syscall in SE Mode

 

SE mode does not work at the standard library level, it works at the system 
call level. As long as your custom standard library uses the normal linux 
system calls and the normal linux system call ABI, you shouldn't have to do 
anything special. There could be a very minor technical exception on x86 where 
on a real system the kernel has to provide tiny helpers since there are 3 
different ways to call system calls (int, sysenter, syscall) and the program 
doesn't have a good/efficient way to know which to use. Those are built into 
gem5 in assembly and loaded into memory as the program is set up, but I don't 
think RISCV does anything like that since it doesn't have all the baggage x86 
does.

 

Gabe

 

On Thu, Jan 14, 2021 at 12:47 AM jan.thoma--- via gem5-users 
<gem5-users@gem5.org <mailto:gem5-users@gem5.org> > wrote:

Hi all,

I am a little stuck and would appreciate if someone could help. I am
simulating in Gem5 syscall emulation mode and I've made some modifications
to the CPU model to support some additional instructions (RISC-V). To
compile programs using the new instructions, I also have a clang compiler
that places the instructions. It is important that *every* piece of code
that is executed on the core goes through my own compiler. I compiled Newlib
for libc support. Unfortunately, the _write() function (that is, the
function that executes the syscall) has to be implemented manually. Is there
a way to print to stdout in syscall emulation mode where I compile the libc
myself? What would the _write() function have to implement? Is there any
other way to print during simulation?

>From other platforms I am used to solutions like "write at a specific
address" but I couldn't find anything like that for Gem5. I realize that the
problem is very unusual, I would appreciate any help. Thanks!

Best,
Jan
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org <mailto:gem5-users@gem5.org> 
To unsubscribe send an email to gem5-users-le...@gem5.org 
<mailto:gem5-users-le...@gem5.org> 
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to