laurentiuduca / rtnet-preempt_rt

9 stars 2 forks source link

RTnet (UDP) on PREEMPT_RT Linux

Please read the whole doc to have an impression.

Features:

Paper

0. Download linux-5.9.tar.xz

https://cdn.kernel.org/pub/linux/kernel

1a. Apply patch (includes PREEMPT_RT)

cd linux-5.9
patch -p1 < ../rtnet-v11b-preempt_rt-linux-5.9.patch

1b. Add the _rtnet() system calls

2. Use buildroot to setup a rootfs for the target board

3. Configure linux

Note for rpi 4 (choose the 64 bits version)

https://gist.github.com/lategoodbye/c7317a42bf7f9c07f5a91baed8c68f75

https://www.raspberrypi.org/forums/viewtopic.php?t=249579

defconfig

rpi-4

make ARCH=arm64 defconfig

orangepi-one

make ARCH=arm sunxi_defconfig

bbb

make ARCH=arm omap2plus_defconfig

rpi-0

In the kernel configuration, set the following settings as enabled [*] or disabled []

4. Compile linux

5. Boot qemu x86_64 emulator or boot target board

6. After booting qemu or target, read start-modules.sh (a better name would be setup-rtnet.sh)

7. There are provided tftp client (both x86_64 and arm) and server (for x86_64).

If you do not use rtnetproxy for scp or ssh, you can use tftp.
On the development host:

cp zImage /tmp/
./tftpd -d -P 8086

On the target, to get zImage:

./tftpc 192.168.1.100 -P 8086 -g zImage -o

On the target, to copy to server:

./tftpc 192.168.1.100 -P 8086 -p filename -o

You will find filename in /tmp

8. Testing

Please read rtt-laur.c and rtt-sender.c/rtt-responder.c for UDP sockets and raw_recv.c and raw_send.c for raw sockets.

8a. Hello world

on one computer:

./rtt-laur.out

on another computer

./rtt-laur.out -d 192.168.1.20
8b. Test RTT

On one computer

./rtt-responder.out

on another computer

./rtt-sender -d 192.168.1.20
8.c. Test raw sockets

On one computer

./raw_recv

on another computer

./raw_send

Success,
laurentiu [dot] duca [at] gmail [dot] com