TD3:II.1 Add test programs
This commit is contained in:
parent
07853cbcd3
commit
1b0dea618b
3 changed files with 28 additions and 0 deletions
8
code/test/forkexec.c
Normal file
8
code/test/forkexec.c
Normal 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
20
code/test/userpages0.c
Normal 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();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue