diff --git a/c_os/user/CoroutineDemo.cc b/c_os/user/CoroutineDemo.cc deleted file mode 100755 index b998e73..0000000 --- a/c_os/user/CoroutineDemo.cc +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * * - * C O R O U T I N E D E M O * - * * - *---------------------------------------------------------------------------* - * Beschreibung: Einstieg in eine Anwendung. * - * * - * Autor: Michael Schoettner, HHU, 15.8.2016 * - *****************************************************************************/ - -#include "user/CoroutineDemo.h" -#include "kernel/Globals.h" -#include "user/CoroutineLoop.h" - -/***************************************************************************** - * Methode: CoroutineDemo::main * - *---------------------------------------------------------------------------* - * Beschreibung: main-Methode der Anwendung. * - *****************************************************************************/ -void CoroutineDemo::main() const { - - /* - * Hier muss Code eingefuegt werden - * - * Die 3 Koroutinen einrichten, verketten und die 1. starten - * - */ - unsigned int(*stack)[1024] = new unsigned int[3][1024]; // No delete since it is never returned - - CoroutineLoop corout1(stack[0] + 1024, 0); - CoroutineLoop corout2(stack[1] + 1024, 1); - CoroutineLoop corout3(stack[2] + 1024, 2); - - corout1.setNext(&corout2); - corout2.setNext(&corout3); - corout3.setNext(&corout1); - - corout1.start(); -} diff --git a/c_os/user/CoroutineDemo.h b/c_os/user/CoroutineDemo.h deleted file mode 100755 index b1925ce..0000000 --- a/c_os/user/CoroutineDemo.h +++ /dev/null @@ -1,24 +0,0 @@ -/***************************************************************************** - * * - * C O R O U T I N E D E M O * - * * - *---------------------------------------------------------------------------* - * Beschreibung: Einstieg in eine Anwendung. * - * * - * Autor: Michael Schoettner, HHU, 15.8.2016 * - *****************************************************************************/ -#ifndef __coroutinedemo_include__ -#define __coroutinedemo_include__ - -class CoroutineDemo { -private: - CoroutineDemo(const CoroutineDemo& copy) = delete; // Verhindere Kopieren - -public: - CoroutineDemo() {} - - // Koroutine-Startmethode - void main() const; -}; - -#endif diff --git a/c_os/user/CoroutineLoop.cc b/c_os/user/CoroutineLoop.cc deleted file mode 100755 index 58d4972..0000000 --- a/c_os/user/CoroutineLoop.cc +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * * - * C O R O U T I N E L O O P * - * * - *---------------------------------------------------------------------------* - * Beschreibung: Loop ist eine Koroutine, die nichts weiter tut als einen * - * Zaehler hochzuzaehlen und diesen auf dem Bildschirm * - * anzuzeigen und dann auf die naechste Korotuine umzu- * - * schalten. * - * * - * Autor: Olaf Spinczyk, TU Dortmund * - *****************************************************************************/ - -#include "user/CoroutineLoop.h" -#include "kernel/Globals.h" - -/***************************************************************************** - * Methode: CoroutineLoop::run * - *---------------------------------------------------------------------------* - * Beschreibung: Einstiegsfunktion der Koroutine. * - *****************************************************************************/ -void CoroutineLoop::run() { - - /* Hier muss Code eingefuegt werden */ - - int i = 0; - while (true) { - kout.setpos(50, this->id); - kout << "Corout[" << this->id << "]: " << i++ << endl; - - this->switchToNext(); - } -} diff --git a/c_os/user/CoroutineLoop.h b/c_os/user/CoroutineLoop.h deleted file mode 100755 index d561bad..0000000 --- a/c_os/user/CoroutineLoop.h +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * * - * C O R O U T I N E L O O P * - * * - *---------------------------------------------------------------------------* - * Beschreibung: Loop ist eine Koroutine, die nichts weiter tut als einen * - * Zaehler hochzuzaehlen und diesen auf dem Bildschirm * - * anzuzeigen und dann auf die naechste Korotuine umzu- * - * schalten. * - * * - * Autor: Olaf Spinczyk, TU Dortmund * - *****************************************************************************/ - -#ifndef __coroutineloop_include__ -#define __coroutineloop_include__ - -#include "kernel/corouts/Coroutine.h" - -class CoroutineLoop : public Coroutine { - -private: - int id; - - CoroutineLoop(const CoroutineLoop& copy); // Verhindere Kopieren - -public: - // Gibt der Loop einen Stack und eine Id. - CoroutineLoop(unsigned int* stack, int i) : Coroutine(stack) { id = i; } - - // Zaehlt einen Zaehler hoch und gibt ihn auf dem Bildschirm aus. - void run(); -}; - -#endif