Skip to content

Commit

Permalink
remake script clangd
Browse files Browse the repository at this point in the history
  • Loading branch information
AstatineAi committed Mar 10, 2024
1 parent e1597e9 commit 0666306
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
18 changes: 16 additions & 2 deletions lecture_note/docs/pintos/proj2.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## 分析

`src/tests/userprog/Make.tests` 内有此 project 的自测数据点.
`tests/userprog/Make.tests` 内有此 project 的自测数据点.

```
tests/userprog/args-none_SRC = tests/userprog/args.c
Expand All @@ -36,4 +36,18 @@ else
msg ("end");
```
主要内容为打印命令行参数, 也就是需要实现为 user program 传参.
主要内容为打印命令行参数, 也就是需要实现为 user program 传参.
分析调用过程: 在 `threads/init.c` 中, `main() -> run_actions() -> run_task() -> process_wait (process_execute (task))`
看一下 `process_wait()`
```c
int
process_wait (tid_t child_tid UNUSED)
{
return -1;
}
```

按照注释里的内容, 这个函数作用是等待编号 `child_tid` 线程的运行结果, 如果被系统中止/传入的 `tid` 不存在/则返回 `-1`, 否则返回
5 changes: 3 additions & 2 deletions pintos/src/userprog/remake.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

make clean
make
bear -- make
mv compile_commands.json build/
cd build/
pintos-mkdisk filesys.dsk --filesys-size=2
cd ..

echo "userprog/ clean & rebuild."
echo "userprog/ clean & rebuild."

0 comments on commit 0666306

Please sign in to comment.