1

update main

This commit is contained in:
2022-07-16 03:31:04 +02:00
parent bf3d807464
commit c0a74bb81d

View File

@ -14,30 +14,37 @@
#include "kernel/Paging.h" #include "kernel/Paging.h"
#include "user/MainMenu.h" #include "user/MainMenu.h"
int main() { void print_startup_message() {
kout.clear(); kout << "BSEos 1.0\n"
// Speicherverwaltung initialisieren
allocator.init();
// Initialize SerialPort
serial.init();
// Startmeldung
kout << "HHUos 0.10\n"
<< "==========\n" << "==========\n"
<< "Unterstuetzte Funktionen:\n" << "Unterstuetzte Funktionen:\n"
<< " - Bildschirmausgaben\n" << " - Bildschirmausgaben\n"
<< " - Sound ueber den PC-Lautsprecher\n" << " - Sound ueber den PC-Lautsprecher\n"
<< " - Tastatureingaben per Abfrage\n" << " - Tastatureingaben per Abfrage\n"
<< " - Einfache Heap verwaltung\n" << " - Einfache Heapverwaltung\n"
<< " - Tastatureingaben per Interrupt\n" << " - Tastatureingaben per Interrupt\n"
<< " - Kooperative Threads\n" << " - Kooperative Threads\n"
<< " - VESA Graphics Mode\n" << " - VESA Graphics Mode\n"
<< " - Einfaches Paging\n" << " - Einfaches Paging\n"
<< " - Preemptive Threads\n" << " - Preemptive Threads\n"
<< " - Einfache Synchronisierung\n" << " - Einfache Synchronisierung\n"
<< " - Einfache (Tastatur-)Eventverwaltung\n"
<< " - Serial Output Logging\n"
<< endl; << endl;
}
int main() {
kout.clear();
// Startmeldung
print_startup_message();
// Speicherverwaltung initialisieren
allocator.init();
// Initialize SerialPort
serial.init();
// Tastatur-Unterbrechungsroutine 'einstoepseln' // Tastatur-Unterbrechungsroutine 'einstoepseln'
kb.plugin(); kb.plugin();
@ -59,45 +66,43 @@ int main() {
// because scheduler.schedule() doesn't return, only threads get cpu time // because scheduler.schedule() doesn't return, only threads get cpu time
scheduler.schedule(); scheduler.schedule();
// BUG: Timer interrupt preemption works normal at first, but after a time there is a heap of output
// from the scheduler that is not triggered by PIT, I don't know why this occurs
// NOTE: Enforced ToDo's (needed) // NOTE: Enforced ToDo's (needed)
// DONE: Rewrite demos for threads // DONE: Rewrite demos for threads
// TODO: Make menu for demos // TODO: Make menu for demos
// TODO: Thread switching stops after a while // DONE: Thread switching stops after a while
// TODO: Prefer deblocked thread and find out why it doesn't work
// TODO: Threads are not cleanup after exit, use managed pointer? // TODO: Threads are not cleanup after exit, use managed pointer?
// //
// NOTE: Main ToDo's (extra) // NOTE: Main ToDo's (extra)
// DONE: Basic event management for keyboard events so threads can utilize interrupt based inputs // DONE: 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 // This also works well with a blocked-queue in the scheduler for threads waiting for input
// //
// TODO: Serial output, output graphviz dot data for memory etc. // DONE: Serial output
// TODO: Output graphviz stuff over serial
// TODO: Fix the damn TreeAllocator: Allow root deletion without bluescreen // 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? // 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 // I can just balance this tree unefficiantly by reinserting all nodes
// TODO: Implement realloc so ArrayList can realloc instead of newly allocate bigger block // TODO: Implement realloc so ArrayList can realloc instead of newly allocate bigger block
// TODO: Array wrapper // TODO: Array wrapper
// TODO: Rewrite Logging with a basic (synchronized) logger // DONE: Rewrite Logging with a basic (synchronized) logger
// TODO: String wrapper // TODO: String wrapper
// //
// NOTE: Cleanup + Refactor // NOTE: Cleanup + Refactor
// TODO: Use templates for queue so threads don't have to be casted down from chain // DONE: 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: Only use references instead of pointers where possible
// TODO: Unify debug output format // DONE: Unify debug output format
// TODO: Drawing Circles
// TODO: Cleanup: Remove I added this... Notes, just leave explanations // TODO: Cleanup: Remove I added this... Notes, just leave explanations
// TODO: Remove Math "lib" or do something with it // DONE: Remove Math "lib" or do something with it
// TODO: Cleanup imports: Only import stuff in implementation when only needed there // TODO: Cleanup imports: Only import stuff in implementation when only needed there
// TODO: Switch cpu_disableint() to semaphore etc (Spinlock in the scheduler?) // TODO: Switch cpu_disableint() to semaphore etc (Spinlock in the scheduler?)
// TODO: Change mylib types to not use T* but T and call with memcpy<Type*> instead of memcpy<Type> // TODO: Change mylib types to not use T* but T and call with memcpy<Type*> instead of memcpy<Type>
// TODO: Make more stuff const // TODO: Make more stuff const and static and static constexpr const
// TODO: Remove ArrayList init and do this inside ArrayList when an operation on the list is done // TODO: Remove ArrayList init and do this inside ArrayList when an operation on the list is done
// TODO: Remove CoroutineState/ThreadState and just use pusha/popa, start/switch methods should // TODO: Remove CoroutineState/ThreadState and just use pusha/popa, start/switch methods should
// just get esp as argument // just get esp as argument
// TODO: Kevman unsubscribe is needed, because exited threads will still be woken up by kevman // TODO: Kevman unsubscribe is needed, because exited threads will still be woken up by kevman
// Or check if thread is still running // Or check if thread is still running
// TODO: Delete copy constructors that weren't already deleted
// DONE: Switch out semaphore Queue with ArrayList? Or switch back Scheduler to Queue?
// Scheduler doesn't return // Scheduler doesn't return
return 0; return 0;