Skip to content

learning arm-cortex architecture and assembly: creating simple round robin scheduler

Notifications You must be signed in to change notification settings

okpaj/assembler_play_simple_sheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Continuing learning ARM Cortex-M4 architecture. Now I'm making round-robin scheduler/switcher in C/assembly.

What learned: 1 what AAPCS works, and how exceptions stack registers. 2 constructing fake stack for first run of stuck --working of stm and ldm instructions

Plan of scheduler: Prepare "fake" stack of tasks for first run. Use process stack in thread mode and main in handler mode (bit spsel in control reg.).

Sys_Tick handler chooses next task and calls switcher (PendSV handler)

Switcher: stack preempted task registers r4-r11 (using current psp it knows where to put them and no need to pass to switcher old task) change psp to new value, unstack new task r4-r11 register

About

learning arm-cortex architecture and assembly: creating simple round robin scheduler

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published