diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-04-16 10:29:30 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-04-29 09:05:04 +0200 |
| commit | 1b964278762dde86b0b737bd9a34fec569339f54 (patch) | |
| tree | 7fe0f4707e05f46461f03744d178f413b7bbca28 /arch/x86_64/src/devices/init.cpp | |
| parent | d906d70c94c2a40d5fc6fd26056c7bc57d540002 (diff) | |
| download | teachos-1b964278762dde86b0b737bd9a34fec569339f54.tar.xz teachos-1b964278762dde86b0b737bd9a34fec569339f54.zip | |
x86_64: use p1204 project layout
Diffstat (limited to 'arch/x86_64/src/devices/init.cpp')
| -rw-r--r-- | arch/x86_64/src/devices/init.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/arch/x86_64/src/devices/init.cpp b/arch/x86_64/src/devices/init.cpp deleted file mode 100644 index c30e8cf..0000000 --- a/arch/x86_64/src/devices/init.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include <arch/devices/init.hpp> - -#include <arch/boot/boot.hpp> -#include <arch/bus/isa.hpp> -#include <arch/devices/legacy_pit.hpp> - -#include <kapi/acpi.hpp> -#include <kapi/cpu.hpp> -#include <kapi/devices.hpp> - -#include <acpi/acpi.hpp> - -#include <kstd/memory> -#include <kstd/print> - -#include <cstdint> -#include <utility> - -namespace arch::devices -{ - - namespace - { - constexpr auto pit_frequency_in_hz = std::uint32_t{100u}; - - auto get_acpi_root_pointer() -> kstd::observer_ptr<::acpi::rsdp const> - { - auto const & mbi = kapi::boot::bootstrap_information.mbi; - auto system_description_pointer = static_cast<::acpi::rsdp const *>(nullptr); - - if (auto const & xsdp = mbi->maybe_acpi_xsdp()) - { - auto data = xsdp->pointer().data(); - - system_description_pointer = reinterpret_cast<::acpi::xsdp const *>(data); - } - else if (auto const & rsdp = mbi->maybe_acpi_rsdp()) - { - auto data = rsdp->pointer().data(); - system_description_pointer = reinterpret_cast<::acpi::rsdp const *>(data); - } - - return kstd::make_observer(system_description_pointer); - } - } // namespace - - auto init_acpi_devices() -> void - { - auto acpi_root_pointer = get_acpi_root_pointer(); - if (acpi_root_pointer && acpi_root_pointer->validate()) - { - if (kapi::acpi::init(*acpi_root_pointer)) - { - kstd::println("[x86_64:DEV] ACPI subsystem initialized."); - } - } - - kapi::cpu::discover_topology(); - } - - auto init_legacy_devices() -> void - { - kstd::println("[x86_64:DEV] Initializing ISA bus..."); - - auto isa_major_number = kapi::devices::allocate_major_number(); - auto isa_bus = kstd::make_unique<arch::bus::isa>(isa_major_number); - - auto pit_major_number = kapi::devices::allocate_major_number(); - auto pit = kstd::make_unique<arch::devices::legacy_pit>(pit_major_number, pit_frequency_in_hz); - isa_bus->add_child(std::move(pit)); - - auto & root_bus = kapi::devices::get_root_bus(); - root_bus.add_child(std::move(isa_bus)); - } - -} // namespace arch::devices |
