QDOS (which stood for "Quick and Dirty Operating System") was developed in 1979 by Tim Paterson at the Seattle Computer Company, was, in effect a verson of CP/M written for 16-bit processors. As Bill Gates was lacking an OS when negotiating with IBM, he bought QDOS for $50,000, in order to meet IBM's requirements. IBM had, in fact already approached Gary Kildall, CP/M's developer, to ask him to write the OS, but he was unable to comply with the deadlines. Bill bought the product, made some minor changes, and MS-DOS was born.
This was a stroke of luck and genius on Gates' part, as without this, he would have been unable to meet the strict deadlines IBM had set, and the Microsoft we know would not have come to be.