diff --git a/c_os/.clang-format b/c_os/.clang-format old mode 100644 new mode 100755 diff --git a/c_os/Makefile b/c_os/Makefile old mode 100644 new mode 100755 diff --git a/c_os/README b/c_os/README old mode 100644 new mode 100755 diff --git a/c_os/devices/BufferedCGA.cc b/c_os/devices/BufferedCGA.cc old mode 100644 new mode 100755 diff --git a/c_os/devices/BufferedCGA.h b/c_os/devices/BufferedCGA.h old mode 100644 new mode 100755 diff --git a/c_os/devices/CGA.cc b/c_os/devices/CGA.cc old mode 100644 new mode 100755 diff --git a/c_os/devices/CGA_Stream.cc b/c_os/devices/CGA_Stream.cc old mode 100644 new mode 100755 diff --git a/c_os/devices/CGA_Stream.h b/c_os/devices/CGA_Stream.h old mode 100644 new mode 100755 diff --git a/c_os/devices/Key.h b/c_os/devices/Key.h old mode 100644 new mode 100755 diff --git a/c_os/devices/Keyboard.cc b/c_os/devices/Keyboard.cc old mode 100644 new mode 100755 diff --git a/c_os/devices/Keyboard.h b/c_os/devices/Keyboard.h old mode 100644 new mode 100755 diff --git a/c_os/devices/PCSPK.cc b/c_os/devices/PCSPK.cc old mode 100644 new mode 100755 diff --git a/c_os/devices/PCSPK.h b/c_os/devices/PCSPK.h old mode 100644 new mode 100755 diff --git a/c_os/devices/PIT.h b/c_os/devices/PIT.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/Allocator.cc b/c_os/kernel/Allocator.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/Allocator.h b/c_os/kernel/Allocator.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/CPU.h b/c_os/kernel/CPU.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/IOport.h b/c_os/kernel/IOport.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/allocator/BumpAllocator.cc b/c_os/kernel/allocator/BumpAllocator.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/allocator/BumpAllocator.h b/c_os/kernel/allocator/BumpAllocator.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/allocator/LinkedListAllocator.cc b/c_os/kernel/allocator/LinkedListAllocator.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/allocator/LinkedListAllocator.h b/c_os/kernel/allocator/LinkedListAllocator.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/allocator/TreeAllocator.h b/c_os/kernel/allocator/TreeAllocator.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/allocator/TreeAllocatorOperations.cc b/c_os/kernel/allocator/TreeAllocatorOperations.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/interrupts/ISR.h b/c_os/kernel/interrupts/ISR.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/interrupts/IntDispatcher.cc b/c_os/kernel/interrupts/IntDispatcher.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/interrupts/IntDispatcher.h b/c_os/kernel/interrupts/IntDispatcher.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/interrupts/PIC.cc b/c_os/kernel/interrupts/PIC.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/interrupts/PIC.h b/c_os/kernel/interrupts/PIC.h old mode 100644 new mode 100755 diff --git a/c_os/kernel/threads/Thread.cc b/c_os/kernel/threads/Thread.cc old mode 100644 new mode 100755 diff --git a/c_os/kernel/threads/Thread.inc b/c_os/kernel/threads/Thread.inc old mode 100644 new mode 100755 diff --git a/c_os/kernel/threads/ThreadState.h b/c_os/kernel/threads/ThreadState.h old mode 100644 new mode 100755 diff --git a/c_os/lib/Chain.h b/c_os/lib/Chain.h old mode 100644 new mode 100755 diff --git a/c_os/lib/OutStream.cc b/c_os/lib/OutStream.cc old mode 100644 new mode 100755 diff --git a/c_os/lib/OutStream.h b/c_os/lib/OutStream.h old mode 100644 new mode 100755 diff --git a/c_os/lib/Semaphore.h b/c_os/lib/Semaphore.h old mode 100644 new mode 100755 diff --git a/c_os/lib/StringBuffer.cc b/c_os/lib/StringBuffer.cc old mode 100644 new mode 100755 diff --git a/c_os/lib/StringBuffer.h b/c_os/lib/StringBuffer.h old mode 100644 new mode 100755 diff --git a/c_os/main.cc b/c_os/main.cc index 1d87e1c..83d8091 100755 --- a/c_os/main.cc +++ b/c_os/main.cc @@ -50,26 +50,28 @@ int main() { << endl; // Tastatur-Unterbrechungsroutine 'einstoepseln' - /* hier muss Code eingefuegt werden */ kb.plugin(); pit.plugin(); // Interrupts erlauben (Tastatur, PIT) - /* hier muss Code eingefuegt werden */ cpu.enable_int(); // Activate paging // This has to happen after the allocator is initialized but before the scheduler is started pg_init(); + // NOTE: Because I introduced dynamic memory inside the scheduler (probably bad idea?) I have to add + // these init methods (allocator has to be initialized before but scheduler is constructed in the globals) + scheduler.init(); + // Demos // scheduler.ready(new TextDemo()); // scheduler.ready(new PCSPKdemo(&PCSPK::aerodynamic)); - scheduler.ready(new KeyboardDemo()); + // scheduler.ready(new KeyboardDemo()); // scheduler.ready(new HeapDemo()); // scheduler.ready(new VBEdemo()); // scheduler.ready(new BlueScreenDemo()); - // scheduler.ready(new PreemptiveThreadDemo()); + scheduler.ready(new PreemptiveThreadDemo()); // Scheduler starten (schedule() erzeugt den Idle-Thread) // scheduler.ready(new MainMenu()); @@ -78,17 +80,20 @@ int main() { // NOTE: Enforced ToDo's (needed) // DONE: Rewrite demos for threads // TODO: Make menu for demos + // TODO: 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? // // NOTE: Main ToDo's (extra) - // TODO: 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 - // 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 + // TODO: Implement realloc so ArrayList can realloc instead of newly allocate bigger block + // TODO: Array wrapper // // NOTE: Cleanup + Refactor // TODO: Use templates for queue so threads don't have to be casted down from chain @@ -98,7 +103,9 @@ int main() { // TODO: Cleanup: Remove I added this... Notes, just leave explanations // TODO: Remove Math "lib" or do something with it // TODO: Cleanup imports: Only import stuff in implementation when only needed there - // TODO: Switch cpu_disableint() to semaphore etc (I can't do this in the scheduler right?) + // 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 instead of memcpy + // TODO: Make more stuff const // Scheduler doesn't return return 0; diff --git a/c_os/sections b/c_os/sections old mode 100644 new mode 100755 diff --git a/c_os/user/ScrollbackBuffer.cc b/c_os/user/ScrollbackBuffer.cc old mode 100644 new mode 100755 diff --git a/c_os/user/demo/KeyboardDemo.cc b/c_os/user/demo/KeyboardDemo.cc old mode 100644 new mode 100755 diff --git a/c_os/user/demo/TextDemo.cc b/c_os/user/demo/TextDemo.cc old mode 100644 new mode 100755 diff --git a/c_os/user/demo/TextDemo.h b/c_os/user/demo/TextDemo.h old mode 100644 new mode 100755 diff --git a/flake.lock b/flake.lock old mode 100644 new mode 100755 diff --git a/flake.nix b/flake.nix old mode 100644 new mode 100755 diff --git a/tools/build.c b/tools/build.c old mode 100644 new mode 100755