xref: /DragonOS/kernel/src/driver/base/init.rs (revision c75089286e9d49cef8d039446bf570c1bd4d2550)
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