• as i life away from that laptop I setup a remote debugging setup:

  • the plan:

    • Asus Tinkerboard 2: emulate a usb keyboard and usb stick to boot from using it’s gadget capable USB type C port/controller. and a simple usb camera to see the monitor
    • Minestorms EV3 with one motor and a few lego pieces: mechanically press the power button (as that cant be done from a usb keyboard)

log

usbip detour

i wanted to usbip forward the usb camera to my local machine. (in heinseit stupid idea as it would work so terribly cause of bandwith limitations) the tinker os does not have usbip-core and usbip-host kernel modules :facepalm:

found my kernel source: https://github.com/TinkerBoard-Linux/rockchip-linux-kernel/commit/b8521caa5c7d78fb0e959c4260e6bbef09d8feac

actually managed to build two .ko files that worked… using this default.nix inside that source

let
pkgs = import <nixpkgs> { crossSystem = "aarch64-linux"; };
out = pkgs.linuxKernel.kernels.linux_5_10.overrideAttrs (prev: {
	src = ./src;
	modDirVersion = "5.10.209";
  configurePhase = ''
	make ARCH=arm64 defconfig
  '';

  buildPhase = ''
    make ARCH=arm64 M=drivers/usb/usbip modules
  '';

  installPhase = ''
    mkdir -p $out/
    cp drivers/usb/usbip/*.ko $out/
  '';
});

in out

(nixpkgs/917fec990948658ef1ccd07cef2a1ef060786846) (or smth like that. cant fully remember)

when opening the usb camera locally: Pasted image 20260710222355.png :dang: (Pasted image 20260710222425.png)

actually getting the cam to work

Google Search Ai was with three prompts able to give me

ssh root@localhost -p 2222 "ffmpeg -f v4l2 -input_format mjpeg -video_size 1280x720 -i /dev/video5 -c:v mpeg2video -b:v 3M -f mpegts pipe:1" | ffplay -fflags nobuffer -flags low_delay -i pipe:0

and that just works!!!!

v4l2-ctl --list-devices to find out which /dev/video

controlling the ev motor

back to story

efi hello world

(using edk2)

  • used their devcontainer.json (the build tooling is toooooo all over the place, to manage to get smth up with a simple nix shell… in a resonable time)

  • ./Conf/target.txt

ACTIVE_PLATFORM       = EmulatorPkg/EmulatorPkg.dsc
TARGET                = DEBUG
TARGET_ARCH           = X64
TOOL_CHAIN_CONF       = Conf/tools_def.txt
TOOL_CHAIN_TAG        = GCC
BUILD_RULE_CONF = Conf/build_rule.txt
  • make -C BaseTools

  • source edksetup.sh

  • build -m MdeModulePkg/Application/HelloWorld/HelloWorld.inf

  • and I will just edit: ./MdeModulePkg/Application/HelloWorld/HelloWorld.c

    • error galore, when I tried to use an external EfiApp.inf file…

intellisence

lldb for the efi shell

  • (lldb) target create edk2/Build/Shell/DEBUG_GCC/X64/ShellPkg/Application/Shell/Shell/DEBUG/Shell.dll -s edk2/Build/Shell/DEBUG_GCC/X64/ShellPkg/Application/Shell/Shell/DEBUG/Shell.debug
    • the Shell.dll is actually an elf file

modifying the efi shell to add telnet