core: Enable interrupts in platformEndInit()
This way, each architecture can re-enable interrupts whenever necessary
This commit is contained in:
parent
5d26b114a4
commit
8d70a0f0a1
@ -15,4 +15,5 @@ pub fn platformInit() void {
|
|||||||
pub fn platformEndInit() void {
|
pub fn platformEndInit() void {
|
||||||
pic.remapPIC();
|
pic.remapPIC();
|
||||||
interrupts.syncInterrupts();
|
interrupts.syncInterrupts();
|
||||||
|
interrupts.enableInterrupts();
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ const pmm = @import("pmm.zig");
|
|||||||
const MultibootInfo = [*c]u8;
|
const MultibootInfo = [*c]u8;
|
||||||
|
|
||||||
export fn _start(magic: u32, info: MultibootInfo) callconv(.C) noreturn {
|
export fn _start(magic: u32, info: MultibootInfo) callconv(.C) noreturn {
|
||||||
|
interrupts.disableInterrupts();
|
||||||
|
|
||||||
if (magic != easyboot.MULTIBOOT2_BOOTLOADER_MAGIC) {
|
if (magic != easyboot.MULTIBOOT2_BOOTLOADER_MAGIC) {
|
||||||
debug.print("Invalid magic number: {x}\n", .{magic});
|
debug.print("Invalid magic number: {x}\n", .{magic});
|
||||||
while (true) {}
|
while (true) {}
|
||||||
@ -19,14 +21,10 @@ export fn _start(magic: u32, info: MultibootInfo) callconv(.C) noreturn {
|
|||||||
|
|
||||||
multiboot.parseMultibootTags(@ptrCast(info));
|
multiboot.parseMultibootTags(@ptrCast(info));
|
||||||
|
|
||||||
interrupts.disableInterrupts();
|
|
||||||
platform.platformInit();
|
platform.platformInit();
|
||||||
|
|
||||||
debug.print("GDT initialized\n", .{});
|
debug.print("GDT initialized\n", .{});
|
||||||
|
|
||||||
platform.platformEndInit();
|
|
||||||
interrupts.enableInterrupts();
|
|
||||||
|
|
||||||
if (multiboot.findMultibootTag(easyboot.multiboot_tag_mmap_t, @ptrCast(info))) |tag| {
|
if (multiboot.findMultibootTag(easyboot.multiboot_tag_mmap_t, @ptrCast(info))) |tag| {
|
||||||
var allocator = pmm.initializeFrameAllocator(tag) catch |err| {
|
var allocator = pmm.initializeFrameAllocator(tag) catch |err| {
|
||||||
debug.print("Error while initializing frame allocator: {}\n", .{err});
|
debug.print("Error while initializing frame allocator: {}\n", .{err});
|
||||||
@ -44,6 +42,8 @@ export fn _start(magic: u32, info: MultibootInfo) callconv(.C) noreturn {
|
|||||||
debug.print("No memory map multiboot tag found!\n", .{});
|
debug.print("No memory map multiboot tag found!\n", .{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
platform.platformEndInit();
|
||||||
|
|
||||||
asm volatile ("int3");
|
asm volatile ("int3");
|
||||||
|
|
||||||
while (true) {}
|
while (true) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user