Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I looked over linux source code and i found that there is no 'printf'
Instead of 'pirntf', 'printf' was used in start_kernel().
Why is there 'printk' instead of 'printf'? Why can't we use 'printf'?
Posted

Check this link

printk()[^]
 
Share this answer
 
printk is a function available within the kernel since you do not have the standard library when you are writing kernel code, see : http://www.makelinux.net/books/lkd2/ch18lev1sec3[^]
 
Share this answer
 
Because libc functions (like printf) are not available in kernel space, see, for instance, this page: "3. User space and the libc interface"[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900