you can "accidentally" write a kernel, at least in my case.
I was doing some embedded stuff when i was at school. I needed to run some "functions" in parallel. Obvious choice would be using a RTOS, but i did not know the exist of RTOS, so i spun up some timer interrupt, a "queue" of function to run parallel, an isr that acts like "scheduler", some variables that act like "semaphore", etc.
Only few years later i realized i have invented a very simple "RTOS"
I was doing some embedded stuff when i was at school. I needed to run some "functions" in parallel. Obvious choice would be using a RTOS, but i did not know the exist of RTOS, so i spun up some timer interrupt, a "queue" of function to run parallel, an isr that acts like "scheduler", some variables that act like "semaphore", etc.
Only few years later i realized i have invented a very simple "RTOS"