Cov txheej txheem:

64 ntsis RT Kernel Compilation rau Raspberry Pi 4B.: 5 Kauj Ruam
64 ntsis RT Kernel Compilation rau Raspberry Pi 4B.: 5 Kauj Ruam

Video: 64 ntsis RT Kernel Compilation rau Raspberry Pi 4B.: 5 Kauj Ruam

Video: 64 ntsis RT Kernel Compilation rau Raspberry Pi 4B.: 5 Kauj Ruam
Video: Nuj nplhaib trung quốc 2024, Kaum ib hlis
Anonim
64 ntsis RT Kernel Compilation rau Raspberry Pi 4B
64 ntsis RT Kernel Compilation rau Raspberry Pi 4B

Cov ntawv qhia no yuav npog cov txheej txheem ntawm kev tsim thiab teeb tsa ntawm 64 ntsis Lub Sijhawm Kernel Sijhawm ntawm Raspberry Pi. RT Kernel yog qhov tseem ceeb rau kev ua haujlwm puv ntoob ntawm ROS2 thiab lwm lub sijhawm IOT cov kev daws teeb meem.

Kernel tau teeb tsa ntawm x64 raws li Raspbian uas tuaj yeem tau txais ntawm no

Nco tseg. Cov ntawv qhia no txawm hais tias ncaj qha xav tau kev paub yooj yim ntawm Linux kev ua haujlwm.

Tsis tas li vim yog kev txwv ntawm lub platform no txhua qhov txuas http tsis muaj h. Txhawm rau kho lawv yooj yim ntxiv "h" ntawm lub hauv ntej ntawm qhov txuas

Khoom siv

x64 raws PC khiav Linux

Raspberry Pi 4B nrog Raspbian 64 twb tau teeb tsa

Kev sib txuas rau Internet.

Kauj Ruam 1: Tau Txais Cov Cuab Yeej Siv

Ua ntej peb yuav tsum tau qhib cov cuab yeej neccecery dev.

Lawv tuaj yeem tau txais los ntawm kev ua raws cov lus txib hauv qab no hauv Linux davhlau ya nyob twg

sudo apt-tau nruab tsim-qhov tseem ceeb libgmp-dev libmpfr-dev libmpc-dev libisl-dev libncurses5-dev bc git-core bison flexsudo apt-get install libncurses-dev libssl-dev

Kauj Ruam 2: Sib Sau Cov Neeg Qub Tsim Cov Cuab Yeej rau Kev Sib Sau Ua Ke

Cov kauj ruam tom ntej yog npaj ua ntej thiab sau cov cuab yeej rau kev sib sau ua ke ntawm peb cov ntsiav.

Firs cuab yeej peb yuav txhim kho yog Binutils qhov kev qhia no tau sim nrog binutils version 2.35.

cd ~/Downloadswget ttps: //ftp.gnu.org/gnu/binutils/binutils-2.35.tar.bz2tar xf binutils-2.35.tar.bz2cd binutils-2.35 /./ configure --prefix =/opt/aarch64- phiaj = aarch64-linux-gnu --disable-nls

Tom qab teeb tsa ua tiav peb yuav tsum tau sau cov programm siv cov lus txib hauv qab no

ua -jx

sudo ua kom nruab

qhov twg -jx txhais tau tias muaj pes tsawg txoj haujlwm koj xav khiav kuv parrarell. Txoj cai ntawm tus ntiv tes xoo yog tso nws tsis siab dua tus nqi ntawm koj cov kab ke. (piv txwv ua -j16)

thiab thaum kawg peb yuav tsum tau xa tawm txoj hauv kev

export PATH = $ PATH:/opt/aarch64/bin/

Tshaj li peb ua tiav nrog kev tsim thiab teeb tsa GCC

cd..wget ttps: //ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xztar xf gcc-8.4.0.tar.xzcd gcc-8.4.0/. /contrib/download_prerequisites./configure --prefix =/opt/aarch64 --target = aarch64-linux-gnu --with-newlib --without-headers / --disable-nls --disable-shared --disable-threads --disable-libssp --disable-decimal-float / --disable-libquadmath --disable-libvtv --disable-libgomp --disable-libatomic / --enable-languages = c --disable-multilib

Zoo ib yam li ua ntej peb tsim thiab teeb tsa peb tus neeg sib tw

ua txhua -gcc -jx

sudo ua nruab-gcc

Yog tias txhua yam mus tau zoo raws li cov lus txib

/opt/aarch64/bin/aarch64-linux-gnu-gcc -v

yuav tsum resoult hauv responce zoo ib yam li qhov no.

