XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi...
Transcript of XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi...
![Page 1: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/1.jpg)
XinuPi: Porting a Lightweight EducationalOperating System to the Raspberry Pi
Eric Biggers1 Farzeen Harunani2 Tyler Much2
Dr. Dennis Brylow2
1Macalester College
2Marquette University
October 3, 2013
![Page 2: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/2.jpg)
Outline
Overview of Embedded Xinu and Raspberry Pi
Goals and purpose of porting Embedded Xinu to theRaspberry Pi
Challenges, hardware, and technical details
Summary and future work
![Page 3: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/3.jpg)
Overview of Embedded Xinu and the Raspberry Pi
Embedded Xinu
Small, simple framework forteaching embedded operatingsystem design
Nexos project (WESE 2008)
Xest (WESE 2010)
Figure : WRT54GL: One platformEmbedded Xinu currently runs on
Raspberry Pi
Inexpensive single-boardcomputer
Intended for educational use
Figure : Raspberry Pi Model B(Cost: $35)
![Page 4: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/4.jpg)
Goals and Purpose
Create functional Raspberry Pi port of Embedded Xinu tofacilitate hands-on operating systems and embedded softwarecurriculum
Write documentation and educational modules
Why Embedded Xinu? Why Raspberry Pi?
Code written “forstudents by students”
Demonstrated educationalsuccess (WCAE ’07,SIGCSE ’08, SPLASH’10, SIGCSE ’11)
Inexpensive
Rich set of peripherals
Popular (1 million+ sold)
Strong community
![Page 5: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/5.jpg)
Integration of embedded systems concepts throughoutcurriculum
Concepts covered before the actual embedded systems course:
Preemptive multitaskingProgramming in assembly languageHardware interruptsResource-constrained programmingDirect hardware communicationRemote target software developmentCross-architecture developmentPacket construction and transmission over real networks
Marquette University’s embedded systems course focuses onmore advanced concepts with a variety of platforms
![Page 6: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/6.jpg)
Overview of Raspberry Pi Hardware
BCM2835 SoCCPU (ARM1176JZF-S)GPU (Broadcom VideoCore)Memory (256MB or 512MB)Various memory-mapped peripherals
ARM1176JZF-S CPU
ARM memory GPU memory . . . Peripherals memory . . .
0x0 0x08000000 0x10000000 0x20000000
Physical memory
. . . System Timer . . . Interrupt Controller . . . Mailboxes . . . PL011 UART . . . USB Controller . . .
Figure : Logical view of system from ARM CPU
![Page 7: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/7.jpg)
Interrupt Controller (for CPU)
Allows enabling and disabling specific IRQ lines
IRQ line Device1 System Timer (1)3 System Timer (3)9 USB Controller
55 PCM sound57 PL011 UART62 SD card
Pending0
+0x00
Pending1
+0x04
Pending2
+0x08
FIQControl
+0x0c
Enable1
+0x10
Enable2
+0x14
Enable0
+0x18
Disable1
+0x1C
Disable2
+0x20
Disable0
+0x24
Figure : BCM2835 interrupt controller (for CPU) registers
![Page 8: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/8.jpg)
System Timer
64-bit 1 MHz free-running counter
Four independent interrupts: one used by XinuPi, tworeserved by GPU
CS
+0x00
CLO
+0x04
CHI
+0x08
C0
+0x0c
C1
+0x10
C2
+0x14
C3
+0x18
Figure : BCM2835 system timer registers
![Page 9: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/9.jpg)
USB (Universal Serial Bus) support
Raspberry Pi relies on USB to attach keyboards, mice, andeven the built-in Ethernet controller
Raspberry Pi has nonstandard, undocumented USB HostController (made by Synopsys Inc.)
Basic USB 2.0 support essentially complete
Code is several thousand lines due to high complexity of USB,but still a fraction of Linux code size
![Page 10: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/10.jpg)
Ethernet support
Raspberry Pi Model B has integrated USB Ethernet Adapter(SMSC LAN9512)
Device is not documented, so we had to gleam hardwaredetails from the Linux driver
Our driver for this is about 1/4 the size of the correspondingLinux driver
Operation: Packets are sent and received via USB bulktransfers
SMSC LAN9512
USB
USB Host Controller
Memory
CPU
Network
![Page 11: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/11.jpg)
Graphics support
BCM2835 includes integrated VideoCore GPUCPU and GPU initialize communication via hardware-based“mailbox” system, then share configurable depth RGBA linearframebuffer in memoryGPU is very powerful but not well documentedFramebuffer console and turtle-graphics application
![Page 12: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/12.jpg)
Summary
Goal: Port Embedded Xinu toRaspberry Pi
Promising and viable platform foroperating systems and embeddedsoftware education
Completed work Future work
Preemptive multitasking
Basic USB support
Networking support
Network bootloader
Basic graphics support
Partial documentation
Lesson plans
Classroom trials beginningSpring 2014
Improved documentation
Additional drivers (USBkeyboard, sound, SDcard)
![Page 13: XinuPi: Porting a Lightweight Educational Operating System ... · Create functional Raspberry Pi port of Embedded Xinu to facilitate hands-on operating systems and embedded software](https://reader033.fdocuments.us/reader033/viewer/2022042313/5edd253cad6a402d66682073/html5/thumbnails/13.jpg)
Acknowledgments
Marquette University MSCS REU Program
National Science Foundation (funding from grantCNS-REU-1063041)
Raspberry Pi Foundation (for designing the Raspberry Pi)