项目

一般

简介

Wiki » 历史记录 » 修订 5

修订 4 (姚杰, 2021-09-05 21:15) → 修订 5/12 (姚杰, 2021-09-05 23:31)

 
 {{>toc}} 

 h3. 开发环境 

 *本课程的开发环境基本要求如下:* 

 * CPU架构: x64 
 * 操作系统: GNU/Linux 
 * 编译器: GCC 
 * 编程语言: C语言 

 为了减少往届课程教学中,因为同学们构建开发环境的多样性而造成的各种兼容性问题影响实验进度的问题,课程组集中提供了虚拟机镜像(基于Ubuntu 20.04 Desktop)供同学们下载: 
 "Virtual Box镜像":https://course.cunok.cn/pa/root.vdi.tgz (注意,VirtualBox虚拟机"设置->系统->主板",启用EFI要选中。用户/密码: hust/hust) 
 如果自己搭建环境,可以参考手册中章节: "Installing GNU/Linux":/pa/doc2019/0.1.html 。如果还有问题,可以咨询老师。 


 h3. 开发步骤 

 * *首次设置* 
 # Clone code from hust server 
 <pre><code class="shell"> 
 git clone https://course.cunok.cn/pa/ics2019.git 
 </code></pre> 
 # Modify STUID and STUNAME in nemu/Makefile.git, then add and commit it. (Make sure you are in master branch) 
 <pre><code class="shell"> 
 git add -u 
 git commit -m 'updated id/name' 
 </code></pre> 
 # Setup your remote git repo (hustpa): 
 <pre><code class="shell"> 
 make setup 
 </code></pre> 
 # Change password after setup: 
 <pre><code class="shell"> 
 make password 
 </code></pre> 

 * *阶段切换* 
 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 
 <pre><code class="shell"> 
 git checkout pa1 
 git merge pa0 
 </code></pre> 

 * *代码提交* 
 # 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): branch): 
 <pre><code class="shell"> 
 make submit 
 </code></pre> 
 # See the review progress of your submission, and state of your report: 
 <pre><code class="shell"> 
 make info 
 </code></pre> 

 * *代码备份* 
 # Push code to hustpa remote(in branch pa0/pa1/pa2..) as many time as you want for backup: 
 <pre><code class="shell"> 
 git push hustpa pa1:pa1 
 </code></pre> 
 # Go ahead and have fun! 

 h3. 代码恢复 

 *从hustpa远程库恢复代码* 
 (假设当前目录为/home/hust. 注意本地如有ics2019目录,先改名或备份): 
 # 克隆代码(其间可能会显示unable to checkout或“不能检出”,这不是错误,是远程库没有master分支。可以使用git branch -avv 来查看远程分支来确定是否代码克隆下来了。) 
 <pre> 
 git clone https://course.cunok.cn/git/学号.git ics2019 
 </pre> 
 # 假设git branch -avv 看到有remotes/origin/pa1 
 你可以通过下列命令查看代码: 
 <pre> 
 git checkout origin/pa1 
 </pre> 
 然后从此远程分支新建一个本地分支: 
 <pre> 
 git checkout -b pa1 
 </pre> 
 # 修改.git/config,将其中的origin改成hustpa 
 # 检查环境变量设置,~/.bashrc 中的NEMU_HOME、AM_HOME、NAVY_HOME指向了新代码目录。然后source ~/.bashrc 或重开一个终端窗口。 


 h3. [[测试用例]] 

 h3. 课程检查要求 

 # *已经完成的PA阶段代码已经通过 make submit 提交* 
 # *实验报告的pdf版(加上电子签名),已经通过make submit提交* 

 h3. 相关资源 

 # Git code framework: https://course.cunok.cn/pa/ics2019.git 
 # Manual: https://course.cunok.cn/pa/doc2019 
 # VirtualBox disk image for PA (虚拟机设置->系统->主板,启用EFI要选中。用户/密码: hust/hust): 
 https://course.cunok.cn/pa/root.vdi.tgz 
 # PAL resource: (for PA3, Decompress the package and put the "pal" directory into ics2019/navy-apps/fsimg/share/games/) 
 https://course.cunok.cn/pa/pal.tbz 
 # "The RISC-V Reader中文版":https://course.cunok.cn/pa/RISC-V-Reader-Chinese-v2p1.pdf 
 # "RISC-V ISA Specification Volume 1":https://course.cunok.cn/pa/riscv-spec-20191213.pdf 
 # "RISC-V ISA Specification Volume 2":https://course.cunok.cn/pa/riscv-privileged-20190608.pdf 
 # "RISC-V ABI":https://course.cunok.cn/pa/riscv-abi.pdf 
 # "RISC-V Cross-compiler":https://course.cunok.cn/pa/gnu-mcu-eclipse-riscv-none-gcc-8.2.0-2.2-20190521-0004-centos64.tgz 
 # Linux software hust mirror site: 
 http://mirror.hust.edu.cn 


 h3. [[常见问题]] 


 Any other question, feel free to contact me: 姚杰<jackyao@hust.edu.cn>, 13517261606