项目

一般

简介

Wiki » 历史记录 » 版本 7

姚杰, 2021-12-07 16:43

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 5 姚杰
# Important! when you finished current task phase, please submit it for review.(pa1 (make sure you are in pa0/pa1/pa2... branch, username is your STUID):
48 2 姚杰
<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 1 姚杰
</code></pre>
55 5 姚杰
56
* *代码备份*
57 2 姚杰
# Push code to hustpa remote(in branch pa0/pa1/pa2..) as many time as you want for backup:
58
<pre><code class="shell">
59
git push hustpa pa1:pa1
60
</code></pre>
61
# Go ahead and have fun!
62
63 1 姚杰
h3. 代码恢复
64
65 2 姚杰
*从hustpa远程库恢复代码*
66
(假设当前目录为/home/hust. 注意本地如有ics2019目录,先改名或备份):
67
# 克隆代码(其间可能会显示unable to checkout或“不能检出”,这不是错误,是远程库没有master分支。可以使用git branch -avv 来查看远程分支来确定是否代码克隆下来了。)
68
<pre>
69
git clone https://course.cunok.cn/git/学号.git ics2019
70
</pre>
71
# 假设git branch -avv 看到有remotes/origin/pa1
72
你可以通过下列命令查看代码:
73
<pre>
74
git checkout origin/pa1
75
</pre>
76
然后从此远程分支新建一个本地分支:
77
<pre>
78
git checkout -b pa1
79
</pre>
80
# 修改.git/config,将其中的origin改成hustpa
81
# 检查环境变量设置,~/.bashrc 中的NEMU_HOME、AM_HOME、NAVY_HOME指向了新代码目录。然后source ~/.bashrc 或重开一个终端窗口。
82 1 姚杰
83 2 姚杰
84 1 姚杰
h3. [[测试用例]]
85
86 2 姚杰
h3. 课程检查要求
87 1 姚杰
88 2 姚杰
# *已经完成的PA阶段代码已经通过 make submit 提交*
89 6 姚杰
# *最终实验报告的pdf版(加上电子签名),已经通过 make submit 提交(选6, Report)*
90 2 姚杰
91
h3. 相关资源
92
93
# Git code framework: https://course.cunok.cn/pa/ics2019.git
94 7 姚杰
# Manual: https://course.cunok.cn/pa/doc2019/
95 2 姚杰
# VirtualBox disk image for PA (虚拟机设置->系统->主板,启用EFI要选中。用户/密码: hust/hust):
96
https://course.cunok.cn/pa/root.vdi.tgz
97
# PAL resource: (for PA3, Decompress the package and put the "pal" directory into ics2019/navy-apps/fsimg/share/games/)
98 1 姚杰
https://course.cunok.cn/pa/pal.tbz
99 5 姚杰
# "The RISC-V Reader中文版":https://course.cunok.cn/pa/RISC-V-Reader-Chinese-v2p1.pdf
100
# "RISC-V ISA Specification Volume 1":https://course.cunok.cn/pa/riscv-spec-20191213.pdf
101
# "RISC-V ISA Specification Volume 2":https://course.cunok.cn/pa/riscv-privileged-20190608.pdf
102
# "RISC-V ABI":https://course.cunok.cn/pa/riscv-abi.pdf
103
# "RISC-V Cross-compiler":https://course.cunok.cn/pa/gnu-mcu-eclipse-riscv-none-gcc-8.2.0-2.2-20190521-0004-centos64.tgz
104 2 姚杰
# Linux software hust mirror site:
105
http://mirror.hust.edu.cn
106
107
108 3 姚杰
h3. [[常见问题]]
109 2 姚杰
110
111
Any other question, feel free to contact me: 姚杰<jackyao@hust.edu.cn>, 13517261606