FreeDOS, an MS-DOS compatible operating system has already been available for years, and it's licensed under the GPL which means that you're allowed to sell it (you have to include the source code with the binaries if you do, and you can't place any restrictions on the buyer re-distributing it...