Your latest purchase

DOS is an OS.

DOS is a "program loader."
Not that that's a bad thing, nor does it disqualify it from being an "operating system."
If RPi is toggling a pin at 21MHz, that's without the linux operating system being involved.
Talking to IO in fast system is always slower than the internal cycle time. Switching a pin at (relatively) high power at the edge of your circuitry and with a potentially significant load capacitance is "difficult."
(You also don't want to look too closely at how slow that RAM memory access is, on cache misses.)