Preemption on ARM Thumb-2

8 views
Skip to first unread message

David Boddie

unread,
Feb 22, 2022, 10:29:03 AMFeb 22
to infer...@googlegroups.com
I've been messing around with the Thumb toolchain to do bare metal
programming on a Cortex-M4 MCU. Since that worked fairly well, I tried to
build more of the Inferno kernel, but have run into problems.

The thing I'm unsure about is how to implement the interrupt handling to get
time-slicing to work. On the Raspberry Pi and other ARM ports, the handlers
appear to change into SVC mode with interrupts disabled before calling trap()
to do all sorts of process switching. On Cortex-M4, there's only handler mode
and thread mode, and you can't switch between them.

In some ways, it would be easier to be able to separate the preemptive
process switching from all the calls to sched() but that looks like it might
be quite difficult.

Has anyone attempted anything like this before?

David


Reply all
Reply to author
Forward
0 new messages