diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-04-02 15:07:54 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-04-02 15:07:54 +0200 |
| commit | ab4c59912c526d515e6e72188c08a7f92e5573e8 (patch) | |
| tree | 0b6b561efb6fd8ac7a174edc6d4514a98f890861 /arch/x86_64/kapi | |
| parent | 66ffd2ad8c793c4eea1527848fe4772e42595718 (diff) | |
| download | teachos-ab4c59912c526d515e6e72188c08a7f92e5573e8.tar.xz teachos-ab4c59912c526d515e6e72188c08a7f92e5573e8.zip | |
x86_64: implement legacy PIT driver
Diffstat (limited to 'arch/x86_64/kapi')
| -rw-r--r-- | arch/x86_64/kapi/devices.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86_64/kapi/devices.cpp b/arch/x86_64/kapi/devices.cpp index 25185d6..7aa7090 100644 --- a/arch/x86_64/kapi/devices.cpp +++ b/arch/x86_64/kapi/devices.cpp @@ -1,20 +1,31 @@ #include "kapi/devices.hpp" #include "arch/bus/isa.hpp" +#include "arch/devices/legacy_pit.hpp" #include <kstd/memory> #include <kstd/print> +#include <cstdint> #include <utility> namespace kapi::devices { + namespace + { + constexpr auto pit_frequency_in_hz = std::uint32_t{100u}; + } + auto init_platform_devices() -> void { kstd::println("[x86_64:devices] Initializing ISA bus..."); + auto isa_bus = kstd::make_unique<arch::bus::isa>(); + auto pit = kstd::make_unique<arch::devices::legacy_pit>(pit_frequency_in_hz); + isa_bus->add_child(std::move(pit)); + auto & root_bus = get_root_bus(); root_bus.add_child(std::move(isa_bus)); } |
