Z80 can support multithreading just fine. The difference between interrupts and threading is not to big btw. Memory protection is probably more something they didn’t think about back in 1976
I agree. It's strange, why multitasking has been lumped in with protected mode all the time.
Best example is the classic Amiga, already very great preemptive multitasking in 1985, without doubt the best of its time, but no protected mode.
But why should a multitasking system have protected mode and a single tasking system not? If you write buggy software you can crash a single tasking OS as well. Inside a single tasking OS the application could destroy OS memory areas as well. So it doesn't make sense for me to require protected mode especially only for a multitasking system.
For a preemptive multitasking system the most important thing is an interrupt and a good way for fast context switching (which is cool on the Z80 thanks to a 16bit stack, 2nd register set etc, but bad on a 6502, which has a fixed 256byte stack and a 256 byte zero page - anyway even here it's possible).
I think Protected Mode is good for preventing one task from encroaching on another, but it's not actually mandatory. Anyway it's probably hard to do on MSX.
I agree. It's strange, why multitasking has been lumped in with protected mode all the time.
Best example is the classic Amiga, already very great preemptive multitasking in 1985, without doubt the best of its time, but no protected mode.
Is not strange. Protected mode was a necessity in mini-computers shared by several people and running multiple tasks simultaneously: you didn't want a faulty program to crash the machine for everybody else. Both features come together because one without the other makes "less sense".
Yeah, I downvoted the video as clickbait. The title is an outright falsehood; he's not found anything new in the Z80 CPU itself. And showing an MSX machine at the start is misleading, since what he's doing requires new hardware (and a new OS!) and so couldn't be implemented on that machine he shows. (And yeah, as mentioned by DamnedAngel, his system would need not only to be modified to protect the expanded slot registers that are not in I/O space, but a lot of other things too; plenty of MSX carts offer memory-mapped I/O.)
The idea itself is decent, but it's far from new; similar things have no doubt been implemented dozens or hundreds of times on many 8-bit CPUs, going back decades, though most of them we won't hear about because they're custom systems, often in embedded applications, rather than consumer computers.
One great example that is public is is Jeff Laughton's KimKlone, designed and built back in the 1980s. It's not designed for memory protection (though it could be extended to do that), but it adds memory management and instruction stream sniffing to extend the 6502 to a 16 MB address space and handle access to the entire space with no delay at all in many cases (and just a cycle or two in others). It's a truly brilliant project and worth checking out.
Regarding multitasking, even pre-emptive, yeah, that's something that does not require memory protection and it's exceedingly common in old 8-bit embedded systems. Very little power is required for the multitasking itself; it all depends on what kinds of tasks you want to run. (And actually, systems using interrupts to do things such as scan the keyboard are already preemptively multitasking systems, albeit not usually with arbitrary user processes.)
Protected mode was a necessity in mini-computers shared by several people and running multiple tasks simultaneously: you didn't want a faulty program to crash the machine for everybody else. Both features come together because one without the other makes "less sense".
Of course, for a multiuser system this is true. But IMHO a multiuser system again is something more/else than a personal computer for a single user.
Still, on my Linux PC, which I only use myself, there are many different users, running many different programs...
Anyway, protected mode is indeed useful for any kind of OS to protect the system from crashing and give some error instead ("Segmentation Fault" and back to the OS!).
Z80 can support multithreading just fine. The difference between interrupts and threading is not to big btw. Memory protection is probably more something they didn’t think about back in 1976
theoretically. but the power of an 8 bit cpu is too small to achieve something really useful in common usage.
Z280 haa a protected mode, and is capable of running Z80 code.
Pingpong : I think prodatron disagrees with you .. and I also do. It works just fine . The thread switching overhead is just a little more than a normal int handling .