This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Support libc in Kernel
- From: Qiang Wang <rurality dot wq at gmail dot com>
- To: Jon Beniston <jon at beniston dot com>
- Cc: newlib at sourceware dot org
- Date: Thu, 7 May 2009 12:07:13 +0900
- Subject: Re: Support libc in Kernel
- References: <71413c850904300158uaa868bctfad8d17b8dfdaa2d@mail.gmail.com> <7E6B8AE2A6B6475F8348D44FBDECB44D@bibi> <71413c850904300236p5bd489b6j93965fcbc97443cb@mail.gmail.com> <B818E9323EEA402A8B9D979B45FF7CBC@bibi> <71413c850904300252t170e5993l7f2c87fb8abb1cae@mail.gmail.com> <4BB1495DC3464D019E1488E9DF7AA92C@bibi> <71413c850904301515r737008c8v31ea71d7e70bd81d@mail.gmail.com> <45554F4CBDD64D30B625D4333F7A75AA@bibi> <71413c850904301550m4bfe0e5fs2484282ae8ec88a5@mail.gmail.com> <409D4412864D4CC5850AB575313AAE76@bibi>
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.
>
>
>