It would be great to port RetroBSD to Cortex-M architecture.
We just need somebody who could take the lead.
Here is a quote from my old post 2012-Apr-10 with some hints.
Quote:
RetroBSD was developed with a portability in mind. Most of the kernel is architecture-independent (sys/kernel, sys/include). There is a small number of places, where a saved stack frame is directly referenced (look for u.u_frame) - it needs to be guarded by #ifdefs.
PIC32-related part of the kernel is placed in sys/pic32 directory. I would recommend to create sys/stm32 directory for this port. Some drivers, like SD card, console, GPIO or ADC probably could be moved to arch-independent place, say sys/drivers. Unfortunately, we cannot reuse USB stack (Microchip's copyright is too restrictive).
You can use sys/pic32/baremetal/Makefile configuration as a starting point, for simplicity. The challenge is to build a kernel, which can start and print a message on console. Copy a basic set of arch-dependent files from sys/pic32 to sys/stm32, and modify them (cpu.h, io.h, limits.h, machparam.h, startup.S, clock.c, cons.c, devsw.c, exception.c, machdep.c, mem.c, signal.c, sysctl.c). Design a memory map and create a linker script. All we need from MPU is to protect a kernel data region from the user programs.
Next step is to design a user/kernel API: how to pass args to syscalls and get returned data. This will help to build a syscall library (src/libc/thumb2/sys). All other assembler files can be ported from NetBSD or other sources.
A year ago there was some related activity on getacoder.com, but seems like it ended in nothing.
http://www.getacoder.com/projects/retro ... 63817.html