1 use crate::{driver::tty::tty_device::tty_init, syscall::SystemError}; 2 3 use super::{ 4 class::classes_init, 5 device::{bus::buses_init, init::devices_init}, 6 firmware::firmware_init, 7 hypervisor::hypervisor_init, 8 platform::platform_bus_init, 9 }; 10 11 pub(super) fn driver_init() -> Result<(), SystemError> { 12 devices_init()?; 13 buses_init()?; 14 classes_init()?; 15 firmware_init()?; 16 hypervisor_init()?; 17 platform_bus_init()?; 18 19 // 至此,已完成设备驱动模型的初始化 20 // 接下来,初始化设备 21 actual_device_init()?; 22 return Ok(()); 23 } 24 25 fn actual_device_init() -> Result<(), SystemError> { 26 tty_init()?; 27 28 return Ok(()); 29 } 30