diff options
author | Himbeer <himbeer@disroot.org> | 2024-05-23 13:48:01 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-05-23 13:48:01 +0200 |
commit | 3274a700daff545437f919041cbdce6938eede06 (patch) | |
tree | 60a4ec5ebb1406af20733027a2bb4a5d54e54908 /src/Console.zig | |
parent | 0f61d3bed969fecb35e438bfac2fe34f588834c6 (diff) |
Drop FDT support in favor of custom HWI format
Fixes numerous parsing bugs and increases efficiency. The kernel now runs successfully on the Lichee Pi 4A.
Diffstat (limited to 'src/Console.zig')
-rw-r--r-- | src/Console.zig | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/Console.zig b/src/Console.zig deleted file mode 100644 index ad2249e..0000000 --- a/src/Console.zig +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Himbeer <himbeer@disroot.org> -// -// SPDX-License-Identifier: AGPL-3.0-or-later - -const std = @import("std"); - -const debug_console = @import("sbi/debug_console.zig"); -const fdt = @import("fdt.zig"); -const legacy = @import("sbi/legacy.zig"); -const paging = @import("paging.zig"); - -provider: Provider, - -const Self = @This(); - -pub const Provider = union(enum) { - sbi_debug: debug_console.Writer, - sbi_legacy: legacy.Writer, -}; - -pub fn autoChoose() ?Self { - if (debug_console.writer()) |sbi_con| { - return .{ - .provider = .{ .sbi_debug = sbi_con }, - }; - } else |_| {} - if (legacy.writer()) |sbi_legacy_con| { - return .{ - .provider = .{ .sbi_legacy = sbi_legacy_con }, - }; - } else |_| {} - - return null; -} - -pub fn writer(console: *const Self) std.io.AnyWriter { - switch (console.provider) { - .sbi_debug => return console.provider.sbi_debug.any(), - .sbi_legacy => return console.provider.sbi_legacy.any(), - } -} |