Live data from Hacker News

Windows Code Samples

microsoft.github.io

21–30 of 107 posts

Re: Windows Code Samples

#21
post #4

I really hope they open source the NT kernel, or at least part of it. This makes me really excited about the future of Windows!

In all honesty, I wouldn't be that surprised if that happened at this stage - I don't know that they would have much to lose, but they'd potentially have an awful lot to gain.

If the license isn't extremely restrictive about what you can do with the source and your knowledge of it, it would be a huge boost for Wine and ReactOS. Since those two are the biggest threat to Windows on the Desktop, I don't think Microsoft would risk that.

Re: Windows Code Samples

#22
post #7

Earlier quoted context omitted.

For development, is WSL good enough to replace dual-boot?

Depends on your use case/tools/habits. WSL gives you the advantage of being able to access the same files with native Windows tools and from the GNU[1] command line. If you plan on using the X GUI tools, it will be much less useful to you. [1] I can't bring myself to use the term 'Linux' here, because, ironically, Linux is the primary missing part in this Ubuntu distribution. It should really be called WSG or WSU.

All of my friends on windows say X is just as easy to set up as on cygwin

Re: Windows Code Samples

#23
post #7

Earlier quoted context omitted.

For development, is WSL good enough to replace dual-boot?

Depends on your use case/tools/habits. WSL gives you the advantage of being able to access the same files with native Windows tools and from the GNU[1] command line. If you plan on using the X GUI tools, it will be much less useful to you. [1] I can't bring myself to use the term 'Linux' here, because, ironically, Linux is the primary missing part in this Ubuntu distribution. It should really be called WSG or WSU.

If you plan on using the Linux GUI tools, it will be much less useful to you.

If you install an X server, such as VcXsrv and set the DISPLAY variable (typically export DISPLAY=:0 will suffice), you can just run X11 apps. For instance, here's a screenshot of a Prolog/Tk application running on WSL:

https://danieldk.eu/Posts/2017-01-10-Alpino-Windows/alpino-w...

I have installed Windows on a workstation just to try WSL out and it's quite impressive. Many regular applications just work. I could build Ubuntu packages and upload them to my PPA (I just had to use fakeroot-tcp to replace fakeroot).

Of course, there are also things that don't work for obvious reasons. E.g. because they require facilities deep in the kernel (performance counters/perf) or because they require kernel modules and hardware access (running CUDA programs).

Re: Windows Code Samples

#24
post #7

Earlier quoted context omitted.

For development, is WSL good enough to replace dual-boot?

For many people I think it's still the wrong way around. It's not the first solution to running Linux applications on Windows. The first I saw involved X-Win32 and a Linux server in the basement. It's just that most of these solutions get it wrong. It's not that people want Windows, and a little Unix. People want Unix/Linux, and a little Windows.

I think there is a large group of people that needs or want to develop on Linux (POSIX API, open source tools). But have difficulty getting their hardware running on Linux, need applications that are not available on Linux (Microsoft Office, Adobe suite), or simply want to run games as well without dual booting.

I think this is a masterstroke by Microsoft, since it will give Windows the best of both worlds. Something that only OS X had so far.

Of course, it's not for everyone. People might be morally opposed to proprietary software or want UNIX all the way down.

Re: Windows Code Samples

#25

Earlier quoted context omitted.

In all honesty, I wouldn't be that surprised if that happened at this stage - I don't know that they would have much to lose, but they'd potentially have an awful lot to gain.

If the license isn't extremely restrictive about what you can do with the source and your knowledge of it, it would be a huge boost for Wine and ReactOS. Since those two are the biggest threat to Windows on the Desktop, I don't think Microsoft would risk that.

If it's just the kernel and not the userland above it, I doubt it. Apple's open sourcing of XNU and Darwin was never an existential threat to Apple.

The question is how much third-party code there is in the NT kernel. There may even be remainders of the cooperation with IBM tainting the source code (Windows NT did have an OS/2 personality at some point).

Re: Windows Code Samples

#26
post #4

I really hope they open source the NT kernel, or at least part of it. This makes me really excited about the future of Windows!

