mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
some stuff enhancement
This commit is contained in:
parent
6ee78caa4d
commit
b87af1d3d1
@ -132,7 +132,7 @@ void MmInitGdt(void);
|
||||
//
|
||||
// Loads the descriptor table
|
||||
//
|
||||
extern void MmLoadGdt(ulong ds, ulong cs, ulong tr);
|
||||
extern void MmLoadGdt();
|
||||
|
||||
|
||||
//
|
||||
|
@ -49,6 +49,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
|
||||
|
||||
// Memory
|
||||
MmInitMemoryMap();
|
||||
MmInitGdt();
|
||||
MmInitPaging();
|
||||
MmInitHeap();
|
||||
|
||||
|
@ -33,24 +33,13 @@ global MmStoreGdt
|
||||
;; Loads the GDT
|
||||
;;
|
||||
MmLoadGdt:
|
||||
|
||||
;; Loading the gdt via the gdtPtr pointer
|
||||
lgdt [rel gdtPtr]
|
||||
|
||||
;; Reloading the segment registers
|
||||
mov ax, si ; data segment
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
mov ss, ax
|
||||
mov cs, di ; code segment
|
||||
lgdt [gdtPtr]
|
||||
|
||||
;; We must far jump because we changed the GDT
|
||||
lea rax, [rel .next]
|
||||
lea rax, [.next]
|
||||
push rax
|
||||
ret
|
||||
|
||||
.next:
|
||||
;ltr dx ; the TSS
|
||||
ret
|
||||
|
@ -76,7 +76,7 @@ void MmInitGdt(void)
|
||||
|
||||
/* SetTssEntry(2, (ulong)&tssEntry, sizeof(TssEntry_t)); */
|
||||
|
||||
/* MmLoadGdt(0x8, 0x0, 2 << 3); */
|
||||
MmLoadGdt();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user