Port to stm32-p103 for qemu simulation (commits rearranged)

Rearranged from https://github.com/f9micro/f9-kernel/pull/92