Skip to content

Commit

Permalink
GitBook: [master] 124 pages modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansimov authored and gitbook-bot committed Oct 8, 2020
1 parent 82c0fda commit 38d3fba
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 2 deletions.
3 changes: 2 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@

## 实验 <a id="labs"></a>

* [实验总览](labs/labs-overview.md)
* [实验总览](labs/labs-overview/README.md)
* [常见问题](labs/labs-overview/common-problems.md)
* [实验 1:Data Lab](labs/data-lab/README.md)
* [README(讲师版)](labs/data-lab/readme-instructor.md)
* [README(学生版)](labs/data-lab/readme-student.md)
Expand Down
2 changes: 1 addition & 1 deletion labs/data-lab/writeup.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ unix> make
unix> ./btest
```

注意,每次修改 bits.c 文件时都必须重新构建 btest。 你会发现,一次一个地完成这些函数,并在执行过程中对每个函数进行测试是很有帮助的。可以使用 -f 标志指示 btest 只测试单个函数:
**注意,每次修改 bits.c 文件时都必须重新构建 btest。** 你会发现,一次一个地完成这些函数,并在执行过程中对每个函数进行测试是很有帮助的。可以使用 -f 标志指示 btest 只测试单个函数:

```c
unix> ./btest -f bitXor
Expand Down
45 changes: 45 additions & 0 deletions labs/labs-overview/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 实验总览

## 参考资料

* 实验材料
* [http://csapp.cs.cmu.edu/3e/labs.html](http://csapp.cs.cmu.edu/3e/labs.html)
* [https://github.com/Hansimov/csapp/tree/master/\_labs](https://github.com/Hansimov/csapp/tree/master/_labs)
* 书中所有示例代码
* [http://csapp.cs.cmu.edu/3e/code.html](http://csapp.cs.cmu.edu/3e/code.html)
* [https://github.com/Hansimov/csapp/tree/master/\_codes/code](https://github.com/Hansimov/csapp/tree/master/_codes/code)
* 【读厚 CSAPP】实验概览 \| 小土刀 2.0
* [https://wdxtub.com/csapp/thick-csapp-lab-0/2016/04/16/](https://wdxtub.com/csapp/thick-csapp-lab-0/2016/04/16/)

## 实验综述

所有 CS:APP 的实验都有如下共性:

* **经历了 CMU 课堂的考验。**作者在 10 年时间里,在 150 ~ 250 名学生的课堂中开发和完善了这些实验。这门课得到了学生们的高度评价,他们通常认为这些实验是他们喜欢这门课的原因。
* **自动测试和评估驱动程序。**学生用 C 语言写解答,然后将其链接到 C 驱动程序中。驱动程序运行其解答,检查其正确性,并对解答进行定量评估。学生通过这些反馈逐步完善他们的解答。
* **解答。**为每位讲师提供了每个实验的完整解答。
* **自动评分器。**每个实验(Proxy Lab 除外)都有一个 Perl 自动评分器,为每个学生提交的文件运行驱动程序,并且打印一份 ASCII 成绩单。
* **完整的实验报告。**每个实验都有一份完整的报告(用 Latex 编写),其中包含环境(context)、分步说明和对评分标准的解释。

## 实验链接

{% page-ref page="../data-lab/" %}

{% page-ref page="../bomb-lab.md" %}

{% page-ref page="../attack-lab.md" %}

{% page-ref page="../arch-lab.md" %}

{% page-ref page="../cache-lab.md" %}

{% page-ref page="../perf-lab.md" %}

{% page-ref page="../shell-lab.md" %}

{% page-ref page="../malloc-lab.md" %}

{% page-ref page="../proxy-lab.md" %}



46 changes: 46 additions & 0 deletions labs/labs-overview/common-problems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 常见问题

## gcc not found

原因:机器没有安装 gcc。

方法:运行下列命令:

运行:

```c
sudo apt-get install build-essential
```

**参考链接:**

* C compiler not found, Ubuntu - Stack Overflow
* [https://stackoverflow.com/questions/22557029/c-compiler-not-found-ubuntu](https://stackoverflow.com/questions/22557029/c-compiler-not-found-ubuntu)

## fatal error: bits/libc-header-start.h: No such file or directory

原因:64 位机器的 gcc 只有 64 位的库,用 `-m32` 参数便会出错。

方法 1:删除 `-m32` 参数。但是这会导致许多依赖 32 位特性的代码错误。

方法 2**(推荐)**:安装 32 位的库:

```c
sudo apt-get install gcc-multilib
```

**参考链接:**

* c - "fatal error: bits/libc-header-start.h: No such file or directory" while compiling HTK - Stack Overflow
* [https://stackoverflow.com/questions/54082459/fatal-error-bits-libc-header-start-h-no-such-file-or-directory-while-compili](https://stackoverflow.com/questions/54082459/fatal-error-bits-libc-header-start-h-no-such-file-or-directory-while-compili)
* 32 bit - Trouble compiling a 32 bit binary on a 64 bit machine - Ask Ubuntu
* [https://askubuntu.com/questions/91909/trouble-compiling-a-32-bit-binary-on-a-64-bit-machine](https://askubuntu.com/questions/91909/trouble-compiling-a-32-bit-binary-on-a-64-bit-machine)

## 每次修改完代码,在 btest 前一定要重新 make

建议写成:

```c
make && ./btest
```

0 comments on commit 38d3fba

Please sign in to comment.