1

reenable scrollback

This commit is contained in:
2022-07-11 15:37:16 +02:00
parent 012f68838b
commit 52ad3fc752
3 changed files with 34 additions and 34 deletions

View File

@ -16,7 +16,7 @@
#define __CGA_Stream_include__
// #include "devices/BufferedCGA.h"
#include "devices/CGA.h"
#include "devices/BufferedCGA.h"
#include "lib/OutStream.h"
// NOTE: I added this
@ -34,7 +34,7 @@ public:
};
// NOTE: I added this (changed this) to use BufferedCGA
class CGA_Stream : public OutStream, public CGA {
class CGA_Stream : public OutStream, public BufferedCGA {
private:
CGA_Stream(CGA_Stream& copy) = delete; // Verhindere Kopieren

View File

@ -341,9 +341,9 @@ void Keyboard::trigger() {
if (key.ctrl_left() && key.alt_left() && (char)key == 'r') {
this->reboot();
}
// else if ((char)key == 'k' || (char)key == 'j') {
// scroll_mode(key);
// }
else if ((char)key == 'k' || (char)key == 'j') {
scroll_mode(key);
}
}
// TODO: Where to place this?
@ -351,13 +351,13 @@ void Keyboard::trigger() {
// - Ereignisverwaltung, wo man Threads registrieren kann
// - Blockierte Threads verwalten und aufwecken bei ereignissen
// Waits for keys to control the scrollback buffer display
// void scroll_mode(Key key) {
// switch ((char)key) {
// case 'k':
// kout.scroll_page_backward();
// break;
// case 'j':
// kout.scroll_page_forward();
// break;
// }
// }
void scroll_mode(Key key) {
switch ((char)key) {
case 'k':
kout.scroll_page_backward();
break;
case 'j':
kout.scroll_page_forward();
break;
}
}

View File

@ -26,31 +26,30 @@ int main() {
allocator.init();
// Initialize scrollback buffer after allocator.init()
// kout.init(5);
kout.init(5);
// Startmeldung
if constexpr (!DEBUG) {
kout << "HHUos 0.9\n"
<< "=========\n"
<< "Unterstuetzte Funktionen:\n"
<< " - Bildschirmausgaben\n"
<< " - Sound ueber den PC-Lautsprecher\n"
<< " - Tastatureingaben per Abfrage\n"
<< " - Einfache Heap verwaltung\n"
<< " - Tastatureingaben per Interrupt\n"
<< " - Kooperative Threads\n"
<< " - VESA Graphics Mode\n"
<< " - Einfaches Paging\n"
<< " - Preemptive Threads\n"
<< endl;
}
kout << "HHUos 0.10\n"
<< "=========\n"
<< "Unterstuetzte Funktionen:\n"
<< " - Bildschirmausgaben\n"
<< " - Sound ueber den PC-Lautsprecher\n"
<< " - Tastatureingaben per Abfrage\n"
<< " - Einfache Heap verwaltung\n"
<< " - Tastatureingaben per Interrupt\n"
<< " - Kooperative Threads\n"
<< " - VESA Graphics Mode\n"
<< " - Einfaches Paging\n"
<< " - Preemptive Threads\n"
<< " - Einfache Synchronisierung\n"
<< endl;
// Tastatur-Unterbrechungsroutine 'einstoepseln'
/* hier muss Code eingefuegt werden */
kb.plugin();
pit.plugin();
// Interrupts erlauben (Tastatur)
// Interrupts erlauben (Tastatur, PIT)
/* hier muss Code eingefuegt werden */
cpu.enable_int();
@ -58,6 +57,7 @@ int main() {
// This has to happen after the allocator is initialized but before the scheduler is started
pg_init();
// TODO: Move this to demo
// Trigger Bluescreen
// kout << "Trigger Bluescreen, if you can read this it didn't work" << endl;
@ -73,6 +73,7 @@ int main() {
// *page = 42; // We map logical to physical 1:1 so no need to do any lookup
// // If tlb is invalidated this access produces a pagefault
// TODO: Make menu for demos
// Demo threads anlegen
// scheduler.ready(new HelloWorldThread());
// scheduler.ready(new CoopThreadDemo());
@ -86,9 +87,8 @@ int main() {
// TODO: Use templates for queue so threads don't have to be casted down from chain
// TODO: Change scheduler to only use references instead of pointers
// TODO: Rewrite all demos to threads
// TODO: Make menu for demos
// TODO: Unify debug output format
// TODO: Serial output
// TODO: Serial output, output graphviz dot data for memory etc.
// Scheduler doesn't return
return 0;