Re: ARM semihosting issue

2020-10-21 Thread Bruno Prado
Thanks a lot! I will check it out. Bruno Prado On Wed, Oct 21, 2020 at 12:45 PM Alex Bennée wrote: > > Bruno Prado writes: > > > Hello, is it really a bug? > > > > > > Bruno Prado > > > > > > On Fri, Oct 2, 2020 at 8:09 AM Bruno Prado wrote: > > > >> I am including some syscall fun

Re: ARM semihosting issue

2020-10-21 Thread Alex Bennée
Bruno Prado writes: > Hello, is it really a bug? > > > Bruno Prado > > > On Fri, Oct 2, 2020 at 8:09 AM Bruno Prado wrote: > >> I am including some syscall functions: >> >> int _fstat(int file, struct stat* st) { >>register int value asm("r0"); >>uint32_t p[] = { file }; >

Re: ARM semihosting issue

2020-10-21 Thread Bruno Prado
Hello, is it really a bug? Bruno Prado On Fri, Oct 2, 2020 at 8:09 AM Bruno Prado wrote: > I am including some syscall functions: > > int _fstat(int file, struct stat* st) { >register int value asm("r0"); >uint32_t p[] = { file }; >R0(0x0C); >R1(p); >

Re: ARM semihosting issue

2020-10-02 Thread Bruno Prado
I am including some syscall functions: int _fstat(int file, struct stat* st) { register int value asm("r0"); uint32_t p[] = { file }; R0(0x0C); R1(p); BKPT(); return value; } int _read(int file, char* ptr, int len) { register int value asm("r0");

Re: ARM semihosting issue

2020-10-02 Thread Peter Maydell
On Thu, 1 Oct 2020 at 22:21, Bruno Prado wrote: > Thanks for the reply... I am attaching some code and output: > > #include > int main() { >char name[50] = "Nobody"; >FILE* file = fopen("name", "r"); >printf("What is your name?\n"); >fprintf(stdout, "Reading from f

Re: ARM semihosting issue

2020-10-01 Thread Bruno Prado
Thanks for the reply... I am attaching some code and output: #include int main() { char name[50] = "Nobody"; FILE* file = fopen("name", "r"); printf("What is your name?\n"); fprintf(stdout, "Reading from file...\n"); fscanf(file, "%s", name); fscanf(stdin

Re: ARM semihosting issue

2020-10-01 Thread Peter Maydell
On Thu, 1 Oct 2020 at 21:33, Bruno Prado wrote: > I was able to use stdout, stderr for output and files for > both input and output in qemu-system-arm, but stdin is not > working (always returns -1 from syscall). I found no > information and have already checked the code for possible hints. Rathe