1

dealloc memory when exiting vesa mode

This commit is contained in:
2022-07-22 20:44:35 +02:00
parent cde3967961
commit 061fa5db57
3 changed files with 9 additions and 4 deletions

View File

@ -56,8 +56,9 @@ struct VbeInfoBlock {
* Beschreibung: Schalter in den Text-Modus 80x25 Zeichen. * * Beschreibung: Schalter in den Text-Modus 80x25 Zeichen. *
*****************************************************************************/ *****************************************************************************/
void VESA::initTextMode() { void VESA::initTextMode() {
BC_params->AX = 0x4f02; // SVFA BIOS, init mode allocator.free((void*)hfb); // Memory is allocated after every start and never deleted, so add that
BC_params->BX = 0x4003; // 80x25 BC_params->AX = 0x4f02; // SVFA BIOS, init mode
BC_params->BX = 0x4003; // 80x25
bios.Int(0x10); bios.Int(0x10);
} }

View File

@ -103,5 +103,5 @@ void VBEdemo::run() {
drawFonts(); drawFonts();
// selbst terminieren // selbst terminieren
scheduler.exit(); // scheduler.exit();
} }

View File

@ -10,8 +10,8 @@
#ifndef __VBEdemo_include__ #ifndef __VBEdemo_include__
#define __VBEdemo_include__ #define __VBEdemo_include__
#include "kernel/threads/Thread.h"
#include "kernel/Globals.h" #include "kernel/Globals.h"
#include "kernel/threads/Thread.h"
class VBEdemo : public Thread { class VBEdemo : public Thread {
@ -28,6 +28,10 @@ public:
kout << "Initialized VBEdemo" << endl; kout << "Initialized VBEdemo" << endl;
} }
~VBEdemo() override {
vesa.initTextMode();
}
// Thread-Startmethode // Thread-Startmethode
void run() override; void run() override;