Given the importance of the operating system in computer history, Microsoft originally released the source code for versions v1.25 and v2.0 of MS-DOS to their GitHub repository, making them open source, back in 2018, which according to Microsoft it was mainly done for education and experimentation for low-lever software programmers.
In April 25th, 2024, Microsoft has released yet another version of MS-DOS into their public repository, with the latest version to be included and publicly available being v4.0.
The current open source repository for MS-DOS works under the MIT license, and has been archived and marked for historical reference, so Microsoft will not accept any kind of pull requests nor modifications to the files on their repository, but users are able to fork the open source MS-DOS project and experiment on their own.
MS-DOS still has newer versions yet to become open source, since it goes all the way up to version v7.0 for Windows 95, and the last version known being v8.0 releases alongside WIndows ME, but until Microsoft decides, versions v5.0 up to v8.0 still remain as closed source.
Source