fix: correction du bogue de memoire dans process.c allocation des processes

This commit is contained in:
Nicolas Hordé 2018-12-12 18:49:21 +01:00
parent 81e7dcaa50
commit deea5829d3
2 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ void initgdt(u32 offset)
tss0.trapflag = 0x00; tss0.trapflag = 0x00;
tss0.iomap = 0x00; tss0.iomap = 0x00;
tss0.esp0 = 0x1FFF0; tss0.esp0 = 0x00;
tss0.ss0 = SEL_TSS; tss0.ss0 = SEL_TSS;
makegdtdes(&tss0, 0x67, SEG_PRESENT | SEG_CODE | SEG_RING3 | SEG_ACCESSED, 0x00, &gdt[7]); /* descripteur de tss */ makegdtdes(&tss0, 0x67, SEG_PRESENT | SEG_CODE | SEG_RING3 | SEG_ACCESSED, 0x00, &gdt[7]); /* descripteur de tss */

View File

@ -123,12 +123,12 @@ u32 elf_load(u8 * src, u32 pid)
void task_init() void task_init()
{ {
u32 i = 0; u32 i = 1;
processes = (process *) vmalloc(sizeof(process) * MAXNUMPROCESS); processes = (process *) vmalloc(sizeof(process) * MAXNUMPROCESS);
while (i++ < MAXNUMPROCESS) while (i < MAXNUMPROCESS)
{ {
processes[i].pid = NULL; processes[i].pid = NULL;
processes[i].status = STATUS_FREE; processes[i++].status = STATUS_FREE;
} }
processes[0].dump.ss = SEL_KERNEL_STACK; processes[0].dump.ss = SEL_KERNEL_STACK;
processes[0].dump.esp = KERNEL_STACK_ADDR; processes[0].dump.esp = KERNEL_STACK_ADDR;