1

enable helloworld thread demo

This commit is contained in:
churl
2022-06-05 16:58:02 +02:00
parent 973c76f010
commit f7b6cb658d
3 changed files with 16 additions and 15 deletions

View File

@ -11,6 +11,7 @@
*****************************************************************************/ *****************************************************************************/
#include "kernel/Globals.h" #include "kernel/Globals.h"
#include "user/HelloWorldThread.h"
int main() { int main() {
kout.clear(); kout.clear();
@ -50,8 +51,14 @@ int main() {
// key_irq_demo(); // key_irq_demo();
// coroutineDemo.main(); // coroutineDemo.main();
// Threads anlegen
scheduler.ready(new HelloWorldThread());
// Scheduler starten (schedule() erzeugt den Idle-Thread) // Scheduler starten (schedule() erzeugt den Idle-Thread)
scheduler.schedule(); scheduler.schedule();
// TODO: Use templates for queue so threads don't have to be casted down from chain
// TODO: Move scrollback control to thread
return 0; return 0;
} }

View File

@ -8,20 +8,18 @@
* Autor: Michael Schoettner, HHU, 21.8.2016 * * Autor: Michael Schoettner, HHU, 21.8.2016 *
*****************************************************************************/ *****************************************************************************/
#include "kernel/Globals.h"
#include "user/HelloWorldThread.h" #include "user/HelloWorldThread.h"
#include "kernel/Globals.h"
/***************************************************************************** /*****************************************************************************
* Methode: HelloWorldThread::run * * Methode: HelloWorldThread::run *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Beschreibung: Einstiegsfunktion in unseren Thread. * * Beschreibung: Einstiegsfunktion in unseren Thread. *
*****************************************************************************/ *****************************************************************************/
void HelloWorldThread::run () { void HelloWorldThread::run() {
kout << "Hallo Welt von einem Thread!" << endl; kout << "Hallo Welt von einem Thread!" << endl;
// selbst terminieren // selbst terminieren
scheduler.exit (); scheduler.exit();
} }

View File

@ -10,21 +10,17 @@
#ifndef __hello_world_thread_include__ #ifndef __hello_world_thread_include__
#define __hello_world_thread_include__ #define __hello_world_thread_include__
#include "kernel/threads/Thread.h" #include "kernel/threads/Thread.h"
class HelloWorldThread : public Thread { class HelloWorldThread : public Thread {
private: private:
HelloWorldThread (const HelloWorldThread &copy); // Verhindere Kopieren HelloWorldThread(const HelloWorldThread& copy) = delete; // Verhindere Kopieren
public: public:
HelloWorldThread () : Thread () { } HelloWorldThread() {}
// Thread-Startmethode // Thread-Startmethode
void run (); void run() override;
};
};
#endif #endif