TD3:II.1 Add test programs

This commit is contained in:
Yorick Barbanneau 2021-12-08 01:32:57 +01:00
parent 07853cbcd3
commit 1b0dea618b
3 changed files with 28 additions and 0 deletions

8
code/test/forkexec.c Normal file
View file

@ -0,0 +1,8 @@
#include "syscall.h"
main()
{
ForkExec("../test/userpages0");
ForkExec("../test/userpages0");
while(1);
}

Binary file not shown.

20
code/test/userpages0.c Normal file
View file

@ -0,0 +1,20 @@
#include "syscall.h"
void output(char* s) {
int nb = 10;
int i;
for(i=0;i<nb;i++)
PutString((char*)s);
ThreadExit();
}
int main () {
// Premier Thread
void* f = output;
ThreadCreate(f,"a");
ThreadCreate(f,"b");
PutString("\nthis is the end of our main() in test program\n");
ThreadExit();
}