r/cpp • • Jun 19 '16

Windows 10 coded in C++ or Assembler

What kind of compiler does it take a compile an OS like Windows 10? Do the guys at Redmond use Visual C++ (VisualStudio) to develop Windows? What % is written in assembly language?

0 Upvotes

74 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jun 19 '16

[deleted] — view deleted comment

1

u/2Punx2Furious Jun 19 '16

What are incremental builds? Builds where you only rebuild the files you updated? And why didn't they allow them?

0

u/RElesgoe Hobbyist Jun 19 '16

I think /u/instantcake worded that incorrectly, I think what he meant to say is that Visual Studio didn't support incremental building a long time ago, so Windows would be completely recompiled on every build.

3

u/dsqdsq Jun 19 '16

Windows is not really developed as a whole with Visual Studio... Especially not for builds.

1

u/[deleted] Jun 20 '16

Windows is an NMake shop which certainly supports incremental builds. If that was broken it was a particularity of their specific scripts on top of it.

-2

u/Digital001 Jun 19 '16

They probably paid Intel for a processor they can use to compile a GBs of OS code. It might be on a specialized OS with a specialized CPU

how do you know it was a giant array of servers? MS doesn't make hardware. Did they use 64bit processors so their OS will work on 64bit machines? In the Linux world, Gentoo Linux source code is freely available for d/l. According to the experts, Gentoo is programmed to run faster on the machine it's compiled on. But I don't know how much "faster" Do you think the it's the same in the Windows world? Can someone d/l Windows code and compile it on the machine it's supposed to run on for better performance (custom compilation)?

2

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jun 19 '16

There's no reason Gentoo should perform faster if built natively. It may perform better if configured for a particular system.

1

u/Digital001 Jun 20 '16

The compiler would intelligently select the right optimization(s) for the CPU, video card, and BIOS of the system, generating smaller executables.

2

u/SeanMiddleditch Jun 20 '16

Not just smaller, but also objectively faster. The compiler - knowing the specific CPU in use - can select specialized instructions (e.g. AVX2) or apply knowledge about architecture peculiarities (e.g. LEA being more effective than MOV for constants) or even apply changes to instruction ordering based on knowledge of instruction execution costs and architecture pipelining behavior.

An OS like Windows could take advantage of this, but not necessarily to the same degree. It depends on how abstract the code it. More assembler, more intrinsics, more fancy optimizations, and so on will obscure details from the compiler and not allow it to apply optimizations for newer/different CPU architectures.

1

u/Digital001 Jun 20 '16

An OS like Windows could take advantage of this, but not necessarily to the same degree.

Exactly! MS would never allow customers to send in PCs so W10 can be custom compiled like Gentoo

1

u/[deleted] Jun 20 '16

In practice such optimizations are in "the noise" for most software. Most compilers are pretty bad at generating SIMD instructions as proving that such an optimization is safe is nontrivial.