Move register code to boot