Revert "Split the project into packages."
This reverts commit ab93a33bbd
.
This commit is contained in:
parent
b1718addde
commit
a023fadc24
32 changed files with 85 additions and 124 deletions
19
build.zig
19
build.zig
|
@ -13,7 +13,6 @@ const File = fs.File;
|
||||||
const Mode = std.builtin.Mode;
|
const Mode = std.builtin.Mode;
|
||||||
const TestMode = rt.TestMode;
|
const TestMode = rt.TestMode;
|
||||||
const ArrayList = std.ArrayList;
|
const ArrayList = std.ArrayList;
|
||||||
const Pkg = std.build.Pkg;
|
|
||||||
const Fat32 = @import("mkfat32.zig").Fat32;
|
const Fat32 = @import("mkfat32.zig").Fat32;
|
||||||
|
|
||||||
const x86_i686 = CrossTarget{
|
const x86_i686 = CrossTarget{
|
||||||
|
@ -38,10 +37,7 @@ pub fn build(b: *Builder) !void {
|
||||||
b.default_step.dependOn(&fmt_step.step);
|
b.default_step.dependOn(&fmt_step.step);
|
||||||
|
|
||||||
const main_src = "src/kernel/kmain.zig";
|
const main_src = "src/kernel/kmain.zig";
|
||||||
const pluto_src = "src/kernel/pluto.zig";
|
|
||||||
const arch_root = "src/kernel/arch";
|
const arch_root = "src/kernel/arch";
|
||||||
const arch_mock_src = "test/mock/kernel/arch_mock.zig";
|
|
||||||
const arch_src = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "arch.zig" });
|
|
||||||
const linker_script_path = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "link.ld" });
|
const linker_script_path = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "link.ld" });
|
||||||
const output_iso = try fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "pluto.iso" });
|
const output_iso = try fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "pluto.iso" });
|
||||||
const iso_dir_path = try fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "iso" });
|
const iso_dir_path = try fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "iso" });
|
||||||
|
@ -72,16 +68,6 @@ pub fn build(b: *Builder) !void {
|
||||||
exec.setLinkerScriptPath(std.build.FileSource{ .path = linker_script_path });
|
exec.setLinkerScriptPath(std.build.FileSource{ .path = linker_script_path });
|
||||||
exec.setTarget(target);
|
exec.setTarget(target);
|
||||||
|
|
||||||
var pluto_pkg = Pkg{ .name = "pluto", .path = .{ .path = pluto_src } };
|
|
||||||
var arch_pkg = Pkg{ .name = "arch", .path = .{ .path = arch_src } };
|
|
||||||
var arch_mock_pkg = Pkg{ .name = "arch_mock", .path = .{ .path = arch_mock_src } };
|
|
||||||
arch_mock_pkg.dependencies = &[_]Pkg{ arch_pkg, pluto_pkg, exec_options.getPackage("build_options") };
|
|
||||||
pluto_pkg.dependencies = &[_]Pkg{ arch_pkg, arch_mock_pkg, exec_options.getPackage("build_options") };
|
|
||||||
arch_pkg.dependencies = &[_]Pkg{ pluto_pkg, arch_mock_pkg, exec_options.getPackage("build_options") };
|
|
||||||
exec.addPackage(pluto_pkg);
|
|
||||||
exec.addPackage(arch_pkg);
|
|
||||||
exec.addPackage(arch_mock_pkg);
|
|
||||||
|
|
||||||
const make_iso = switch (target.getCpuArch()) {
|
const make_iso = switch (target.getCpuArch()) {
|
||||||
.i386 => b.addSystemCommand(&[_][]const u8{ "./makeiso.sh", boot_path, modules_path, iso_dir_path, exec_output_path, ramdisk_path, output_iso }),
|
.i386 => b.addSystemCommand(&[_][]const u8{ "./makeiso.sh", boot_path, modules_path, iso_dir_path, exec_output_path, ramdisk_path, output_iso }),
|
||||||
else => unreachable,
|
else => unreachable,
|
||||||
|
@ -127,9 +113,6 @@ pub fn build(b: *Builder) !void {
|
||||||
unit_tests.addOptions("build_options", unit_test_options);
|
unit_tests.addOptions("build_options", unit_test_options);
|
||||||
unit_test_options.addOption(TestMode, "test_mode", test_mode);
|
unit_test_options.addOption(TestMode, "test_mode", test_mode);
|
||||||
unit_tests.setTarget(.{ .cpu_arch = target.cpu_arch });
|
unit_tests.setTarget(.{ .cpu_arch = target.cpu_arch });
|
||||||
unit_tests.addPackage(pluto_pkg);
|
|
||||||
unit_tests.addPackage(arch_pkg);
|
|
||||||
unit_tests.addPackage(arch_mock_pkg);
|
|
||||||
|
|
||||||
if (builtin.os.tag != .windows) {
|
if (builtin.os.tag != .windows) {
|
||||||
b.enable_qemu = true;
|
b.enable_qemu = true;
|
||||||
|
@ -140,8 +123,6 @@ pub fn build(b: *Builder) !void {
|
||||||
mock_gen.setMainPkgPath(".");
|
mock_gen.setMainPkgPath(".");
|
||||||
const mock_gen_run = mock_gen.run();
|
const mock_gen_run = mock_gen.run();
|
||||||
unit_tests.step.dependOn(&mock_gen_run.step);
|
unit_tests.step.dependOn(&mock_gen_run.step);
|
||||||
exec.step.dependOn(&mock_gen_run.step);
|
|
||||||
b.default_step.dependOn(&mock_gen_run.step);
|
|
||||||
|
|
||||||
// Create test FAT32 image
|
// Create test FAT32 image
|
||||||
const test_fat32_img_step = Fat32BuilderStep.create(b, .{}, test_fat32_image_path);
|
const test_fat32_img_step = Fat32BuilderStep.create(b, .{}, test_fat32_image_path);
|
||||||
|
|
13
src/kernel/arch.zig
Normal file
13
src/kernel/arch.zig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
const std = @import("std");
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
const is_test = builtin.is_test;
|
||||||
|
const build_options = @import("build_options");
|
||||||
|
|
||||||
|
pub const internals = if (is_test) @import("../../test/mock/kernel/arch_mock.zig") else switch (builtin.cpu.arch) {
|
||||||
|
.i386 => @import("arch/x86/arch.zig"),
|
||||||
|
else => unreachable,
|
||||||
|
};
|
||||||
|
|
||||||
|
test "" {
|
||||||
|
_ = @import("arch/x86/arch.zig");
|
||||||
|
}
|
|
@ -3,11 +3,11 @@ const Allocator = std.mem.Allocator;
|
||||||
const log = std.log.scoped(.x86_arch);
|
const log = std.log.scoped(.x86_arch);
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const cmos = @import("cmos.zig");
|
const cmos = @import("cmos.zig");
|
||||||
pub const gdt = @import("gdt.zig");
|
const gdt = @import("gdt.zig");
|
||||||
pub const idt = @import("idt.zig");
|
const idt = @import("idt.zig");
|
||||||
const irq = @import("irq.zig");
|
const irq = @import("irq.zig");
|
||||||
const isr = @import("isr.zig");
|
const isr = @import("isr.zig");
|
||||||
pub const paging = @import("paging.zig");
|
const paging = @import("paging.zig");
|
||||||
const pic = @import("pic.zig");
|
const pic = @import("pic.zig");
|
||||||
const pci = @import("pci.zig");
|
const pci = @import("pci.zig");
|
||||||
const pit = @import("pit.zig");
|
const pit = @import("pit.zig");
|
||||||
|
@ -16,16 +16,15 @@ const serial = @import("serial.zig");
|
||||||
const syscalls = @import("syscalls.zig");
|
const syscalls = @import("syscalls.zig");
|
||||||
const tty = @import("tty.zig");
|
const tty = @import("tty.zig");
|
||||||
const vga = @import("vga.zig");
|
const vga = @import("vga.zig");
|
||||||
|
const mem = @import("../../mem.zig");
|
||||||
const multiboot = @import("multiboot.zig");
|
const multiboot = @import("multiboot.zig");
|
||||||
|
const vmm = @import("../../vmm.zig");
|
||||||
const keyboard = @import("keyboard.zig");
|
const keyboard = @import("keyboard.zig");
|
||||||
const pluto = @import("pluto");
|
const Serial = @import("../../serial.zig").Serial;
|
||||||
const mem = pluto.mem;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const vmm = pluto.vmm;
|
const TTY = @import("../../tty.zig").TTY;
|
||||||
const Keyboard = pluto.keyboard.Keyboard;
|
const Keyboard = @import("../../keyboard.zig").Keyboard;
|
||||||
const Serial = pluto.serial.Serial;
|
const Task = @import("../../task.zig").Task;
|
||||||
const panic = pluto.panic_root.panic;
|
|
||||||
const TTY = pluto.tty.TTY;
|
|
||||||
const Task = pluto.task.Task;
|
|
||||||
const MemProfile = mem.MemProfile;
|
const MemProfile = mem.MemProfile;
|
||||||
|
|
||||||
/// The type of a device.
|
/// The type of a device.
|
||||||
|
|
|
@ -3,7 +3,7 @@ const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const expectEqual = std.testing.expectEqual;
|
const expectEqual = std.testing.expectEqual;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
|
|
||||||
/// The current year to be used for calculating the 4 digit year, as the CMOS return the last two
|
/// The current year to be used for calculating the 4 digit year, as the CMOS return the last two
|
||||||
/// digits of the year.
|
/// digits of the year.
|
||||||
|
|
|
@ -6,7 +6,7 @@ const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
|
|
||||||
/// The access bits for a GDT entry.
|
/// The access bits for a GDT entry.
|
||||||
const AccessBits = packed struct {
|
const AccessBits = packed struct {
|
||||||
|
|
|
@ -8,7 +8,7 @@ const is_test = builtin.is_test;
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const gdt = if (is_test) @import("../../../../test/mock/kernel/gdt_mock.zig") else @import("gdt.zig");
|
const gdt = if (is_test) @import("../../../../test/mock/kernel/gdt_mock.zig") else @import("gdt.zig");
|
||||||
const arch = if (builtin.is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (builtin.is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
|
|
||||||
/// The structure that contains all the information that each IDT entry needs.
|
/// The structure that contains all the information that each IDT entry needs.
|
||||||
pub const IdtEntry = packed struct {
|
pub const IdtEntry = packed struct {
|
||||||
|
|
|
@ -7,9 +7,9 @@ const expectError = std.testing.expectError;
|
||||||
const log = std.log.scoped(.x86_irq);
|
const log = std.log.scoped(.x86_irq);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const idt = if (is_test) @import("arch_mock").idt_mock else @import("idt.zig");
|
const idt = if (is_test) @import("../../../../test/mock/kernel/idt_mock.zig") else @import("idt.zig");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const pic = if (is_test) @import("arch_mock").pic_mock else @import("pic.zig");
|
const pic = if (is_test) @import("../../../../test/mock/kernel/pic_mock.zig") else @import("pic.zig");
|
||||||
const interrupts = @import("interrupts.zig");
|
const interrupts = @import("interrupts.zig");
|
||||||
|
|
||||||
/// The error set for the IRQ. This will be from installing a IRQ handler.
|
/// The error set for the IRQ. This will be from installing a IRQ handler.
|
||||||
|
|
|
@ -8,8 +8,8 @@ const log = std.log.scoped(.x86_isr);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const syscalls = @import("syscalls.zig");
|
const syscalls = @import("syscalls.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const idt = if (is_test) @import("arch_mock").idt_mock else @import("idt.zig");
|
const idt = if (is_test) @import("../../../../test/mock/kernel/idt_mock.zig") else @import("idt.zig");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const interrupts = @import("interrupts.zig");
|
const interrupts = @import("interrupts.zig");
|
||||||
|
|
||||||
/// The error set for the ISR. This will be from installing a ISR handler.
|
/// The error set for the ISR. This will be from installing a ISR handler.
|
||||||
|
|
|
@ -6,7 +6,7 @@ const testing = std.testing;
|
||||||
const log = std.log.scoped(.x86_keyboard);
|
const log = std.log.scoped(.x86_keyboard);
|
||||||
const irq = @import("irq.zig");
|
const irq = @import("irq.zig");
|
||||||
const pic = @import("pic.zig");
|
const pic = @import("pic.zig");
|
||||||
const arch = if (builtin.is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (builtin.is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const kb = @import("../../keyboard.zig");
|
const kb = @import("../../keyboard.zig");
|
||||||
const Keyboard = kb.Keyboard;
|
const Keyboard = kb.Keyboard;
|
||||||
|
|
|
@ -7,7 +7,7 @@ const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (builtin.is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (builtin.is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const isr = @import("isr.zig");
|
const isr = @import("isr.zig");
|
||||||
const MemProfile = @import("../../mem.zig").MemProfile;
|
const MemProfile = @import("../../mem.zig").MemProfile;
|
||||||
const tty = @import("../../tty.zig");
|
const tty = @import("../../tty.zig");
|
||||||
|
|
|
@ -6,7 +6,7 @@ const build_options = @import("build_options");
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const ArrayList = std.ArrayList;
|
const ArrayList = std.ArrayList;
|
||||||
const log = std.log.scoped(.pci);
|
const log = std.log.scoped(.pci);
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
|
|
||||||
/// The port address for selecting a 32bit register in the PCI configuration space.
|
/// The port address for selecting a 32bit register in the PCI configuration space.
|
||||||
const CONFIG_ADDRESS: u16 = 0x0CF8;
|
const CONFIG_ADDRESS: u16 = 0x0CF8;
|
||||||
|
|
|
@ -5,7 +5,7 @@ const log = std.log.scoped(.x86_pic);
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
|
@ -7,7 +7,7 @@ const expectEqual = std.testing.expectEqual;
|
||||||
const expectError = std.testing.expectError;
|
const expectError = std.testing.expectError;
|
||||||
const log = std.log.scoped(.x86_pit);
|
const log = std.log.scoped(.x86_pit);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const irq = @import("irq.zig");
|
const irq = @import("irq.zig");
|
||||||
const pic = @import("pic.zig");
|
const pic = @import("pic.zig");
|
||||||
|
|
|
@ -6,11 +6,11 @@ const expectEqual = std.testing.expectEqual;
|
||||||
const expectError = std.testing.expectError;
|
const expectError = std.testing.expectError;
|
||||||
const log = std.log.scoped(.x86_rtc);
|
const log = std.log.scoped(.x86_rtc);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const pic = @import("pic.zig");
|
const pic = @import("pic.zig");
|
||||||
const pit = @import("pit.zig");
|
const pit = @import("pit.zig");
|
||||||
const irq = @import("irq.zig");
|
const irq = @import("irq.zig");
|
||||||
const cmos = if (is_test) @import("arch_mock").cmos_mock else @import("cmos.zig");
|
const cmos = if (is_test) @import("../../../../test/mock/kernel/cmos_mock.zig") else @import("cmos.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
const scheduler = @import("../../scheduler.zig");
|
const scheduler = @import("../../scheduler.zig");
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,12 @@ const log = std.log.scoped(.x86_syscalls);
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
const expect = std.testing.expect;
|
const expect = std.testing.expect;
|
||||||
const isr = @import("isr.zig");
|
const isr = @import("isr.zig");
|
||||||
const pluto = @import("pluto");
|
const panic = @import("../../panic.zig").panic;
|
||||||
const panic = pluto.panic_root.panic;
|
const syscalls = @import("../../syscalls.zig");
|
||||||
const syscalls = pluto.syscalls;
|
|
||||||
|
|
||||||
/// The isr number associated with syscalls
|
/// The isr number associated with syscalls
|
||||||
pub const INTERRUPT: u16 = 0x80;
|
pub const INTERRUPT: u16 = 0x80;
|
||||||
|
|
|
@ -7,7 +7,7 @@ const expectEqual = std.testing.expectEqual;
|
||||||
const expectError = std.testing.expectError;
|
const expectError = std.testing.expectError;
|
||||||
const log = std.log.scoped(.x86_tty);
|
const log = std.log.scoped(.x86_tty);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const vga = if (is_test) @import("arch_mock").vga_mock else @import("vga.zig");
|
const vga = if (is_test) @import("../../../../test/mock/kernel/vga_mock.zig") else @import("vga.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
|
|
||||||
/// The error set for if there is an error whiles printing.
|
/// The error set for if there is an error whiles printing.
|
||||||
|
|
|
@ -4,7 +4,7 @@ const is_test = builtin.is_test;
|
||||||
const expectEqual = std.testing.expectEqual;
|
const expectEqual = std.testing.expectEqual;
|
||||||
const log = std.log.scoped(.x86_vga);
|
const log = std.log.scoped(.x86_vga);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch.zig");
|
const arch = if (is_test) @import("../../../../test/mock/kernel/arch_mock.zig") else @import("arch.zig");
|
||||||
const panic = @import("../../panic.zig").panic;
|
const panic = @import("../../panic.zig").panic;
|
||||||
|
|
||||||
/// The port address for the VGA register selection.
|
/// The port address for the VGA register selection.
|
||||||
|
|
|
@ -8,9 +8,7 @@ const log = std.log.scoped(.fat32);
|
||||||
const AutoHashMap = std.AutoHashMap;
|
const AutoHashMap = std.AutoHashMap;
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const ArrayList = std.ArrayList;
|
const ArrayList = std.ArrayList;
|
||||||
const builtins = @import("builtin");
|
const arch = @import("../arch.zig").internals;
|
||||||
const is_test = builtins.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
const vfs = @import("vfs.zig");
|
const vfs = @import("vfs.zig");
|
||||||
const mem = @import("../mem.zig");
|
const mem = @import("../mem.zig");
|
||||||
const CodePage = @import("../code_page/code_page.zig").CodePage;
|
const CodePage = @import("../code_page/code_page.zig").CodePage;
|
||||||
|
|
|
@ -2,9 +2,7 @@ const std = @import("std");
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
const ArrayList = std.ArrayList;
|
const ArrayList = std.ArrayList;
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const builtin = @import("builtin");
|
const arch = @import("arch.zig").internals;
|
||||||
const is_test = builtin.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
|
|
||||||
/// An arbitrary number of keys to remember before dropping any more that arrive. Is a power of two so we can use nice overflowing addition
|
/// An arbitrary number of keys to remember before dropping any more that arrive. Is a power of two so we can use nice overflowing addition
|
||||||
pub const QUEUE_SIZE = 32;
|
pub const QUEUE_SIZE = 32;
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
const pluto = @import("pluto");
|
|
||||||
const build_options = @import("build_options");
|
|
||||||
const is_test = builtin.is_test;
|
|
||||||
const kmain_log = std.log.scoped(.kmain);
|
const kmain_log = std.log.scoped(.kmain);
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
const is_test = builtin.is_test;
|
||||||
|
const build_options = @import("build_options");
|
||||||
|
const arch = @import("arch.zig").internals;
|
||||||
|
const tty = @import("tty.zig");
|
||||||
|
const log_root = @import("log.zig");
|
||||||
|
const pmm = @import("pmm.zig");
|
||||||
|
const serial = @import("serial.zig");
|
||||||
|
const vmm = @import("vmm.zig");
|
||||||
|
const mem = @import("mem.zig");
|
||||||
|
const panic_root = @import("panic.zig");
|
||||||
|
const task = @import("task.zig");
|
||||||
|
const heap = @import("heap.zig");
|
||||||
|
const scheduler = @import("scheduler.zig");
|
||||||
|
const vfs = @import("filesystem/vfs.zig");
|
||||||
|
const initrd = @import("filesystem/initrd.zig");
|
||||||
|
const keyboard = @import("keyboard.zig");
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const tty = pluto.tty;
|
|
||||||
const panic_root = pluto.panic_root;
|
|
||||||
const log_root = pluto.log_root;
|
|
||||||
const heap = pluto.heap;
|
|
||||||
const serial = pluto.serial;
|
|
||||||
const pmm = pluto.pmm;
|
|
||||||
const vmm = pluto.vmm;
|
|
||||||
const keyboard = pluto.keyboard;
|
|
||||||
const initrd = pluto.initrd;
|
|
||||||
const vfs = pluto.vfs;
|
|
||||||
const scheduler = pluto.scheduler;
|
|
||||||
const task = pluto.task;
|
|
||||||
|
|
||||||
comptime {
|
comptime {
|
||||||
if (!is_test) {
|
if (!is_test) {
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = std.builtin;
|
const builtin = std.builtin;
|
||||||
const builtins = @import("builtin");
|
const arch = @import("arch.zig").internals;
|
||||||
const is_test = builtins.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
const mem = @import("mem.zig");
|
const mem = @import("mem.zig");
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const ArrayList = std.ArrayList;
|
const ArrayList = std.ArrayList;
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
pub const tty = @import("tty.zig");
|
|
||||||
pub const log_root = @import("log.zig");
|
|
||||||
pub const pmm = @import("pmm.zig");
|
|
||||||
pub const serial = @import("serial.zig");
|
|
||||||
pub const vmm = @import("vmm.zig");
|
|
||||||
pub const mem = @import("mem.zig");
|
|
||||||
pub const panic_root = @import("panic.zig");
|
|
||||||
pub const task = @import("task.zig");
|
|
||||||
pub const heap = @import("heap.zig");
|
|
||||||
pub const scheduler = @import("scheduler.zig");
|
|
||||||
pub const vfs = @import("filesystem/vfs.zig");
|
|
||||||
pub const initrd = @import("filesystem/initrd.zig");
|
|
||||||
pub const keyboard = @import("keyboard.zig");
|
|
||||||
pub const syscalls = @import("syscalls.zig");
|
|
|
@ -2,7 +2,7 @@ const is_test = @import("builtin").is_test;
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const log = std.log.scoped(.pmm);
|
const log = std.log.scoped(.pmm);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
const arch = @import("arch.zig").internals;
|
||||||
const MemProfile = @import("mem.zig").MemProfile;
|
const MemProfile = @import("mem.zig").MemProfile;
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
const panic = @import("panic.zig").panic;
|
const panic = @import("panic.zig").panic;
|
||||||
|
|
|
@ -6,7 +6,7 @@ const log = std.log.scoped(.scheduler);
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
const arch = @import("arch.zig").internals;
|
||||||
const panic = @import("panic.zig").panic;
|
const panic = @import("panic.zig").panic;
|
||||||
const task = @import("task.zig");
|
const task = @import("task.zig");
|
||||||
const vmm = @import("vmm.zig");
|
const vmm = @import("vmm.zig");
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
const builtin = @import("builtin");
|
const arch = @import("arch.zig").internals;
|
||||||
const is_test = builtin.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
|
|
||||||
pub const Serial = struct {
|
pub const Serial = struct {
|
||||||
|
|
|
@ -2,9 +2,7 @@ const std = @import("std");
|
||||||
const scheduler = @import("scheduler.zig");
|
const scheduler = @import("scheduler.zig");
|
||||||
const panic = @import("panic.zig").panic;
|
const panic = @import("panic.zig").panic;
|
||||||
const log = std.log.scoped(.syscalls);
|
const log = std.log.scoped(.syscalls);
|
||||||
const builtin = @import("builtin");
|
const arch = @import("arch.zig").internals;
|
||||||
const is_test = builtin.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
|
|
||||||
/// A compilation of all errors that syscall handlers could return.
|
/// A compilation of all errors that syscall handlers could return.
|
||||||
pub const Error = error{OutOfMemory};
|
pub const Error = error{OutOfMemory};
|
||||||
|
|
|
@ -4,7 +4,7 @@ const expectError = std.testing.expectError;
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
const arch = @import("arch.zig").internals;
|
||||||
const panic = @import("panic.zig").panic;
|
const panic = @import("panic.zig").panic;
|
||||||
const vmm = @import("vmm.zig");
|
const vmm = @import("vmm.zig");
|
||||||
const pmm = @import("pmm.zig");
|
const pmm = @import("pmm.zig");
|
||||||
|
|
|
@ -3,9 +3,7 @@ const fmt = std.fmt;
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const log = std.log.scoped(.tty);
|
const log = std.log.scoped(.tty);
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const builtin = @import("builtin");
|
const arch = @import("arch.zig").internals;
|
||||||
const is_test = builtin.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
const panic = @import("panic.zig").panic;
|
const panic = @import("panic.zig").panic;
|
||||||
|
|
||||||
/// The OutStream for the format function
|
/// The OutStream for the format function
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
const mock_path = build_options.mock_path;
|
const mock_path = build_options.mock_path;
|
||||||
|
const builtin = std.builtin;
|
||||||
|
const is_test = builtin.is_test;
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const log = std.log.scoped(.vmm);
|
const log = std.log.scoped(.vmm);
|
||||||
const bitmap = @import("bitmap.zig");
|
const bitmap = @import("bitmap.zig");
|
||||||
|
@ -7,9 +9,7 @@ const pmm = @import("pmm.zig");
|
||||||
const mem = @import("mem.zig");
|
const mem = @import("mem.zig");
|
||||||
const tty = @import("tty.zig");
|
const tty = @import("tty.zig");
|
||||||
const panic = @import("panic.zig").panic;
|
const panic = @import("panic.zig").panic;
|
||||||
const builtins = @import("builtin");
|
const arch = @import("arch.zig").internals;
|
||||||
const is_test = builtins.is_test;
|
|
||||||
const arch = if (is_test) @import("arch_mock") else @import("arch");
|
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const assert = std.debug.assert;
|
const assert = std.debug.assert;
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,18 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const pluto = @import("pluto");
|
const Allocator = std.mem.Allocator;
|
||||||
const arch = @import("arch");
|
const mem = @import("../../../src/kernel/mem.zig");
|
||||||
|
const MemProfile = mem.MemProfile;
|
||||||
const pci = @import("pci_mock.zig");
|
const pci = @import("pci_mock.zig");
|
||||||
const gdt = @import("gdt_mock.zig");
|
const gdt = @import("gdt_mock.zig");
|
||||||
const idt = @import("idt_mock.zig");
|
const idt = @import("idt_mock.zig");
|
||||||
|
const vmm = @import("../../../src/kernel/vmm.zig");
|
||||||
const paging = @import("paging_mock.zig");
|
const paging = @import("paging_mock.zig");
|
||||||
pub const cmos_mock = @import("cmos_mock.zig");
|
const Serial = @import("../../../src/kernel/serial.zig").Serial;
|
||||||
pub const vga_mock = @import("vga_mock.zig");
|
const TTY = @import("../../../src/kernel/tty.zig").TTY;
|
||||||
pub const pic_mock = @import("pic_mock.zig");
|
const Keyboard = @import("../../../src/kernel/keyboard.zig").Keyboard;
|
||||||
pub const idt_mock = @import("idt_mock.zig");
|
const task = @import("../../../src/kernel/task.zig");
|
||||||
pub const pci_mock = @import("pci_mock.zig");
|
const x86_paging = @import("../../../src/kernel/arch/x86/paging.zig");
|
||||||
const x86_paging = arch.paging;
|
|
||||||
const vmm = pluto.vmm;
|
|
||||||
const mem = pluto.mem;
|
|
||||||
const Serial = pluto.serial.Serial;
|
|
||||||
const TTY = pluto.tty.TTY;
|
|
||||||
const Keyboard = pluto.keyboard.Keyboard;
|
|
||||||
const task = pluto.task;
|
|
||||||
const Allocator = std.mem.Allocator;
|
|
||||||
const MemProfile = mem.MemProfile;
|
|
||||||
|
|
||||||
pub const Device = pci.PciDeviceInfo;
|
pub const Device = pci.PciDeviceInfo;
|
||||||
pub const DateTime = struct {
|
pub const DateTime = struct {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
const src_gdt = @import("arch").gdt;
|
// Can't do: TODO: https://github.com/SamTebbs33/pluto/issues/77
|
||||||
|
//const src_gdt = @import("arch").gdt;
|
||||||
|
const src_gdt = @import("../../../src/kernel/arch/x86/gdt.zig");
|
||||||
|
|
||||||
const mock_framework = @import("mock_framework.zig");
|
const mock_framework = @import("mock_framework.zig");
|
||||||
pub const initTest = mock_framework.initTest;
|
pub const initTest = mock_framework.initTest;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const src_idt = @import("arch").idt;
|
const src_idt = @import("../../../src/kernel/arch/x86/idt.zig");
|
||||||
|
|
||||||
const mock_framework = @import("mock_framework.zig");
|
const mock_framework = @import("mock_framework.zig");
|
||||||
pub const initTest = mock_framework.initTest;
|
pub const initTest = mock_framework.initTest;
|
||||||
|
|
Loading…
Reference in a new issue