In all honesty, I wouldn't be that surprised if that happened at this stage - I don't know that they would have much to lose, but they'd potentially have an awful lot to gain.

I'm not sure what would they gain, apart from "internet points" for being Good Guy Microsoft.

Re: Windows Code Samples

#27

Earlier quoted context omitted.

Depends on your use case/tools/habits. WSL gives you the advantage of being able to access the same files with native Windows tools and from the GNU[1] command line. If you plan on using the X GUI tools, it will be much less useful to you. [1] I can't bring myself to use the term 'Linux' here, because, ironically, Linux is the primary missing part in this Ubuntu distribution. It should really be called WSG or WSU.

If you plan on using the Linux GUI tools, it will be much less useful to you. If you install an X server, such as VcXsrv and set the DISPLAY variable (typically export DISPLAY=:0 will suffice), you can just run X11 apps. For instance, here's a screenshot of a Prolog/Tk application running on WSL: https://danieldk.eu/Posts/2017-01-10-Alpino-Windows/alpino-w... I have installed Windows on a workstation just to try WSL…

So if I want to use my GPU for machine learning applications, I would have to run my programs under Windows rather than from inside the WSL?

Re: Windows Code Samples

#28
post #7

Earlier quoted context omitted.

For development, is WSL good enough to replace dual-boot?

For many people I think it's still the wrong way around. It's not the first solution to running Linux applications on Windows. The first I saw involved X-Win32 and a Linux server in the basement. It's just that most of these solutions get it wrong. It's not that people want Windows, and a little Unix. People want Unix/Linux, and a little Windows.

I've been using this, and find it works well enough for me.

I like a Linux/GNU terminal, but I prefer windows GUI to X, I find all laptops I have owned work better under windows than linux, I prefer outlook to mutt/thunderbird, and many of my games only run on windows. (Obviously, other people's opinion can be different!)

Re: Windows Code Samples

#29
post #14

Earlier quoted context omitted.

They still make money on every single pc/laptop that ships with windows which is still their biggest money maker with office. If they truely open source windows (BSD or else) it will be free to ship for OEM and Microsoft will lose one of their biggest source of income. tl;dr: not gonna happen

Open source doesn't mean free....

Actually it does mean free to redistribute, this is the essence of the BSD or even GPL licenses. And free to redistribute (for free) would be a huge loss for windows. Therefor, not happening.

Re: Windows Code Samples

#30
post #4

I really hope they open source the NT kernel, or at least part of it. This makes me really excited about the future of Windows!

Some institutes at some universities have access to the NT source code for academic purposes. (Google "Windows Research Kernel" -- supposedly some academic entities have more access).

This is true. The program allowing this was active a few years ago, so the Windows research kernel is stuck at NT 5.2 (just before Vista). That makes it a decade old, but it is still a great tool for understanding the unique things about the NT architecture. The downside is that Windows has improved dramatically in ten years, so the old source can be misleading if not taken with proper perspective.

People like to shit on Windows with claims that Linux does it better. Actually seeing the source and reading about the internals (anyone can do that last bit) let's you see in just how many places Linux was and still is playing catch up. Linux may have a better implementation for some use cases, but to claim architectural superiority is just crazy in my eyes.

Anyway, the license for the WRK is actually quite open. Seeing it doesn't prevent you from contributing to open source projects, you can share it with anyone in a university setting, can keep it on your personal devices, and can share snippets of source code in blog posts, papers and the like. If you are eligible, willing to comply with the license, and can find someone who still has it (the hardest of the requirements) it's fair game. In my efforts I asked Microsoft for permission as well, but I didn't get the sense that was necessary (but shouldn't hurt).

You can still build the WRK on modern Windows, or on the included Virtual PC Windows Server 2003 images. The output dll can be installed in place into compatible versions of Windows. The distribution includes a full OS course, the original internal design workbook (straight from Dave Cutler's hand, in the original .DOC!) and labs detailing how to modify/extend the most interesting part of the kernel.

Source: I'm working on a tool/resource to make OS dev more accessible to students at my university (as well as to myself) and made vigorous efforts to procure the Windows Kernel for comparative purposes.

Post reply on HN