I did something similar as a teenager using DOS Microsoft C to implement the Amiga's exec.library and other bits and pieces on the x86. I managed to get preemptive multitasking working in 8086 real mode, along with a serial and tty device. Later on I implemented bits and pieces of dos.library in an emulator that let me run some m68k Amiga shell binaries (like the Aztec C compiler) from a Linux command line. That was invaluable practice for learning about different execution contexts, interrupts, locking and such for Linux kernel programming. I had even written a very simple C compiler with a friend that I used to mangle C code into endian swapping code that ran natively on my 486 so that the Amiga code could call into native code to do Linux syscalls and such.

The experience of figuring these things out was tonnes of fun! There's nothing like following threads of assembly with a debugger or disassembler in the Amiga's ROM to get a better idea of how the code worked. And since systems were so much smaller in the 1980s, a single person really could understand virtually everything about the system with enough time and effort.

The biggest challenge for me was that the ROM Kernel Manuals were very expensive back then, so I wasn't able to get copies until far too late in my Amiga years (with Commodore being in its death throes).

Motorola and Intel were great back then as they would ship out printed copies of all the documentation for various CPUs and support chips for free upon request!

Good times!