Compare commits

...

3 Commits

2 changed files with 28 additions and 12 deletions

View File

@ -10,6 +10,7 @@ import hulk.console;
import hulk.klog;
import hulk.apic;
import hulk.cpu;
import hulk.kfont;
struct Idt
{
@ -83,19 +84,34 @@ struct Idt
movabs $$1f, %rax
jmp 2f
1:
pushq %rdi
pushq %rsi
pushq %rax
pushq %rcx
pushq %rdx
pushq %rsi
pushq %rdi
pushq %r8
pushq %r9
pushq %r10
pushq %r11
pushq %rbp
mov %rsp, %rbp
and $$0xFFFFFFFFFFFFFFF0, %rsp
mov $$", isr, ", %rdi
" ~ (isr_has_error_code(isr) ? "mov 0x20(%rsp), %rsi" : "") ~ "
" ~ (isr_has_error_code(isr) ? "lea 0x28(%rsp), %rdx" : "lea 0x20(%rsp), %rdx") ~ "
" ~ (isr_has_error_code(isr) ? "mov 0x50(%rbp), %rsi" : "") ~ "
" ~ (isr_has_error_code(isr) ? "lea 0x58(%rbp), %rdx" : "lea 0x50(%rbp), %rdx") ~ "
movabs $$isr, %rax
callq *%rax
popq %rdx
popq %rax
popq %rsi
mov %rbp, %rsp
popq %rbp
popq %r11
popq %r10
popq %r9
popq %r8
popq %rdi
popq %rsi
popq %rdx
popq %rcx
popq %rax
" ~ (isr_has_error_code(isr) ? "add $$8, %rsp" : "") ~ "
iretq
2:`, `={rax}`);");
@ -136,7 +152,7 @@ public extern(C) void isr(ulong vector, ulong arg, Idt.ExceptionStackFrame * sta
default:
Console.clear();
Fb.clear(0xFF8000u);
Fb.rect(0, 0, Fb.width, Kfont.line_height, 0xCC0000u);
Klog.writefln("ISR %u, error code 0x%x", vector, arg);
Klog.writefln("RIP = 0x%p", stack_frame.rip);
Klog.writefln("CS = 0x%x", stack_frame.cs);

View File

@ -1,8 +1,8 @@
project_name "x86_64-elf-gcc"
binutils_version = "2.35"
binutils_checksum = "1b11659fb49e20e18db460d44485f09442c8c56d5df165de9461eb09c8302f85"
gcc_version = "10.2.0"
gcc_checksum = "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
binutils_version = "2.41"
binutils_checksum = "ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450"
gcc_version = "13.2.0"
gcc_checksum = "e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da"
install_path = File.expand_path("x86_64-elf-gcc")
target = "x86_64-elf"
path_prepend "#{install_path}/bin"