
How CPU Privilege Rings and Exception Levels Protect the Kernel
Privilege rings on x86 and exception levels on ARM split code into trust levels the hardware enforces, so a user program cannot touch kernel memory or devices.
Tag
9 posts

Privilege rings on x86 and exception levels on ARM split code into trust levels the hardware enforces, so a user program cannot touch kernel memory or devices.

Compare Linux system calls on x86-64, ARM64 and RISC-V: the trap instruction, number register, argument registers and the same hello program in each.

The AAPCS rules for 32-bit ARM and Cortex-M: argument and result registers, what a callee must preserve, 64-bit pairs, stack alignment and hard-float.

Disassemble a Cortex-M ELF with arm-none-eabi-objdump: pick sections and symbols, read the encoding columns, and spot literal pools and the vector table.

How ARM Cortex-M assembly moves data between memory and registers: LDR and STR sizes and addressing, offsets, writeback, and the multi-register LDM and STM.

Write a Thumb-2 function in a .S file, declare it in C, build with arm-none-eabi-gcc 14 and see exactly how arguments and the result travel in registers.
A32, Thumb and Thumb-2 are three ways to encode ARM instructions. See how they differ, which one a Cortex-M runs, and how to read the encodings in objdump.

A map of every core register on an ARM Cortex-M: R0 to R12, the two stack pointers, LR, PC, xPSR and the special registers, with what each one is for.

Learn Cortex-M assembly end to end: registers, Thumb-2 encodings, branches, calling convention, startup, interrupts, RTOS switching, atomics, DSP and FPU.