项目

一般

简介

Wiki » 历史记录 » 版本 4

姚杰, 2021-09-05 21:15

1 4 姚杰
2
{{>toc}}
3
4 1 姚杰
h3. 开发环境
5
6
*本课程的开发环境基本要求如下:*
7
8
* CPU架构: x64
9
* 操作系统: GNU/Linux
10
* 编译器: GCC
11
* 编程语言: C语言
12
13 2 姚杰
为了减少往届课程教学中,因为同学们构建开发环境的多样性而造成的各种兼容性问题影响实验进度的问题,课程组集中提供了虚拟机镜像(基于Ubuntu 20.04 Desktop)供同学们下载:
14
"Virtual Box镜像":https://course.cunok.cn/pa/root.vdi.tgz (注意,VirtualBox虚拟机"设置->系统->主板",启用EFI要选中。用户/密码: hust/hust)
15
如果自己搭建环境,可以参考手册中章节: "Installing GNU/Linux":/pa/doc2019/0.1.html 。如果还有问题,可以咨询老师。
16 1 姚杰
17
18
h3. 开发步骤
19
20 2 姚杰
* *首次设置*
21
# Clone code from hust server
22
<pre><code class="shell">
23
git clone https://course.cunok.cn/pa/ics2019.git
24
</code></pre>
25
# Modify STUID and STUNAME in nemu/Makefile.git, then add and commit it. (Make sure you are in master branch)
26
<pre><code class="shell">
27
git add -u
28
git commit -m 'updated id/name'
29
</code></pre>
30
# Setup your remote git repo (hustpa):
31
<pre><code class="shell">
32
make setup
33
</code></pre>
34
# Change password after setup:
35
<pre><code class="shell">
36
make password
37
</code></pre>
38 1 姚杰
39 2 姚杰
* *阶段切换*
40
Everytime you finish current stage and wanna go to the next PA stage, don't forget to do merge first. e.g when entering pa1 from pa0
41
<pre><code class="shell">
42
git checkout pa1
43
git merge pa0
44
</code></pre>
45
46
* *代码提交*
47
# Important! when you finished current task phase, please submit it for review.(pa1 (make sure you are in pa0/pa1/pa2... branch):
48
<pre><code class="shell">
49
make submit
50
</code></pre>
51
# See the review progress of your submission, and state of your report:
52
<pre><code class="shell">
53
make info
54
</code></pre>
55
# Push code to hustpa remote(in branch pa0/pa1/pa2..) as many time as you want for backup:
56
<pre><code class="shell">
57
git push hustpa pa1:pa1
58
</code></pre>
59
# Go ahead and have fun!
60
61 1 姚杰
h3. 代码恢复
62
63 2 姚杰
*从hustpa远程库恢复代码*
64
(假设当前目录为/home/hust. 注意本地如有ics2019目录,先改名或备份):
65
# 克隆代码(其间可能会显示unable to checkout或“不能检出”,这不是错误,是远程库没有master分支。可以使用git branch -avv 来查看远程分支来确定是否代码克隆下来了。)
66
<pre>
67
git clone https://course.cunok.cn/git/学号.git ics2019
68
</pre>
69
# 假设git branch -avv 看到有remotes/origin/pa1
70
你可以通过下列命令查看代码:
71
<pre>
72
git checkout origin/pa1
73
</pre>
74
然后从此远程分支新建一个本地分支:
75
<pre>
76
git checkout -b pa1
77
</pre>
78
# 修改.git/config,将其中的origin改成hustpa
79
# 检查环境变量设置,~/.bashrc 中的NEMU_HOME、AM_HOME、NAVY_HOME指向了新代码目录。然后source ~/.bashrc 或重开一个终端窗口。
80 1 姚杰
81 2 姚杰
82 1 姚杰
h3. [[测试用例]]
83
84 2 姚杰
h3. 课程检查要求
85 1 姚杰
86 2 姚杰
# *已经完成的PA阶段代码已经通过 make submit 提交*
87
# *实验报告的pdf版(加上电子签名),已经通过make submit提交*
88
89
h3. 相关资源
90
91
# Git code framework: https://course.cunok.cn/pa/ics2019.git
92
# Manual: https://course.cunok.cn/pa/doc2019
93
# VirtualBox disk image for PA (虚拟机设置->系统->主板,启用EFI要选中。用户/密码: hust/hust):
94
https://course.cunok.cn/pa/root.vdi.tgz
95
# PAL resource: (for PA3, Decompress the package and put the "pal" directory into ics2019/navy-apps/fsimg/share/games/)
96
https://course.cunok.cn/pa/pal.tbz
97
# Linux software hust mirror site:
98
http://mirror.hust.edu.cn
99
100
101 3 姚杰
h3. [[常见问题]]
102 2 姚杰
103
104
Any other question, feel free to contact me: 姚杰<jackyao@hust.edu.cn>, 13517261606