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

Function first_process

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

Source from the content-addressed store, hash-verified

30}
31
32void first_process()
33{
34 int pid = fork();
35
36 if(pid == -1) {
37 printf("error\n");
38 asm_halt();
39 } else {
40 if(pid) {
41 while((pid = wait(nullptr)) != -1) {
42
43 }
44 asm_halt();
45 } else {
46 Shell shell;
47 shell.initialize();
48 shell.run();
49 }
50 }
51
52}
53
54void first_thread(void *arg)
55{

Callers

nothing calls this directly

Calls 5

runMethod · 0.80
forkFunction · 0.70
printfFunction · 0.70
waitFunction · 0.70
initializeMethod · 0.45

Tested by

no test coverage detected