feat(loader, kernel): impl part of loader and initialize kernel structure
This commit is contained in:
26
arch/x86_64/build_arch.zig
Normal file
26
arch/x86_64/build_arch.zig
Normal file
@@ -0,0 +1,26 @@
|
||||
const std = @import("std");
|
||||
const Step = std.Build.Step;
|
||||
const boot_build = @import("boot/build_boot.zig");
|
||||
|
||||
fn buildKernel(b: *std.Build, optimize: std.builtin.OptimizeMode) *Step.Compile {
|
||||
const target = b.resolveTargetQuery(.{
|
||||
.cpu_arch = .x86_64,
|
||||
.os_tag = .freestanding,
|
||||
.abi = .none,
|
||||
});
|
||||
const kernel = b.addExecutable(.{
|
||||
.name = "kernel",
|
||||
.root_module = b.addModule("kernel", .{
|
||||
.root_source_file = b.path("kernel/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
});
|
||||
kernel.entry = .{ .symbol_name = "start_kernel" };
|
||||
return kernel;
|
||||
}
|
||||
pub fn buildImage(b: *std.Build) void {
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
const kernel = buildKernel(b, optimize);
|
||||
boot_build.buildBootImage(b, kernel);
|
||||
}
|
||||
Reference in New Issue
Block a user