3 ms·
From the screenshots, it seems there is a full kernel in there - e.g. you have /proc/cpuinfo, and it identifies as Linux 3.4.0. If they just implemented all Li
by captainmuon 11y ago
From the screenshots, it seems there is a full kernel in there - e.g. you have /proc/cpuinfo, and it identifies as Linux 3.4.0.
If they just implemented all Linux syscalls on top of NT, that would replace a Linux kernel. There would be no Linux kernel running on top. But in that case they would also need to emulate stuff like /proc. (This is the "reverse Wine" scenario.)
So I personally think it is either:
- There is no new subsystem, this is just a linux.exe running the Linux kernel as a process, like CoLinux does
or
- There is a new subsystem. One way to do this is to port Linux to a new "architecture", namely the NT HAL. You'd call into the NT native API from the linux kernel, which would mean you'd have to put the headers with the native APIs you use under the GPL.
Armchair kernel development is fun :-)
- jclulow 11y agoSpeaking from experience working on the LX brand (the Linux emulation layer for Joyent SmartOS), we would not have gotten very far with our emulation layer if we did not also faithfully emulate quite a lot of /proc. For example: $ grep DESC /etc/lsb-release DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS" $ uname -a Linux kappa 3.13.0 BrandZ virtual linux x86_64 x86_64 x86_64 GNU/Linux $ wc -l /proc/cpuinfo 608 /proc/cpuinfo $ /native/usr/bin/uname -a SunOS kappa 5.11 joyent_20160204T173314Z i86pc i386 i86pc
- xorblurb 11y agoThere is no need to use actual Linux code to implement its interface, so no GPL'ing of NT, and implementing /proc is not a big deal compared to other things. And this seems to be implemented as an NT subsystem, which makes tons of sense.
- zzzcpan 11y agoThere is a link to a full demo someone posted here [1]. They don't run the linux kernel at all. That /proc/cpuinfo is a part of a limited subset from what procfs usually offers. They enter their linux compatible "subsystem" via a bash binary, which could probably be any linux elf binary, since they run them unmodified. So, it looks like they actually implemented most of the syscalls with some of them emulating necessary parts of linux environment, like procfs. [1] https://sec.ch9.ms/ch9/5db6/8ee786b7-9fc5-45bf-94d0-16ea91765db6/P488_mid.mp4 https://sec.ch9.ms/ch9/5db6/8ee786b7-9fc5-45bf-94d0-16ea9176...
- teacup50 11y agoFreeBSD's linux compatibility layer does exactly this; it reports as "Linux", there's a linprocfs implementation that provides a Linux /proc, etc. It's a lot easier to emulate syscalls than it is to do something like CoLinux. Additionally, I can't imagine Microsoft would EVER let GPL'd Linux code into their kernel.