Comment by intea

7 years ago

Honestly I always thought that that was an open secret of ReactOS. How else are you gonna achieve binary compatibility with a closed source OS. Of course there's symbols but those only get you so far.

In the past when porting netbsd to new architectures the approach was to first run a kernel with a binary compatibility layer to the existing operating system, be it something like OSF/1 or SunOS.

Not only was it doable, but people did it as a shortcut to getting a functional userland first.

It is easier on unix because they are similar to each other, but with enough persistence I believe Windows is possible too.

The steps are to get some kernel booting to a "native" userland, then add code to execute the simplest standalone Windows binary. Then when it makes a call to the kernel it will fail.

Generally tracing on Windows should give you a strong idea of what calls it makes to the kernel (I don't know, I have never developed on Windows, but probably it has something like ktrace/strace/etc.)

Once you can run a basic standalone programs, you try to add enough of a Windows userland to run bigger programs.

Once that's done, you can start to re-implement parts of the Windows userland. The symbols they export are public, you must implement all of them, and programs usually crash if you fail.

As for drivers, the Windows driver API is public, and other people have re-implemented it in the past. You can even pick up some of their work.

The information about many internal "undocumented" structures is actually documented on third-party sites. And if there are structures that are really not documented anywhere then you don't have to reimplement them because no developer is using them and they are not necessary for compatibility.

  • So you're using their "leaked" or reverse engineered information? That's just IP theft with extra steps.

    • If this is made to ensure compatibility with programs using those undocumented structures then it is a different thing. They become a part of API.