by yjftsjthsd-h · 3mo ago · 0 comments
> Pre-emptive multitasking on an 8086
> Twelve task slots, 1,536 bytes of stack each, and a timer interrupt that takes the CPU away from whatever is running 18.2065 times a second. No task is asked to cooperate and no task can refuse.
If you don't have protected mode, can't any program just rewrite the interrupt handler? It's not a bad system, but it sounds easy to break.
Before that, there was Switcher - not a multitasker, but did keep multiple (non-DA) applications in memory at the same time.
Yes? It's still possible to make it safe if you ensure that all programs are written in a memory safe language. Aside from throwing out a ton of existing code it's not as bad as it sounds. The Birth and Death of JavaScript touches on it towards the end.
https://www.destroyallsoftware.com/talks/the-birth-and-death...
Although from a security point of view it's still very bad. Every compiler / JIT has bugs, and bugs that let you write to random or arbitrary memory adresses are a rather common kind.
Doesn't really matter for a hobby project though
Not just rewrite the interrupt handler either, can rewrite the timer itself :)
Part of the fun of real-mode is the absolute god like power you have. Downside is the 20bit segmented memory model.