adapting GeekOS' kernel thread implementation