Initial kernel code ported