fix: reprise du shell après erreur fatale, test avec commande pagefault
This commit is contained in:
parent
62bd72dfe0
commit
28c831870e
|
@ -17,3 +17,4 @@ int mode();
|
|||
int clear();
|
||||
int dump_regs();
|
||||
int info();
|
||||
int pagefault();
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
/*******************************************************************************/
|
||||
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
||||
/* */extern restart;
|
|
@ -7,6 +7,7 @@
|
|||
#include "memory.h"
|
||||
#include "video.h"
|
||||
#include "gdt.h"
|
||||
#include "system.h"
|
||||
|
||||
#define IDT_SIZE 256 /* nombre de descripteurs */
|
||||
|
||||
|
@ -16,6 +17,16 @@ static struct idtr idtreg;
|
|||
/* table de IDT */
|
||||
static idtdes idt[IDT_SIZE];
|
||||
|
||||
static u32 retry_address;
|
||||
|
||||
/******************************************************************************/
|
||||
/* Initialise la reprise après erreur */
|
||||
|
||||
void initretry(u32 address)
|
||||
{
|
||||
retry_address=address;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Initialise le controleur d'interruption 8259A */
|
||||
|
||||
|
@ -130,6 +141,9 @@ void cpuerror(const u8 * src)
|
|||
print("\033[31m***** ERREUR CPU ****\r\n -");
|
||||
print(src);
|
||||
dump_regs();
|
||||
print("<Appuyer une touche pour continuer>\r\n");
|
||||
waitascii();
|
||||
initselectors(retry_address);
|
||||
/*while (true) {
|
||||
nop();
|
||||
}*/
|
||||
|
|
16
lib/shell.c
16
lib/shell.c
|
@ -21,7 +21,8 @@ static command commands[] = {
|
|||
{"REGS" , "", &dump_regs},
|
||||
{"GDT" , "", &readgdt},
|
||||
{"IDT" , "", &readidt},
|
||||
{"INFO", "", &info}
|
||||
{"INFO" , "", &info},
|
||||
{"PAGEFAULT" , "", &pagefault}
|
||||
};
|
||||
|
||||
/*******************************************************************************/
|
||||
|
@ -56,7 +57,15 @@ void shell()
|
|||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
/* Génère une erreur de page à l'adresse 0xE0000000 */
|
||||
int pagefault()
|
||||
{
|
||||
print("*** Creation d'une erreur de page ***\r\n");
|
||||
asm("mov $0x66666666, %eax \n \
|
||||
mov %eax,0xE0000000");
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
/* Information sur le démarrage */
|
||||
int info()
|
||||
{
|
||||
|
@ -74,7 +83,6 @@ int regs()
|
|||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
|
||||
/* Change le mode */
|
||||
int mode()
|
||||
{
|
||||
|
@ -190,10 +198,10 @@ int readgdt()
|
|||
("\r\nSelecteur %hX: base:%X limit:%X access:%hX flags:%hX\r\n -> ",
|
||||
index * sizeof(gdtdes), base, limit, acces, flags);
|
||||
if ((acces >> 4) & 1 == 1)
|
||||
print("Systeme ");
|
||||
print("System ");
|
||||
else {
|
||||
if (acces & 1 == 1)
|
||||
print("Acces ");
|
||||
print("Access ");
|
||||
}
|
||||
if ((acces >> 3) & 1 == 1) {
|
||||
print("Code.");
|
||||
|
|
|
@ -81,6 +81,7 @@ int main(u32 magic, u32 addr)
|
|||
print("\033[37m\033[0m -Initilisation des interruptions (IDT/PIC)");
|
||||
initidt();
|
||||
initpic();
|
||||
initretry(&&retry);
|
||||
sti();
|
||||
ok();
|
||||
|
||||
|
@ -107,10 +108,6 @@ int main(u32 magic, u32 addr)
|
|||
initsyscall();
|
||||
ok();
|
||||
|
||||
print(" -Create a double fault error");
|
||||
asm("mov $0x66666666, %eax \n \
|
||||
mov %eax,0xE0000000");
|
||||
error();
|
||||
|
||||
retry:
|
||||
shell();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue