Splite uart code from kernel_main.c

It would be nice to split uart code from kernel_main.c.