BrickOS Patches

 top of page

Patches

Here you can find various patches for brickOS, the free operating system for Lego Mindstorms. All patches need to be applied with -p0 in the brickos source directory:

cd brickos-0.9.0
patch -p0 < brickos-zyx.diff
brickos-gcc33.diff (5 KByte)
This patch adds support for gcc 3.3 and binutils 2.15 to brickOS.
brickos-highmem.diff (9 KByte)
This patch moves most of lnp and the dynamic program loader to high memory. This brings the high memory area to real use giving almost 3KB more space to the user programs.
You need a recent gcc or otherwise the code produced may be too big to fit in the high memory area. In the latter case you can also remove some __TEXT_HI__ attributes.
I chose dynamic program loader and LNP, because most people have it enabled and because it is a big piece of code.
brickos-performance.diff (30 KByte)
This patch rewrites the timer interrupt handlers. Previously the sensors were polled as fast as possible which took about 66% CPU time. With this patch they will only be polled once every 4 msec (each msec one of the four inputs is polled). Also the subsystem handler runs every msec again. A bit of profiling was done with brickemu.
brickos-performance-2.diff (31 KByte)
(Experimental) This fixes a known problem of the previous patch. If you use a rotation sensor with a high gearing the reduced polling rate may not be enough to track the rotation sensor. This patch will increase the polling rate from 250 Hz to 1000 Hz (and needs a bit more CPU time). This patch already contains the previous patch; do not apply both.
brickos-Makefile.diff (1 KByte)
This patch does some small changes to the compile options in the Makefile. It enables debugging flag, adds brickOS.coff to list of files to install and adds a rule to Makefile.user to produce .a files. This diff is also included in the brickemu distribution.
brickos-tcpcomm.diff (8 KByte)
This patch adds TCP/IP support to dll-src and firmdl, to allow communicating to a (virtual or real) RCX via TCP/IP instead of serial port or USB. Besides being useful to communicate to brickemu it can also be used for thin clients, that allow only TCP/IP access to their serial port, e.g., NCD explora X-Terminal.