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