ux-gnu-gcc -v Siv cov cuab yeej tsim tshwj xeeb. COLMPLCCGCC =/opt/aarch64/bin/aarch64-linux-gnu-gcc./configure --prefix =/opt/aarch64 --target = aarch64-linux-gnu --with-newlib --without-headers --disable-nls --disable-shared --disable-threads --disable-libssp --disable-decimal-float --disable-libquadmath --disable-libvtv --disable-libgomp --disable-libatomic --enable-languages = c --disable-multilib Xov qauv: tib gcc version 8.4.0 (GCC)

Kauj Ruam 3: Patching Kernel thiab Configuring Kernel

Tam sim no nws yog lub sijhawm kom tau txais peb cov ntsiav thiab RT thaj.

Cov ntawv qhia no yuav siv rpi kernel v 5.4 thiab RT thaj RT32. Qhov kev sib xyaw no ua haujlwm zoo rau kuv. Txawm li cas los xij txhua yam yuav tsum ua haujlwm zoo nrog cov sib txawv.

mkdir ~/rpi-ntsiav

cd ~/rpi-kernel git clone ttps: //github.com/raspberrypi/linux.git -b rpi-5.4.y wget ttps: //mirrors.edge.kernel.org/pub/linux/kernel/projects/rt /5.4/older/patch-5.4.54-rt32.patch.gz mkdir kernel-tawm cd linux

ces unpack lub thaj.

gzip -cd../patch-5.4.54-rt32.patch.gz | thaj -p1 --verbose

Thiab pib teeb tsa rau Rpi 4B

ua O =../kernel-out/ARCH = arm64 CROSS_COMPILE =/opt/aarch64/bin/aarch64-linux-gnu- bcm2711_defconfig

Tom qab qhov no peb yuav tsum nkag mus rau menuconfig

ua O =../kernel-out/ARCH = arm64 CROSS_COMPILE =/opt/aarch64/bin/aarch64-linux-gnu- menuconfig

Thaum nws lauches peb xav tau kev teeb tsa uas twb muaj lawm, tom qab ntawd mus rau

General -> Preemtion Model thiab xaiv Real Time option.

dua li peb txuag kev teeb tsa tshiab thiab tawm ntawm cov ntawv qhia zaub mov.

Kauj Ruam 4: Tsim RT Kernel

Tam sim no nws lub sijhawm ua ke. Nco tseg nws yuav siv sijhawm ntev nyob ntawm koj lub peev xwm PC.

ua -jx O =../ kernel-out/ ARCH = arm64 CROSS_COMPILE = aarch64-linux-gnu-

Raws li ua ntej -jx txhais tau tias muaj pes tsawg txoj haujlwm. Tom qab ua tiav kev suav sau peb yuav tsum ntim peb Kernel thiab xa mus rau Raspberry Pi. Txhawm rau ua qhov no peb ua raws cov lus txib hauv qab no.

export INSTALL_MOD_PATH = ~/rpi-kernel/rt-kernelexport INSTALL_DTBS_PATH = ~/rpi-kernel/rt-kernelmake O =../kernel-out/ARCH = arm64 CROSS_COMPILE = aarch64-linux-gnu-modules_binstall tawm/arch/arm64/khau raj/Duab../rt-kernel/boot/kernel8.imgcd $ INSTALL_MOD_PATHtar czf../rt-kernel.tgz *cd..

Tam sim no peb cov ntsiav yuav tsum sab hauv rt-kernel.tgz cov ntawv khaws cia thiab nws tau npaj xa thiab teeb tsa.

Kauj Ruam 5: Txhim Kho Kernel Tshiab

Txoj hauv kev yooj yim tshaj plaws ntawm kev xa peb cov noob mus rau raspbperry yog los ntawm kev siv scp.

Peb tsuas yog ua raws cov lus txib ua raws.

scp rt-kernel.tgz pi@:/tmp

Tam sim no me me yuav tsum tau nkag mus rau peb tus pi ntawm ssh thiab tshem tawm peb cov Kernel.

ssh pib@

Thaum nkag mus peb luam peb cov ntaub ntawv siv cov lus txib hauv qab no.

cd/tmptar xzf rt -kernel.tgz cd boot sudo cp -rd */boot/cd../lib sudo cp -dr */lib/cd../overlays sudo cp -dr */boot/overlays cd../ broadcom sudo cp -dr bcm* /khau raj /

Tom qab ntawd yam uas yuav tsum tau ua yog hloov kho /boot/config.txt thiab ntxiv kab hauv qab no.

kernel = kernel8.img

Tom qab rebooting pi txhua yam yuav tsum ua haujlwm zoo.

Txhawm rau txheeb xyuas yog tias lub ntsiav tshiab tau teeb tsa ua tiav koj tuaj yeem ua tiav

uname- ua

hais kom ua

Pom zoo: