enhancing IDT

This commit is contained in:
Adrien Bourmault 2019-04-26 10:36:40 +02:00
parent 59bd638188
commit ed534340ae
4 changed files with 15 additions and 8 deletions

View File

@ -98,8 +98,6 @@
│   │   ├── string.o │   │   ├── string.o
│   │   └── strtol.o │   │   └── strtol.o
│   ├── grub.log │   ├── grub.log
│   ├── kaleid32_disasm.asm
│   ├── kaleid64_disasm.asm
│   └── kernel.ld │   └── kernel.ld
├── include ├── include
│   ├── base │   ├── base
@ -190,4 +188,4 @@
├── ProjectTree ├── ProjectTree
└── README.md └── README.md
37 directories, 128 files 37 directories, 126 files

View File

@ -189,14 +189,14 @@ void IoDisableNMI(void)
// //
void IdtHandler(ulong intNo) void IdtHandler(ulong intNo)
{ {
int irrecoverable = 0; int recoverable = 0;
char *exceptionMsg = "Unhandled ISR exception"; char *exceptionMsg = "Unhandled ISR exception";
if (intNo == 0 || intNo == 6 || intNo == 8 || intNo == 13) irrecoverable++; if (intNo >= 32) recoverable++;
if (intNo < 32) exceptionMsg = IsrExceptions[intNo]; if (intNo < 32) exceptionMsg = IsrExceptions[intNo];
if (irrecoverable) { if (!recoverable) {
KeStartPanic("[ISR 0x%x] Irrecoverable %s\n", intNo, exceptionMsg); KeStartPanic("[ISR 0x%x] Irrecoverable %s\n", intNo, exceptionMsg);
} else { } else {
bprintf(BStdOut, "[ISR 0x%x] %s\n", intNo, exceptionMsg); bprintf(BStdOut, "[ISR 0x%x] %s\n", intNo, exceptionMsg);

View File

@ -28,6 +28,7 @@ global IdtInit
global divideByZero global divideByZero
extern idtPtr extern idtPtr
extern IdtHandler extern IdtHandler
extern label0
;; ;;
;; Loads the IDT ;; Loads the IDT

View File

@ -100,11 +100,19 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
/* } */ /* } */
/* IoPrintRtcTime(); */ /* IoPrintRtcTime(); */
/* } */ /* } */
long var = -1; int* var = 7*GB;
KernLog("salut : %s", var); *var = 2;
KernLog("Goodbye after %d ticks\n", IoGetRtcTicks()); KernLog("Goodbye after %d ticks\n", IoGetRtcTicks());
// End this machine's suffering // End this machine's suffering
BFlushBuf(BStdOut); BFlushBuf(BStdOut);
KeCrashSystem(); KeCrashSystem();
} }
void label0(void)
{
KernLog("Goodbye after %d ticks\n", IoGetRtcTicks());
// End this machine's suffering
BFlushBuf(BStdOut);
KeCrashSystem();
}