TurnOffNOD / linux_kernel_for_d1-OSFinal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OS期末大作业-14组(选做实验3)

使用的发行版:https://d1.docs.aw-ol.com/strong/strong_4debian/ ,用的是RVBoards_D1_Debian_img_v0.6.1版本

(下载地址:http://www.perfxlab.cn:8080/rvboards/)

先根据https://d1.docs.aw-ol.com/study/study_4compile/, 使用上述的发行版制作启动TF卡。

大作业代码架构:

用于使能的dts文件位于:arch/riscv/boot/dts/sunxi/board_enable_uart5.dts

使用:在该repo目录下,执行下述命令制作dtbo:

./scripts/dtc/dtc -I dts -O dtb arch/riscv/boot/dts/sunxi/board_enable_uart5.dts -o enable-uart5.dtbo

之后的步骤:

  1. 将上面制作得到的TF卡插入linux主机,(自己实验时是将TF卡+TF转SD卡卡套插入笔记本电脑的读卡器);
  2. 挂载,得到的enable-uart5.dtbo复制进入boot分区的overlay文件夹下,(实验时,在自己电脑的路径为/run/media/<username>/D899-0644/overlay);
  3. 修改boot分区下的config.txt,将dtoverlay一行修改为dtoverlay=enable-uart5
  4. unmount,将TF卡插入哪吒D1开发板启动。

此时将有了/dev/ttyS5,继续前往https://github.com/TurnOffNOD/group14-osFinal-NFCapp 即可。

下面是实验过程中的一些没有在最终结果中使用的中间探索说明,在此不作删除。

注意:现在自己微小修改过的脚本,需要将该repo和tina的sdk放在同一个目录下,并且将tina的sdk命名为tina-sdk-d1

下面是原repo带的readme说明,不做删除。

Instructions

Note: Please update the RVBoards image to V0.5 or above

Generate the kernel image rvboards_boot.img

1 Compile the kernel with./mk-kernel.sh and generate rvboards_img/rvboards_boot.img

Configure the default config and board.dts

1. config

   1. cp config_rvboards_d1 .config
   
2. rvboards_dts

   1. cd arch/riscv/boot/dts/sunxi/
   
   2. cp board.dts_rvboards_d1 board.dts

2 Download the cross-compile toolchain and configure CROSS_COMPILE in mk-kernel.sh

Baidu network disk link:https://pan.baidu.com/s/1-F9YPfm_dGFTlf-rld8OEw

Extract code:3o5v

Note:The cross-compilation toolchain is extracted from the Zhan D1 Nezha Tina SDK. The directory is as follows:

<<tina-d1-open/lichee/brandy-2.0/tools/toolchain/riscv64-linux-x86_64-20200528.tar.xz>>

Replace the kernel image rvboards_boot.img

 #1. Create a new Boot folder in the desktop directory
root@RVBoards:~/Desktop#  mkdir boot

 #2 mount the boot partition
root@RVBoards:~/Desktop# mount /dev/mmcblk0p4 boot/

 #3 Check if mount was successful
root@RVBoards:~/Desktop# ls boot/
'System Volume Information'   boot_debian.img   config.txt   rt-smart
 boot.img                     boot_tina.img     overlay
 
 #4. Place rvboards_boot.img in the boot directory and configure config.txt
root@RVBoards:~/Desktop/boot# vim config.txt
	## kernel=rvboards_boot.img
  
 #5. Restart to rvboards_boot.img
root@RVBoards:~/Desktop/boot# reboot

About

License:Other


Languages

Language:C 98.2%Language:Assembly 1.1%Language:Makefile 0.2%Language:Shell 0.2%Language:Python 0.1%Language:Perl 0.1%Language:C++ 0.0%Language:Roff 0.0%Language:SmPL 0.0%Language:Yacc 0.0%Language:Lex 0.0%Language:Awk 0.0%Language:UnrealScript 0.0%Language:Gherkin 0.0%Language:Raku 0.0%Language:M4 0.0%Language:Clojure 0.0%Language:XS 0.0%Language:sed 0.0%