Matias Blog

From electrons to ideas: random thoughts about anything computable

Running a portable amateur radio station by the Xingu River

Camping at river islets in the Amazon basin is a lot of fun, but what if the agreed time comes and the boatman does not arrive to take you back? This concern has made the perfect excuse for me to finally take the exams to get an amateur radio operator license and to build a portable 40m transceiver. This article describes the adventures of camping in a Xingu River islet with my wife’s branch of the family – taking the radio together, of course. Although I still could not make a QSO, it was a joy to listen to other people doing CW and to get our WSPR beacon heard by 45 stations spread through several continents.

Fixing an airline app bug for fun and profit

Azul Linhas Aéreas is a Brazilian airline which offers cheaper tickets for customers buying from their mobile app. If the same tickets are bought from their website, an extra “convenience fee” is charged. Unfortunately, the mobile app has had a bug for several months which causes it to close itself when the user fills out the payment method. In this article, we patch the app’s bytecode to fix the bug.

Measuring IRQ latency in RTAI – PCIe vs LPT

When designing a real-time system, it is of the utmost importance to ask: How fast can the software react to an external event delivered by the hardware components? How much this response time varies? Which is the worst response time?

Despite the dependence on which computations need to be done by the real-time software to solve the problem at hand, there is a lower bound on the response time set by communication latency. External events are usually delivered asynchronously, by the means of interrupt requests (IRQs). Therefore, it is important to measure how long it takes for the real-time operating system to answer IRQs.

We measure IRQ latency in a relatively modern computer running the RTAI real-time OS. Despite having a recent motherboard, this computer still possesses a parallel port (LPT) interface, which enables us to compare IRQ delivery performance between PCI Express and LPT interfaces.

Our PCI Express interface is implemented by an Altera DE4 board, programmed with an project designed employing the standard tool flow (Altera Qsys). This brings us another interesting question – does the PCIe to Avalon bus abstraction provided by Altera’s tool flow impose significant overhead on the system? Although we do not compare our design to any custom solution communicating directly through the PCIe protocol, we are able to assess if IRQs are answered in a reasonable time when compared to the traditional LPT interface.