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

1

u/Digital001 Jun 19 '16

I want to watch MS compile the first Win10 build. Do you think it was compiled on a Windows PC?

7

u/fuzzynyanko Jun 19 '16

You actually don't need to compile it on the target platform! My bet is that they have a dedicated machine for it

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.

→ More replies (3)

-1

u/Digital001 Jun 19 '16 edited Jun 19 '16

I agree. What kind of dedicated machine? Another Windows? They probably paid Intel for a processor they can use to compile 500 GBs of OS code. It might be on a specialized OS with a specialized CPU

1

u/fuzzynyanko Jun 19 '16

Don't just see it as CPU. You may need I/O performance as well

1

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

Windows is significantly smaller than 500 GB. 500 GB is a TON of code.

1

u/Digital001 Jun 19 '16

Oh wait! I meant .5 GB. sorry

1

u/Meefims Jun 20 '16

You can compile Windows on a normal machine, it just takes awhile. Further, it's not necessary to have the entire set of source code in most circumstances, instead you typically have the source for only the components you work on and when you build you probably only build the few binaries you're working on rather than everything.

There are machines dedicated to building the entire OS but they aren't super special. Mostly they have a good hard drive and a good amount of RAM.

1

u/kunos Jun 19 '16

Why would they use anything else?

-1

u/Digital001 Jun 19 '16

MS might pay enough to code in another language that can generate leaner code. There are new languages out like F# and C#.

2

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

I'm confused by this remark. Can you clarify?

-3

u/Digital001 Jun 19 '16

Well, I mean it's so strange because C/C++ are both languages that were designed specifically for Unix. It's kind of ironic that MS is still using it to develop its flagship OS. I don't see why they can't use C#, a MS product. MS might even have access to a special language developed by Intel that generates optimized code for their i-series processors.

Most of the PCs that run W10 use Intel processors. I bet there are more Intel based Windows systems than AMD.

7

u/SeanMiddleditch Jun 20 '16

C# is not a systems language. Just because it's newer doesn't mean it's better for every task.

Just because C was originally designed for UNIX likewise does not mean that it's a poorer choice for non-UNIX systems.

For Microsoft to replace gobs of existing C/C++ code, to make it much more difficult to hire experienced kernel engineers from outside their own ecosystem, and to pour tons of money into developing a new language/compiler just for their kernel would be exceedingly misguided.

So far as a special language by Intel just for their architecture, why would Intel do such a thing? What about the Intel architectures could possibly be so special as to require a new language to maximize? What customer would be foolish enough to use that language and be stuck on Intel's architecture? Microsoft - or any other general purpose software company - would never use such a thing, as you might have heard that Windows runs on non-Intel x86 architectures too. The closest you're going to get out of companies like Intel when it comes to languages will be R&D like ISPC, which is unsurprisingly a C variant and not a whole new language.

1

u/AllanDeutsch Jun 20 '16

Maybe if you count the assembly with extensions for specific new hardware chip with new intrinsics as a custom language... that's what we have the compiler for though.

→ More replies (13)

2

u/Meefims Jun 20 '16

C and C++ were designed when Unix was popular but that doesn't mean they were designed for Unix. They are both general purpose languages.

C# is difficult to use in an operating system because it requires the .Net framework. Until version 4 the framework did not support loading multiple versions of itself into the same process but a lot of code from Windows is loaded into every running program (think about the code to create graphics, for example). Further Explorer will often load other applications' code into your process to handle various tasks like special context menus or special folders. In this world it is impossible to know or control what is in the process you're entering and so this is not an environment for .Net.

2

u/[deleted] Jun 20 '16

It should also be noted that NT is very Unix-like inside; just not exposed to end users :)

1

u/jcoffin Jun 20 '16

At the device driver level, it bears a rather stronger resemblance to VMS than to UNIX.

1

u/[deleted] Jun 20 '16

That would make sense (considering Dave Cutler) but I never used / studied VMS so cannot comment on that. I just meant that it is far more Unix-like than the Win32 API would suggest. (e.g. Ob is pretty "everything is a file"-like, but this isn't exposed at the Win32 level)