Difference between revisions of "Upgrading Embedded Xinu for the Multi-Core Raspberry Pi 3"

From REU@MU
Jump to: navigation, search
(Hello World Pt. 2: Utilizing the Serial Port)
Line 1: Line 1:
'''Researchers:''' [[User:Tlazar|Tom Lazar]], [[User:Pmcg521|Patrick J. McGee]], [[User:Rlatinov|Rade Latinovich]] and [[User:Pbansal|Priya Bansal]].
+
'''Researchers:''' [[User:Tlazar|Tom Lazar]], [[User:Pmcg521|Patrick J. McGee]], [[User:Rlatinov|Rade Latinovich]] and [[User:Pbansal|Priya Bansal]]
  
'''Mentor:''' [[User:Brylow|Dr. Dennis Brylow]].
+
'''Mentor:''' [[User:Brylow|Dr. Dennis Brylow]]
 
==Background && Motivation==
 
==Background && Motivation==
  

Revision as of 19:39, 7 June 2017

Researchers: Tom Lazar, Patrick J. McGee, Rade Latinovich and Priya Bansal

Mentor: Dr. Dennis Brylow

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:

Rpi3 boot order.pngPlaceholder.pngCompilation diagram pi3(2).png

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
GPIO key.png
  • - Reprocessed our C code into ARM64 Assembly code, and used it to turn on an LED using the same pins as before.
Pi LED.pngPi LED2.png
AmazingXINU3.0.gif

This proved that the boot process was indeed reaching the ARM64 Assembly code, but we grew skeptical that upon compilation, the Assembly code may have been the only code reached. We performed additional testing to pinpoint where exactly our program was reaching.

Tested for: Did it reach?
Busy wait in our Assembly code Yes
Assembly branch to working C "hello world" code Yes
Assembly branch to our own C code No
- These results show that there is something incorrect with how our C code is turning on the LED. It could be that the Pi simply is not reaching our C code branch.

Hello World Pt. 2: Utilizing the Serial Port

  • Created a "hello world" C program using Xinu's puts() function. Connecting the serial adapter from a computer to our Pi 3's Mini-UART (after changing the corresponding BAUD rate) yielded a response!


Rpi serial port hello.png