项目

一般

简介

Wiki » 历史记录 » 版本 2

姚杰, 2021-09-05 20:47

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