If you ever read windows internals, you’ll see that overall windows is surprisingly simple, the hidden-proprietary things like encryption/authentication/ads etc run on top of everything else.
Linux and osx are as well still not complex at all, what have changed the most over the years are firmware/hardware and drivers and security related items like addition of sensors, IcS for encryption and etc that is indeed very opaque by nature.
$5m is a solid number to ballpark any new initiative from scratch.