kernel thread can run after code refactor

fix some bug, kernel thread can run now

Signed-off-by: Le Min <lemin9538@gmail.com>