28 {
29 DeviceManagerSingleton::create();
30 auto& dm = DeviceManagerSingleton::instance();
31
32
33 Ns16550aDriverSingleton::create();
34 Pl011DriverSingleton::create();
35 VirtioDriverSingleton::create();
36
37 for (const auto& get_entry : kBuiltinDrivers) {
38 const auto& entry = get_entry();
39 if (auto r = dm.GetRegistry().Register(entry); !r) {
40 klog::Err(
"DeviceInit: register driver '{}' failed: {}", entry.name,
41 r.error().message());
42 return;
43 }
44 }
45
46 PlatformBus platform_bus(KernelFdtSingleton::instance());
47 if (auto r = dm.RegisterBus(platform_bus); !r) {
48 klog::Err(
"DeviceInit: PlatformBus enumeration failed: {}",
49 r.error().message());
50 return;
51 }
52
53 if (auto r = dm.ProbeAll(); !r) {
54 klog::Err(
"DeviceInit: ProbeAll failed: {}", r.error().message());
55 return;
56 }
57
59}
auto Err(etl::format_string< Args... > fmt, Args &&... args) -> void
以 ERROR 级别记录日志
auto Info(etl::format_string< Args... > fmt, Args &&... args) -> void
以 INFO 级别记录日志