finish some parts of register-driver.