This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Support libc in Kernel


hello Jon
Sorry for no-replay so long.
I was on holiday.

There is a file named syscalls.c in newlib\libc\sys\arm
I have found that libc.a will call the methods in it to achive a system call.
Even I modify the libgloss syscalls.c , the application will use the
wrong system call when link with libc.a.
So I have to modify the newlib\libc\sys\arm\syscalls.c to fit my
kernel, not the libgloss syscalls.c

And I have another question.
I found that the printf can not work nornally.
I used the following program to build the stdin, stdout, stderr. But
the printf can not print anthing but just write into a buffer.
So, would you like to tell me how to establish the stdin stdout and stderr.

    stdin = fopen("/dev/tty", "r");
    if (stdin == NULL ) {
        printf("stdin: /dev/tty open failed\n");
        return;
    }

    stdout = fopen("/dev/tty", "w");
    if (stdout < 0) {
        printf("stdout: /dev/tty open failed\n");
        return;
    }

    stderr = fopen("/dev/tty", "w");
    if (stderr < 0) {
        printf("stderr: /dev/tty open failed\n");
        return;
    }


best regards
wangqiang

2009/5/1 Jon Beniston <jon@beniston.com>:
> You can probably do it via a link script.
>
> See the other examples in libgloss.
>
> Jon
>
> -----Original Message-----
> From: Qiang Wang [mailto:rurality.wq@gmail.com]
> Sent: 30 April 2009 23:50
> To: Jon Beniston
> Subject: Re: Support libc in Kernel
>
> So, how can I merge it into the libc.a.
> Must I modify the configure file or something like that.
> I also noticed that there are some files like that *.specs.
>
> So what is it meaning? Should I add another .specs file to archive the goal.
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]