项目

一般

简介

Wiki » 历史记录 » 版本 9

姚杰, 2021-12-29 11:24

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