Linux 6.18.40 on the VEX V5 Brain

DISCLAIMER: Only one V5 Brain was harmed in the making, and frankly, @sazrocks did it to himself (if you know, you know.)

Nine months ago, I said this:

Someone with enough boredom, unemployment, and zero regard for if their Brain comes out alive might be able to do this. Sadly, while I am bored and unemployed, I only have two Brains to test on.

Welp, here we are.


This is Linux 6.18.40-xilinx fully booted and running from a V5 user program.

Doing this has been a goal of mine for quite some time, and I was never completely sure if this is possible. My first attempt at doing this (around a year ago) failed terribly for a number of reasons I won’t go into.

Do not try this at home, I’ve intentionally chosen not to release this project in full due to concerns that people will accidentally destroy their hardware.

How?

Most hardware inside the Brain has decent mainline Linux support. The largest hurdle is working with (or around) the existing environment VEXos has setup. This meant writing a custom ARM linux bootloader inside of a user program, which I unfortunately won’t releasing to the public due to some sensitive implementation details and concerns that it could damage someone’s hardware.

The kernel itself was built using Buildroot using a custom device tree and a lot of configuration tweaks. Getting past early initialization was utterly miserable. I was essentially working blind, since there is no way to get logs or any feedback off the Brain after the kernel starts booting. That alone was nearly two weeks of effort.

What works

  • Display (via fbcon)
  • USB (Host, OTG, and Gadget mode, yes I can plug a keyboard into my Brain)
  • SDHCI Controller (sdcard)
  • Interrupts and clocks and such.

This all runs in RAM and will be wiped once the Brain loses power. I wouldn’t dare try and persist this.

Why would you ever want to do this?

idk, seemed cool, okay bye!!

Nice work! I know it took a lot of effort to get this working and I’m glad to see that it turned out well.

Thats really cool!! I dont think I have ever been so sucked into a post. The effort you had to give deserves props!!

Epic project.

One step closer to playing Doom on the Vex brain :grin:

You don’t need Linux for that, it was dome 8 years ago.

As James said, DOOM has already been done. That being said, I have gotten a DRM/KMS (direct rendering manager) driver working since I made this post (minus vsync support due to quirks in how the Brain routes interrupts not playing nicely with the kernel). I’ve been able to test some basic graphical apps using a small wayland compositor written by by good friend Gavin, so i’ll let you know if DOOM ends up being playable here soon :>

Things have been going a little slowly since I made this post (been busy with other things) but my bucket list for this is roughly:

  • Get an X11 session running under something like openbox. This was giving me trouble previously due to not having a DRM-compatible video driver, but shouldn’t (?) be an issue now.

  • Connect a brain to the internet over a USB Wi-FI adapter.

  • Boot into a full Arch userspace using an SDCard as secondary storage/swap (people have done this on far worse hardware, so this should be possible I think).

:smiley:

This is a sick project. This might be a really dumb idea, but what if someone rewrote the entire brain? OS and all. I do not know the legality of this, as you can not modify electric components, but what about software? It would be interesting to see if you could possible make the brain faster by doing a CLI only OS and then you would be able to do a lot more languages on the brain

Well that answers my question:

No modifications to electronic or pneumatic components are allowed. Motors (including the V5 Smart Motor firmware), microcontrollers (including V5 Robot Brain firmware)