Martins3 / Martins3.github.io

:book: Scratchpad about Linux, Compiler and Virtualization
https://martins3.github.io
GNU General Public License v2.0
61 stars 14 forks source link

setup env for porting #23

Closed Martins3 closed 3 years ago

Martins3 commented 3 years ago
Martins3 commented 3 years ago
Martins3 commented 3 years ago

交叉编译的方法:

  1. env.sh
  2. make -j10 ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
  3. rup='rsync -avz /home/maritns3/core/loongson-dune/cross loongson@10.90.50.133:/home/loongson/loongson'

在 loongson 上

  1. sudo make install / sudo make modules_install
  2. (第一次需要 ?) grub2-mkconfig -o /boot/efi/EFI/BOOT/grub.cfg
  3. /boot/efi/EFI/BOOT/grub.cfg 添加一个 menuentry, 全部照抄,包括 initramfs,内核指向各个编译的 /boot/the-kernel-name
Martins3 commented 3 years ago

交叉编译 Linux module 的方法 : https://stackoverflow.com/questions/3467850/cross-compiling-a-kernel-module 因为用户态程序是直接使用 x86 的编译器,从而可以 indexing, 而内核模块交叉编译,从而可以掌握全部的脚本。

Martins3 commented 3 years ago
Martins3 commented 3 years ago
Martins3 commented 3 years ago

clangd is unnecessary, the latest ccls works perfectly.

Martins3 commented 3 years ago

we can compile vz option successfully, but trap and emulate not.

Martins3 commented 3 years ago

about how to remove password: https://askubuntu.com/questions/281074/can-i-set-my-user-account-to-have-no-password