1

Add initial main menu class

This commit is contained in:
2022-07-11 20:15:27 +02:00
parent 222cdd4547
commit 9d4996826a
3 changed files with 32 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#include "user/demo/PreemptiveThreadDemo.h"
#include "user/demo/TextDemo.h"
#include "user/demo/VBEdemo.h"
#include "user/MainMenu.h"
int main() {
kout.clear();
@ -78,7 +79,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
// New demos
// Demos
// scheduler.ready(new TextDemo());
// scheduler.ready(new PCSPKdemo(&PCSPK::aerodynamic));
// scheduler.ready(new KeyboardDemo());
@ -87,6 +88,7 @@ int main() {
// scheduler.ready(new PreemptiveThreadDemo());
// Scheduler starten (schedule() erzeugt den Idle-Thread)
scheduler.ready(new MainMenu());
scheduler.schedule();
// NOTE: Enforced ToDo's (needed)
@ -95,11 +97,14 @@ int main() {
//
// NOTE: Main ToDo's (extra)
// TODO: Basic event management for keyboard events so threads can utilize interrupt based inputs
// This also works well with a blocked-queue in the scheduler for threads waiting for input
// TODO: Textual UI with some sort of modeline
// TODO: Serial output, output graphviz dot data for memory etc.
// TODO: Some sort of extremely basic shell (basically can't do anything except start demos
// because there is no filesystem at all)
// TODO: Fix the damn TreeAllocator: Allow root deletion without bluescreen
// Maybe just remove the red black tree stuff and replace with usual binary search tree?
// I can just balance this tree unefficiantly by reinserting all nodes
//
// NOTE: Cleanup + Refactor
// TODO: Use templates for queue so threads don't have to be casted down from chain

7
c_os/user/MainMenu.cc Normal file
View File

@ -0,0 +1,7 @@
#include "user/MainMenu.h"
void MainMenu::run() {
kout << "Main Menu" << endl;
scheduler.exit();
}

19
c_os/user/MainMenu.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef __MainMenu_Inlucde_H_
#define __MainMenu_Inlucde_H_
#include "kernel/threads/Thread.h"
#include "kernel/Globals.h"
class MainMenu : public Thread {
private:
MainMenu(const MainMenu& copy) = delete;
public:
MainMenu() {
kout << "MainMenu initialized" << endl;
}
void run() override;
};
#endif