wip zig kernel
This commit is contained in:
parent
e1926aec8a
commit
2dd27016f4
4 changed files with 246 additions and 21 deletions
29
build.zig
29
build.zig
|
@ -10,17 +10,35 @@ pub fn build(b: *std.Build) void {
|
|||
.outputname = "bootloader.bin",
|
||||
.flags = &.{"-f bin"},
|
||||
});
|
||||
const kernel = addNasmFiles(b, AddNasmFilesOptions{
|
||||
.filename = "src/kernel.asm",
|
||||
.outputname = "kernel.bin",
|
||||
.flags = &.{"-f bin"},
|
||||
//const kernel = addNasmFiles(b, AddNasmFilesOptions{
|
||||
// .filename = "src/kernel.asm",
|
||||
// .outputname = "kernel.bin",
|
||||
// .flags = &.{"-f bin"},
|
||||
//});
|
||||
|
||||
const target = b.standardTargetOptions(.{
|
||||
.default_target = .{
|
||||
.os_tag = .uefi,
|
||||
.cpu_arch = .x86,
|
||||
},
|
||||
});
|
||||
|
||||
const kernel_mod = b.addModule("kernel", .{
|
||||
.root_source_file = b.path("src/kernel.zig"),
|
||||
.target = target,
|
||||
});
|
||||
|
||||
const kernel = b.addExecutable(.{
|
||||
.root_module = kernel_mod,
|
||||
.linkage = .static,
|
||||
.name = "kernel",
|
||||
});
|
||||
|
||||
const floppy = createFloppy(b, "main_floppy.img");
|
||||
formatFloppyFat12(b, floppy);
|
||||
|
||||
var installToFloppy = installImgToFloppy(b, floppy, bootloader, &.{
|
||||
NamedFile{ .file = kernel, .name = "::kernel.bin" },
|
||||
NamedFile{ .file = kernel.getEmittedBin(), .name = "::kernel.bin" },
|
||||
NamedFile{ .file = b.path("src/reference_implementations/test.txt"), .name = "::test.txt" },
|
||||
});
|
||||
|
||||
|
@ -29,7 +47,6 @@ pub fn build(b: *std.Build) void {
|
|||
|
||||
b.getInstallStep().dependOn(&img_install.step);
|
||||
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const fat_reference_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/reference_implementations/fat.zig"),
|
||||
.target = target,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue