The only solution that will make an OS virus free is to not ever release or use the OS.
Indeed, even programming the OS itself could result in the introduction of viruses, so it's probably better to just leave it on the drawing board without ever actually implementing it.