Ported printk from Linux

To ease logging of the kernel, the printk function has been ported from
the Linux kernel (version 0.10).