01-03-2009, 02:09 PM
COOPERATIVE LINUX
[attachment=487]
Abstract
Software development for an embedded Linux system in most cases requires a free license of GCC (GNU C/C++ compiler) and accessories. Many developers find it disconcerting that the GNU tools are primarily available for Linux-based PCs. Any attempt to make GCC run under Windows in order to program an embedded Linux system has been fraught with problems until now. The popular Cygwin “ as a Unix/Linux emulation environment under Windows “ is much too slow and in most cases causes significant library and version conflicts. Despite the high costs, commercial attempts by some companies to provide GCC as a Windows application have not lead to any practical solutions. Even here, there are typically significant library problems. As a result, many users have no other alternative than to use a Linux distribution as a second operating system on the Windows PC to be able to use GCC tools. Without some effort, this technically straightforward solution is not feasible for large companies in particular, because an IT department is responsible for the PCs. Users are not able to just install a new operating system to boot instead of Windows. Another obstacle is often times getting familiar with a new PC operating system.Many questions can arise, such as: How can I change the network settings (e.g. IP address, etc.)? Where can I find a Telnet client? Which editor should I use? How can I later install other software components? The list could go on ad nauseam. The bottom line is that significant orientation time is required for a knowledgeable Windows user to get familiar with the new environment. In this report we™ll describe Cooperative Linux, a port of the Linux kernel that allows it to run as an unprivileged lightweight virtual machine in kernel mode, on top of another OS kernel. It allows Linux to run under any operating system that supports loading drivers, such as Windows or Linux, after minimal porting efforts. The report includes the present and future implementation details, its applications, and its comparison with other Linux virtualization methods. Among the technical details I™ll present the CPU-complete context switch code, hardware Cooperative Linux 6 interrupt forwarding, the interface between the host OS and Linux, and the management of the VM™s pseudo physical RAM. An alternative to using a Linux PC is a free license of Cooperative Linux (coLinux).This Linux project is a new approach to getting the Linux kernel to run under Windows XP. CoLinux contains special Windows drivers, which allow it to run under Windows XP as a guest operating system with all privileges.
Introduction
Cooperative Linux utilizes the rather underused concept of a Cooperative Virtual Machine (CVM), in contrast to traditional VMâ„¢s that are unprivileged and being under the complete control of the host machine. The term Cooperative is used to describe two entities working in parallel, e.g. coroutines. In that sense the most plain description of Cooperative Linux is turning two operating system kernels into two big coroutines. In that Mode, each kernel has its own complete CPU context and address space, and each kernel decides when to give control back to its partner. However, only one of the two kernels has control on the physical hardware, where the other is provided only with virtual hardware abstraction. From this point on in the report Iâ„¢ll refer to these two kernels as the host operating system, and the guest Linux VM respectively. The host can be every OS kernel that exports basic primitives that provide the Cooperative Linux portable driver to run in CPL0 mode (ring 0) and allocate memory. The special CPL0 approach in Cooperative Linux makes it significantly different than traditional virtualization solutions such as VMware, plex86, Virtual PC, and other methods such as Xen. All of these approaches work by running the guest OS in a less privileged mode than of the host kernel. This approach allowed for the extensive simplification of Cooperative Linuxâ„¢s design and its short early beta development cycle which lasted only one month, starting from scratch by modifying the vanilla Linux 2.4.23-pre9 release until reaching to the point where KDE could run. The only downside to the CPL0 approach is stability Cooperative Linux 7 and security. If itâ„¢s unstable, it has the potential to crash the system. However, measures can be taken, such as cleanly shutting it down on the first internal Oops or panic. Another disadvantage is security. Acquiring root user access on a Cooperative Linux machine can potentially lead to root on the host machine if the attacker loads specially crafted kernel module or uses some very elaborated exploit in case which the Cooperative Linux kernel was compiled without module support. Most of the changes in the Cooperative Linux patch are on the i386 treeâ€the only supported architecture for Cooperative at the time of this writing. The other changes are mostly additions of virtual drivers: cobd (block device), conet (network), and cocon (console). Most of the changes in the i386 tree involve the initialization and setup code. It is a goal of the Cooperative Linux kernel design to remain as close as possible to the standalone i386 kernel, so all changes are localized and minimized as much as possible.