This presentation describes 3bOS, a simple and customizable embedded operating system that runs on the MieruEMB educational kit using only three push buttons. 3bOS is designed for educational purposes, with around 800 lines of code, making it easy for users to understand and modify. It loads programs from an SD card filesystem and runs them, restoring the operating system interface after they exit. Key aspects of the 3bOS design include its small memory footprint, simple input/output interfaces, and support for executing ELF files from the SD card.
1 of 31
Download to read offline
More Related Content
3bOS: A flexible and lightweight embedded OS operated using only 3 buttons
1. 11:40?12:00, October 24, 2014
ESS2014@NYC Tokyo
3bOS: A flexible and lightweight
embedded OS operated using only
3 buttons
Encarnacion, Immanuel V?
Ryohei Kobayashi?
Kenji Kise?
?University of the Philippines, Philippines
?Tokyo Institute of Technology, Japan
2. This Presentation is about...
! 3bOS
" a simple and easily customizable embedded OS
" running on the MieruEMB system
" using only three push buttons
Three push buttons
3bOS running on the MieruEMB system 1
5. The Growth in Popularity of
Embedded Systems
! Being used in a lot of fields
! Having skills and knowledge about
embedded systems is required
4
Car electronics Medical products
Communication devices
6. The MieruEMB system
! An educational kit
" for learning implementation skills and knowledge
regarding embedded systems
The MieruEMB system 5
7. The MieruEMB system
! An educational kit
" for learning implementation skills and knowledge
regarding embedded systems
Spartan XC3S500E
512KB SRAM
(128 x 128 pixel16-bit color)
The MieruEMB system 6
LCD screen
SD card slot
Three push buttons
9. 3bOS
! Characteristics
" Running on the MieruEMB system
" Only three push buttons interface
" Simplicity
A few # lines of code
Flexibility
Users can easily implement their desired features
! Features
The OS itself is loaded from the SD card
Reading FAT-formatted SD card
Reading contents in SD card
Running ELF files in SD card
8
17. Implementation of 3bOS
! The OS is mostly coded in C
Containing some assembly code
! Compiled with gcc for MIPS*
*Buildroot: http://buildroot.uclibc.org/ 16
18. Implementation of 3bOS
! Important functions
Text and Display drivers
SD card driver
Execution and Exiting of the ELF files
17
19. Text and Display Drivers
! Display text (and/or) graphics
! Problems
It is hard to use basic libraries(stdio.h, stdlib.h)
in MIPS GCC (ver 4.3)
printf, malloc, free, memcpy, etc...
very limited sprintf
18
20. Solution: gprintf
! We made own printf
! accepts patterns such as:
%d
%s
%x
%b
%%
etc...
! No compile-time type
checking
19
21. SD Card Driver
! Reads raw data from the SD card
! Sends control signals to read/write from
the SD card
! Only a 512-byte sector can be read at a
time
! A Minor Problem: Physical and Logical
sectors
Hardware reads physical sector addresses
Windows can only read logical sector addresses
Logical Sector #0 = Physical Sector #25
20
23. Execution and Exiting of the ELF Files
! A pre-execution menu is first displayed
Whenever the user wants to execute an ELF file
in the 3bOS
! After the executable exits, 3bOS returns to
the pre-execution menu
22
24. Execution and Exiting of the ELF Files
! The Loading Process of an ELF file and
Physical Memory Layout
23
25. Main Problem
! State is restored imperfectly
Processor state
Program counter
Registers($sp, $gp, $ra, etc...)
Video memory
Video memory would be overwritten when the new
executable runs
But, the pre-execution menu should be restored after
the executable exits
24
26. The Wrong Solution
! To save state before
the pre-execution menu
UI is drawn
! But, the stack in the
restored state is
different...
Pre-execution Menu
Please choose
how to open
the ELF file.
^% *^() )*#
An app
runs exits
25
27. The Correct Solution
! No need to save stack or
video memory!
! ¡°done¡± is global variable
not in the stack
26
30. Discussion
! 3bOS¡¯s Important points
Simplicity and Flexibility
Just around 800 lines total
(about one-eighth the size of FreeRTOS*)
Users can easily understand how 3bOS runs on the
MieruEMB system
Users can easily implement their desired features
Low Memory Usage
3bOS leaves around 400KB of usable space for
running programs (80% of the total size of the main
memory)
! It is suitable to use 3bOS as an educational
material
*FreeRTOS: http://www.freertos.org/ 29
31. Conclusion
! 3bOS
A simple and customizable embedded OS
operated using only 3 buttons
Running on the MieruEMB system
! 3bOS is suitable for educational purposes
A Few # lines of code
Users who want to learn OS programming can
easily understand it
Its flexibility makes it simple for users to modify,
add, or remove features
30