init new objects + move demos to menu
This commit is contained in:
39
c_os/main.cc
39
c_os/main.cc
@ -12,16 +12,6 @@
|
|||||||
|
|
||||||
#include "kernel/Globals.h"
|
#include "kernel/Globals.h"
|
||||||
#include "kernel/Paging.h"
|
#include "kernel/Paging.h"
|
||||||
|
|
||||||
// Demos
|
|
||||||
// TODO: Make demo header or include through demo menu
|
|
||||||
#include "user/demo/BlueScreenDemo.h"
|
|
||||||
#include "user/demo/HeapDemo.h"
|
|
||||||
#include "user/demo/KeyboardDemo.h"
|
|
||||||
#include "user/demo/PCSPKdemo.h"
|
|
||||||
#include "user/demo/PreemptiveThreadDemo.h"
|
|
||||||
#include "user/demo/TextDemo.h"
|
|
||||||
#include "user/demo/VBEdemo.h"
|
|
||||||
#include "user/MainMenu.h"
|
#include "user/MainMenu.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
@ -31,7 +21,10 @@ int main() {
|
|||||||
allocator.init();
|
allocator.init();
|
||||||
|
|
||||||
// Initialize scrollback buffer after allocator.init()
|
// Initialize scrollback buffer after allocator.init()
|
||||||
kout.init(5);
|
// kout.init(5);
|
||||||
|
|
||||||
|
// Initialize SerialPort
|
||||||
|
serial.init();
|
||||||
|
|
||||||
// Startmeldung
|
// Startmeldung
|
||||||
kout << "HHUos 0.10\n"
|
kout << "HHUos 0.10\n"
|
||||||
@ -64,19 +57,18 @@ int main() {
|
|||||||
// these init methods (allocator has to be initialized before but scheduler is constructed in the globals)
|
// these init methods (allocator has to be initialized before but scheduler is constructed in the globals)
|
||||||
scheduler.init();
|
scheduler.init();
|
||||||
|
|
||||||
// Demos
|
// Test
|
||||||
// scheduler.ready(new TextDemo());
|
serial.write("Hello, this is a test message\r\n");
|
||||||
// scheduler.ready(new PCSPKdemo(&PCSPK::aerodynamic));
|
serial.write("Hello, this is a test message\r\n");
|
||||||
// scheduler.ready(new KeyboardDemo());
|
|
||||||
// scheduler.ready(new HeapDemo());
|
|
||||||
// scheduler.ready(new VBEdemo());
|
|
||||||
// scheduler.ready(new BlueScreenDemo());
|
|
||||||
scheduler.ready(new PreemptiveThreadDemo());
|
|
||||||
|
|
||||||
// Scheduler starten (schedule() erzeugt den Idle-Thread)
|
// Scheduler starten (schedule() erzeugt den Idle-Thread)
|
||||||
// scheduler.ready(new MainMenu());
|
scheduler.ready(new MainMenu()); // NOTE: A thread that manages other threads has to be added before scheduler.schedule(),
|
||||||
|
// 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
|
||||||
@ -94,6 +86,8 @@ int main() {
|
|||||||
// 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
|
||||||
|
// 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
|
// TODO: Use templates for queue so threads don't have to be casted down from chain
|
||||||
@ -106,6 +100,11 @@ int main() {
|
|||||||
// 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
|
||||||
|
// 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
|
||||||
|
// just get esp as argument
|
||||||
|
// TODO: Kevman unsubscribe is needed, because exited threads will still be woken up by kevman
|
||||||
|
// Or check if thread is still running
|
||||||
|
|
||||||
// Scheduler doesn't return
|
// Scheduler doesn't return
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user