This commit is contained in:
2026-02-10 16:37:28 +01:00
parent 67291f7f19
commit dd352266dc
13 changed files with 175 additions and 0 deletions

24
user/app1/appl.cc Normal file
View File

@@ -0,0 +1,24 @@
// vim: set noet ts=4 sw=4:
#include "../libsys/stub.h"
extern "C" void main() {
// Thread 1 may be an auxiliary thread
//sys_test(1,2,3,4,5);
unsigned id = sys_getpid();
char text[] = "testX";
text[4] = 0x30+id;
for (unsigned i = 1;; ++i) {
write(1, text, sizeof(text));
if(i==id){
//write(2, "kill", 4);
//write(2, &text[4], 1);
//write(2, " ", 1);
sys_exit();
}
sleep(1000);
}
}

32
user/app1/appl.h Normal file
View File

@@ -0,0 +1,32 @@
// vim: set noet ts=4 sw=4:
/*! \file
* \brief Enthält die Klasse Application
*/
#pragma once
#include "../libsys/types.h"
#include "../libsys/thread.h"
//! \brief Test application
//!
//! \note Any class derived from Thread defines an application for StuBS.
//!
class Application : public Thread {
// Prevent copies and assignments
Application(const Application&) = delete;
Application& operator=(const Application&) = delete;
public:
Application(Application&&) = delete;
/*! \brief Constructor
*
*/
Application() {}
/*! \brief Contains the application code.
*
*/
void action() override;
};

BIN
user/app1/build/app Executable file

Binary file not shown.

BIN
user/app1/build/app.img Executable file

Binary file not shown.

2
user/app1/build/appl.d Normal file
View File

@@ -0,0 +1,2 @@
build/appl.o: appl.cc ../../libsys/../libsys/stub.h \
../../libsys/../libsys/types.h

BIN
user/app1/build/appl.o Normal file

Binary file not shown.