Skip to content

evshary/arm-os-4fun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arm-os-4fun

This is OS based on ARM for fun.

We can learn OS concept and ARM architecture by creating the OS.

Some of the functions are from jserv's mini-arm-os.

Build Environment

QEMU

  1. Install necessary package.
  • Ubuntu
sudo apt install zlib1g-dev libsdl1.2-dev automake autoconf libtool libpixman-1-dev bison flex
# If you are using Ubuntu 20.04, run the following command
sudo apt install build-essential python zlib1g-dev libglib2.0-dev libpixman-1-dev libtool libfdt-dev
# For 32 bit, lib32gcc1 is necessary
sudo apt install lib32gcc1 lib32ncurses5
# Install cross compiler
sudo apt install binutils-arm-none-eabi libnewlib-arm-none-eabi gcc-arm-none-eabi
# install gdb
sudo apt install gdb-multiarch
# install necessary packages
sudo apt install astyle
  • MAC
# Install cross compiler
brew install gcc-arm-none-eabi
  1. We run the environment on qemu, so you should build the qemu first.
git clone https://github.com/beckus/qemu_stm32.git
cd qemu_stm32
./configure --disable-werror --enable-debug \
    --target-list="arm-softmmu" \
    --extra-cflags=-DSTM32_UART_NO_BAUD_DELAY \
    --extra-cflags=-DSTM32_UART_ENABLE_OVERRUN \
    --disable-gtk
make
  1. clone the source code.
git clone https://github.com/evshary/arm-os-4fun.git
  1. Build and run.
cd arm-os-4fun
make
make qemu
  1. If you want to run gdb
cd arm-os-4fun
make DEBUG=1
# start to run gdb
make qemu_gdb
# run in different terminal
make qemu_connect

STM32F4

  1. Install necessary package.
sudo apt install cmake libtool libusb-1.0-0-dev libgtk-3-dev
  1. Clone stlink and build.
  • Ubuntu
git clone http://github.com/texane/stlink.git
cd stlink
cmake .
make
  • MAC
brew install stlink
  1. clone the source code.
git clone https://github.com/evshary/arm-os-4fun.git
  1. Build and run.
cd arm-os-4fun
# F407
make BOARD=STM32F407
# F429
make BOARD=STM32F429
make flash
  1. If you want to run gdb
cd arm-os-4fun
# F407
make DEBUG=1 BOARD=STM32F407
# F429
make DEBUG=1 BOARD=STM32F429
# start to run gdb
make st-util_gdb
# run in different terminal
make st-util_connect

Serial Console

We can connect the UART to see the debug message.

The GPIO for UART is different by models.

model GPIO
F429 PA9:TX, PA10:RX

You can use serial application, like minicom to see the message.

Serial Settings is 8N1, 115200.

NOTE: green is RX, white is TX, and also remember to connect ground.

# Ubuntu
sudo apt install minicom
# MAC
brew install minicom
# Usage
minicom -s
# ESC-Z for leaving minicom

System

arm-os-4fun now can run on qemu, which emulates STM32-P103. The supported CPU is stm32f103, which is ARM Cortex M3.

The OS also supports STM32F429I, which is ARM Cortex M4.

You can reference the link below.

Features

Done

  • Context Switch (Use SysTick)
  • System Call
  • malloc/free

Future

  • basic shell
  • message queue/IPC
  • resource protection
  • file system

About

This is OS based on ARM for fun.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published