[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARM semihosting issue

From: Bruno Prado
Subject: Re: ARM semihosting issue
Date: Thu, 1 Oct 2020 18:20:29 -0300

Thanks for the reply... I am attaching some code and output:

#include <stdio.h>
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, "%s", name);
       printf("My name is %s\n", name);
       fprintf(stderr, "I am alive!!!\n");
       return 0;

$ cat name
$ qemu-system-arm -M netduino2 -nographic -semihosting -kernel vp2.bin
What is your name?
Reading from file...
My name is Turing
I am alive!!!

Basically the scanf call has no effect. I was expecting a pause in execution to input a string, but nothing happens.

Bruno Prado

On Thu, Oct 1, 2020 at 5:38 PM Peter Maydell <peter.maydell@linaro.org> wrote:
On Thu, 1 Oct 2020 at 21:33, Bruno Prado <bruno@dcomp.ufs.br> 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.

Rather hard to say what might be going on with this little
information... what semihosting calls are you making, what
do you expect them to do and what do they actually do?
Do you have a minimal test case we can reproduce with?

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]