Upgrading Embedded Xinu for the Multi-Core Raspberry Pi 3
Researchers: Tom Lazar, Patrick J. McGee, Rade Latinovich and Priya Bansal
Mentor: Dr. Dennis Brylow
Contents
Background && Motivation
The Embedded Xinu infrastructure is a simple operating system designed to introduce students to many low level computing concepts, including Driver Creation, Exception and Interrupt Handling, and much more. Many universities have created Xinu Labs, classrooms running Xinu on multiple embedded devices (either Raspberry Pis or Linksys Routers). Marquette University uses one such Xinu Lab to teach its Operating Systems course.
Using information obtained from past studies, we expand on the current Xinu infrastructure. One of the main goals of this project is to modify Xinu to run on new multi-core Raspberry Pi 3s while still maintaining support for previous platforms. Another goal of this project is to create structures within Xinu which effectively and efficiently use multiple cores.
Milestones
Understanding the Pi 3 |
In order to begin porting Xinu onto the new architecture of the Raspberry Pi 3, we first needed to understand the fundamental differences between the Pi 3 and its simpler predecessor, the Pi 1 (which currently runs Xinu in Marquette's Systems Lab). Here is a table of distinctions between the two:
RPi 1 (Model B) | RPi 3 | |
CPU | ARM 1176JZF-S | ARM Cortex-A53 |
Architecture | ARMv6 (32-bit) | ARMv8 (64-bit) |
Cores | One | Four |
Registers | 16 | 32 |
RAM | 512MB | 1GB |
SoC | BCM2835 | BCM2837 |
Unfortunately, the documentation for the Raspberry Pi 3's System on Chip is sparse. However, deeper digging yielded more knowledge on how past Raspberry Pi systems have worked. With such information, it is safe to infer that the Pi 3's SoC is most likely similar to that of its predecessors. Below is a diagram of the Pi's boot order and compilation:
Hello World Pt. 1: Bare Metal LED Program |
- Got a bare metal program to run on our Raspberry Pi 3
- - Using our own C program: Turned on an LED light using GPIO pin 16 on our Pi
- - Reprocessed our C code into ARM64 Assembly code, and used it to turn on an LED using the same pins as before.
Hello World Pt. 2: Utilizing the Serial Port |
There are two UARTs on the Raspberry Pi 3: one mini UART and one PL011. The mini UART is used for Linux console output. The PL011 is generally more reliable and more versatile than the mini UART, mainly because the PL011 has a direct baud rate link to the Pi 3's Graphics Processor (VPU) clock speed. Contrasting the two UARTs:
Mini UART | PL011 | |
Break detection | ✘ | ✔ |
Framing errors detection | ✘ | ✔ |
Parity bit | ✘ | ✔ |
Large FIFOs | ✘ | ✔ |
Flow control | ✘ | ✔ |
Mini UART
- Our team created a "hello world" C program by sending a string using Xinu's puts() function. After initializing the serial pins within the program, we connected the R232 serial adapter from a computer (via ethernet) to our Pi 3's Mini-UART GPIO pins (pins 14 and 15) using a baud rate of 115200, which yielded a response in the console.
PL011