Monday, July 04, 2005

Linux on an NT Kernel

If the GNU lies in the userland and the Linux kernel in kernel space, and linux and GNU works in x86, why not GNU work on an NT kernel? When I say GNU, it means the GNU operating system minus the Hurd kernel. When I say GNU, I would mean all free and open source applications that runs on Linux (and perhaps BSD).

This is a good idea isn't it? Well, our problem lies now on how to run the GNU toolset on an NT kernel when it was built to call POSIX-compliant kernel library calls. The answer is to build an intermediate "mid-kernel" on top of NT kernel. This mid-kernel will translate microsoft-specific calls to POSIX standard, and hence, GNU tools can work on NT kernel.

Imagine your standard Windows XP (or Longhorn in future) installation can run both Linux applications and Windows applications on the same kernel. Probably, during bootloading, it will ask you on what OS to start, and both of the specific OS runs on the same kernel. But this time, the Linux OS will run on a mid-kernel. The mid-kernel itself will will be in userland.

Is this VMWare kind of stuff? Nah! This is not simulation and device sharing, this is the actual runtime. Only one OS runs at one time. How I wish somebody (at least as far as I know) will create the Linux to NT port.

Cygwin is a userland layer that can run some Linux applications with recompilation. Why does it need to recompile? Because the system calls behind Cygwin is just of Windows'. Cygwin consists of a library that implements the POSIX system call API in terms of Win32 system calls, a GNU development toolchain (such as GCC and GDB) to allow basic software development tasks, and some application programs equivalent to common programs on the Linux system. The commonality between Cygwin and perhaps Linux, and Unix, and Windows is COFF. The Common Object File Format (COFF) is an object file format that was introduced in Unix System V Release 3, and was later adopted by Microsoft for Windows NT. It was superseded by the more powerful ELF in System V Release 4, but as of 2005 COFF is still used in Windows as Portable Executable.

If someone will just "promote" Cygwin to be like this, then I think this will be the ultimate Linux kernel and VMWare killer. Just wait till the GNU Hurd kernel comes along...

No comments: