fixed the asm compiling bug
This commit is contained in:
parent
ce879e11b2
commit
a6471bb147
7 changed files with 13 additions and 12 deletions
|
|
@ -7,13 +7,12 @@ pub fn build(b: *Builder) void {
|
|||
kernel.addPackagePath("arch", "src/arch/x86/lib/index.zig");
|
||||
kernel.setOutputDir("build");
|
||||
|
||||
// kernel.addAssemblyFile("src/arch/x86/_start.s");
|
||||
kernel.addAssemblyFile("src/arch/x86/_start.s");
|
||||
kernel.addAssemblyFile("src/arch/x86/gdt.s");
|
||||
// kernel.addAssemblyFile("src/arch/x86/isr.s");
|
||||
kernel.addAssemblyFile("src/arch/x86/isr.s");
|
||||
|
||||
kernel.setBuildMode(b.standardReleaseOptions());
|
||||
kernel.setTarget(builtin.Arch.i386, builtin.Os.freestanding, builtin.Abi.none);
|
||||
kernel.setLinkerScriptPath("src/arch/x86/linker.ld");
|
||||
|
||||
b.default_step.dependOn(&kernel.step);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
.global _start
|
||||
.type _start, @function
|
||||
.global __start
|
||||
.type __start, @function
|
||||
|
||||
// Entry point. It puts the machine into a consistent state,
|
||||
// starts the kernel and then waits forever.
|
||||
_start:
|
||||
__start:
|
||||
mov $0x80000, %esp // Setup the stack.
|
||||
|
||||
push %ebx // Pass multiboot info structure.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
.type loadGDT, @function
|
||||
.global loadGDT
|
||||
|
||||
////
|
||||
//
|
||||
// Load the GDT into the system registers.
|
||||
//
|
||||
// Arguments:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ USER_DS = 0x23
|
|||
.macro isrGenerate n
|
||||
.align 4
|
||||
.type isr\n, @function
|
||||
.global isr\n
|
||||
|
||||
isr\n:
|
||||
// Push a dummy error code for interrupts that don't have one.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* ENTRY(_start) */
|
||||
ENTRY(x86_main)
|
||||
ENTRY(__start)
|
||||
/* ENTRY(x86_main) */
|
||||
/* OUTPUT_FORMAT(elf32-i386) */
|
||||
|
||||
SECTIONS {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use @import("kernel").main;
|
||||
use @import("kernel").multiboot;
|
||||
usingnamespace @import("kernel").main;
|
||||
usingnamespace @import("kernel").multiboot;
|
||||
const idt = @import("idt.zig");
|
||||
const gdt = @import("gdt.zig");
|
||||
const x86 = @import("lib/index.zig");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use @import("multiboot.zig");
|
||||
usingnamespace @import("multiboot.zig");
|
||||
const pci = @import("pci.zig");
|
||||
const arch = @import("arch/x86/lib/index.zig");
|
||||
const console = @import("console.zig");
|
||||
|
|
|
|||
Loading…
Reference in a new issue