Fix before panic framebuffer

This commit is contained in:
EnderIce2 2024-03-21 01:57:11 +02:00
parent 3a352045ab
commit bd24471748
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -111,21 +111,19 @@ nsa void InitFont()
CPU::Stop(); CPU::Stop();
} }
if (FbBeforePanic != nullptr) if (FbBeforePanic == nullptr)
KernelAllocator.FreePages(FbBeforePanic, FbPagesBeforePanic);
else
{ {
FbPagesBeforePanic = TO_PAGES(Display->GetSize); FbPagesBeforePanic = TO_PAGES(Display->GetSize);
FbBeforePanic = KernelAllocator.RequestPages(FbPagesBeforePanic); FbBeforePanic = KernelAllocator.RequestPages(FbPagesBeforePanic);
memcpy(FbBeforePanic, Display->GetBuffer, Display->GetSize); debug("Created before panic framebuffer at %#lx", FbBeforePanic);
} }
memcpy(FbBeforePanic, Display->GetBuffer, Display->GetSize);
if (CrashFont == nullptr) if (CrashFont)
{ return;
CrashFont = new Video::Font(&_binary_files_tamsyn_font_1_11_Tamsyn8x16b_psf_start, CrashFont = new Video::Font(&_binary_files_tamsyn_font_1_11_Tamsyn8x16b_psf_start,
&_binary_files_tamsyn_font_1_11_Tamsyn8x16b_psf_end, &_binary_files_tamsyn_font_1_11_Tamsyn8x16b_psf_end,
Video::FontType::PCScreenFont2); Video::FontType::PCScreenFont2);
}
} }
std::atomic<bool> UnrecoverableLock = false; std::atomic<bool> UnrecoverableLock = false;