Re: How printf output messages to kernel with uclibc lib

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

 





On Sun, Feb 1, 2009 at 3:00 PM, loody <miloody@xxxxxxxxx> wrote:
2009/2/1 Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>:
> On Saturday 31 January 2009 07:18, loody wrote:
>> > Dear all:
>> >   I am porting kernel on my arm platform and I wrote a userspace
>> > program, hello world.
>> >   But I cannot see the "hello world".
>> >
>> >   my environment is:
>> >   1. uclinux.dist 2008
>> >   2. and I put my source code under user and compile it.
>> >   3. I use arm-linux-2006 to compile kernel
>> >   4. I use arm-linux-2007 to compile my hello world.
>> hi:
>> I have one question about my problem.
>> Can I replace the kernel execute command, "/init", as "/hello"; that
>> means the first user space program is hello, not standard int.
>> Is that the problem which make printt not workable?
>>
>> I have no idea whether kernel has to do something in "init" such that
>> "hello" can call printf to show message.
>
> [f]printf ultimately results in write() syscalls performed on
> open file descriptors.
>
> If you have trouble verifying that your userspace programs
> are able to execute, start with this test program:
>
> int main() {
>        write(1, "Hello\n", 6);
>        for (;;)
>                continue;
> }
>
> Compile it and run as init. You should see "Hello"
> message. If you don't, your toolchain is producing broken
> executables.
> --
> vda
>

Hi:
I have search the calls.S in arch/arm/kernel, but I cannot find the
sys call, write, you mention.
( I use arm platform, so I search the syscalls implemented by arm)
Is it a wrap function? If so, I guess I should include some header to do so.
But I have no idea what header I can use.

Check which system call does uclibc call for printf(). It might help.
 

appreciate your help,
miloody

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




--
Shaz


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux