MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / first_process

Function first_process

lab8/src/4/src/kernel/setup.cpp:31–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void first_process()
32{
33 int pid = fork();
34
35 if (pid == -1)
36 {
37 printf("can not fork\n");
38 }
39 else
40 {
41 if (pid)
42 {
43 printf("I am father, fork reutrn: %d\n", pid);
44 }
45 else
46 {
47 printf("I am child, fork return: %d, my pid: %d\n", pid, programManager.running->pid);
48 }
49 }
50
51 asm_halt();
52}
53
54void first_thread(void *arg)
55{

Callers

nothing calls this directly

Calls 2

forkFunction · 0.70
printfFunction · 0.70

Tested by

no test coverage detected