Move linker script
This commit is contained in:
parent
72269c28cc
commit
cec5d3c68d
2 changed files with 6 additions and 4 deletions
|
@ -31,7 +31,8 @@ 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 constants_path = try fs.path.join(b.allocator, &[_][]const u8{ "src/kernel/arch", arch, "constants.zig" });
|
const arch_root = "src/kernel/arch";
|
||||||
|
const constants_path = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "constants.zig" });
|
||||||
|
|
||||||
const build_mode = b.standardReleaseOptions();
|
const build_mode = b.standardReleaseOptions();
|
||||||
const rt_test = b.option(bool, "rt-test", "enable/disable runtime testing") orelse false;
|
const rt_test = b.option(bool, "rt-test", "enable/disable runtime testing") orelse false;
|
||||||
|
@ -41,7 +42,8 @@ pub fn build(b: *Builder) !void {
|
||||||
exec.setOutputDir(b.cache_root);
|
exec.setOutputDir(b.cache_root);
|
||||||
exec.addBuildOption(bool, "rt_test", rt_test);
|
exec.addBuildOption(bool, "rt_test", rt_test);
|
||||||
exec.setBuildMode(build_mode);
|
exec.setBuildMode(build_mode);
|
||||||
exec.setLinkerScriptPath("link.ld");
|
const linker_script_path = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "link.ld" });
|
||||||
|
exec.setLinkerScriptPath(linker_script_path);
|
||||||
exec.setTarget(target);
|
exec.setTarget(target);
|
||||||
|
|
||||||
const output_iso = try fs.path.join(b.allocator, &[_][]const u8{ b.exe_dir, "pluto.iso" });
|
const output_iso = try fs.path.join(b.allocator, &[_][]const u8{ b.exe_dir, "pluto.iso" });
|
||||||
|
|
|
@ -36,8 +36,8 @@ SECTIONS {
|
||||||
|
|
||||||
.bss.stack ALIGN(4K) : AT (ADDR(.bss.stack) - KERNEL_ADDR_OFFSET) {
|
.bss.stack ALIGN(4K) : AT (ADDR(.bss.stack) - KERNEL_ADDR_OFFSET) {
|
||||||
KEEP(*(.bss.stack))
|
KEEP(*(.bss.stack))
|
||||||
KERNEL_STACK_END = .;
|
KERNEL_STACK_END = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
KERNEL_VADDR_END = .;
|
KERNEL_VADDR_END = .;
|
||||||
KERNEL_PHYSADDR_END = . - KERNEL_ADDR_OFFSET;
|
KERNEL_PHYSADDR_END = . - KERNEL_ADDR_OFFSET;
|
Loading…
Reference in a new issue