Compare commits

..

No commits in common. "026e6d0e1aae0d3904360179d21c80839f2fdb57" and "fb71a09ec4b282275a00b4f11cf586f9344e5fc1" have entirely different histories.

3 changed files with 4 additions and 25 deletions

View File

@ -25,7 +25,7 @@ bochs: $(KERNEL_HDD) ext/bochsrc
rm bochsout.txt
gdb:
QEMUFLAGS="-s -S" $(MAKE) run & (sleep 1; gdb -x ext/gdbinit)
QEMUFLAGS="-s -S" $(MAKE) run & gdb -x ext/gdbinit
ext/limine/limine-install:
$(MAKE) -C ext/limine/ limine-install

View File

@ -42,8 +42,6 @@ void stivale2_main(struct stivale2_struct *info) {
);
printf("PAGE TABLE AT: %x\n", cr3);
loadgdt();
struct gdt_ptr pGDT;
__asm__ __volatile__("sgdt %0" : : "m"(pGDT) : "memory");
printf("GDT: %x (%d)\n", pGDT.base, pGDT.limit);

View File

@ -1,15 +1,10 @@
section .rodata
align 8
gdt64:
dq 0
.codesys: equ $-gdt64
.code: equ $-gdt64
dq (1<<44) | (1<<47) | (1<<41) | (1<<43) | (1<<53)
.datasys: equ $-gdt64
.data: equ $ - gdt64
dq (1<<44) | (1<<47) | (1<<41)
.codeusr: equ $-gdt64
dq (1<<44) | (1<<47) | (1<<41) | (1<<43) | (1<<53) | (3<<45)
.datausr: equ $-gdt64
dq (1<<44) | (1<<47) | (1<<41) | (3<<45)
.pointer:
dw .pointer - gdt64 - 1
dq gdt64
@ -18,18 +13,4 @@ section .text
global loadgdt
loadgdt:
lgdt [gdt64.pointer]
; now what I tried unsuccessfully:
mov rax, gdt64.codesys;
push rax
mov rax, loadgdtdone
push rax ; function to execute next
retfq ; far return (pops address and code segment)
loadgdtdone:
mov ax, gdt64.datasys
mov ss, ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
ret