From 8308cfb3f276a56318aa3ee2f1b5a37c30640252 Mon Sep 17 00:00:00 2001 From: pitust Date: Thu, 4 Nov 2021 07:56:54 +0000 Subject: [PATCH 1/2] bootboot: fix all the bad bugs --- stage23/protos/bootboot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stage23/protos/bootboot.c b/stage23/protos/bootboot.c index 9f5726c4..1b31a3f2 100644 --- a/stage23/protos/bootboot.c +++ b/stage23/protos/bootboot.c @@ -147,7 +147,7 @@ void bootboot_load(char *config) { cfgent[offset] = 0; } - + /// Identity mapping /// for (uint64_t i = 0; i < 0x400000000; i += 0x200000) { map_page(pmap, i, i, 0x03, true); } @@ -249,7 +249,7 @@ void bootboot_load(char *config) { if (e820e[i].type == 3) btype = 2; if (e820e[i].type == 4) btype = 2; - bootboot->mmap[i].size = (e820e[i].length & 0xF) | btype; + bootboot->mmap[i].size = (e820e[i].length & ~0xF) | btype; bootboot->mmap[i].ptr = e820e[i].base; } bootboot->size = 128 + mmapent * 16; @@ -266,6 +266,9 @@ void bootboot_load(char *config) { rm_int(0x15, &r, &r); #endif + pic_mask_all(); + io_apic_mask_all(); + irq_flush_type = IRQ_PIC_ONLY_FLUSH; for (size_t i = 0;i < numcores;i++) { From 3338c8daa33d54db894e96e70de9b6ca383d515e Mon Sep 17 00:00:00 2001 From: pitust Date: Thu, 4 Nov 2021 08:19:17 +0000 Subject: [PATCH 2/2] bootboot: flush both the pic and the apic --- stage23/protos/bootboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage23/protos/bootboot.c b/stage23/protos/bootboot.c index 1b31a3f2..301e2268 100644 --- a/stage23/protos/bootboot.c +++ b/stage23/protos/bootboot.c @@ -269,7 +269,7 @@ void bootboot_load(char *config) { pic_mask_all(); io_apic_mask_all(); - irq_flush_type = IRQ_PIC_ONLY_FLUSH; + irq_flush_type = IRQ_PIC_APIC_FLUSH; for (size_t i = 0;i < numcores;i++) { cores[i].extra_argument = 0;