You cannot do this with an open source license. The reason is the same as in the linked question: you cannot discriminate usage, including platform.
Obviously, you can construct a license that specifically requires running on open source operating systems, but this license won't be open source.
Without using the license, it is possible to construct your software in a manner that makes it impractical to run on closed source operating systems, but without a non-free license, there is nothing stopping a determined programmer from adapting it to run on closed source operating systems.
Historically, there was a lot of software that was de facto tied to open source operating systems, because the only desktop operating systems that almost fully implemented Unix/POSIX standards happened to be open source. This is largely not the case today, as standards compliance and embracement of open source by proprietary software has improved across the board, making it easier to write portable software. Chances are good that if your software is useful, someone will port it to closed operating systems anyway.