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