mirror of
https://github.com/Plexi09/Nadir-Kernel.git
synced 2026-10-20 15:07:27 +02:00
Include idt_init
This commit is contained in:
parent
e95bdb55cd
commit
d4b9c8763d
1 changed files with 5 additions and 2 deletions
|
|
@ -2,12 +2,13 @@
|
||||||
*
|
*
|
||||||
* Called once from the stage-2 entry stub after the CPU is in 64-bit long
|
* Called once from the stage-2 entry stub after the CPU is in 64-bit long
|
||||||
* mode with a valid stack, zeroed BSS and identity-mapped memory. Runs at
|
* mode with a valid stack, zeroed BSS and identity-mapped memory. Runs at
|
||||||
* Ring 0 (CPL 0), interrupts disabled, no IDT yet: any fault triple-faults,
|
* Ring 0 (CPL 0) interrupts disabled. Installs the exception IDT first
|
||||||
* so this function proves the whole boot chain simply by running.
|
* so from then on a fault prints diagnostics instead of triple-faulting.
|
||||||
* It never returns; on return the caller halts the CPU.
|
* It never returns; on return the caller halts the CPU.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "idt.h"
|
||||||
|
|
||||||
/* A value that only comes out right if the CPU truly executes 64-bit
|
/* A value that only comes out right if the CPU truly executes 64-bit
|
||||||
* arithmetic: every nibble survives the shifts above 32 bits. */
|
* arithmetic: every nibble survives the shifts above 32 bits. */
|
||||||
|
|
@ -18,6 +19,8 @@ void kmain(void)
|
||||||
console_clear();
|
console_clear();
|
||||||
console_puts("Hello World from Nadir Kernel !\n");
|
console_puts("Hello World from Nadir Kernel !\n");
|
||||||
console_puts("Running C code in 64-bit long mode (Ring 0).\n");
|
console_puts("Running C code in 64-bit long mode (Ring 0).\n");
|
||||||
|
idt_init();
|
||||||
|
console_puts("IDT installed (vectors 0-31).\n");
|
||||||
console_puts("64-bit proof value: ");
|
console_puts("64-bit proof value: ");
|
||||||
console_puthex64(PROOF_VALUE);
|
console_puthex64(PROOF_VALUE);
|
||||||
console_puts("\nHalting.\n");
|
console_puts("\nHalting.\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue