1 --- Cooperative Linux.COOPERATIVE LINUXMr. Ankit SinghFinal year, Computer Engineering,AISSMS’s College of Engineering, Pune.Email : ankit***@***.comContact no. : - +91-9******5Mr. Sushant BhadkamkarFinal year, Computer Engineering,AISSMS’s College of Engineering, Pune.Email : ***sushant@***.comContact no. : - +91-9*****4
2 --- Cooperative Linux.AbstractIn this paper we will describe CooperativeLinux (short-named coLinux), an effectiveway to run Linux under other operatingsystem such as Windows, Linux etc. Thepaper briefly presents technical details asto how cooperation between two operatingsystems is achieved. We will comparecoLinux with other virtual machinesavailable and discuss the advantages andthe downsides of using coLinux. The paperalso discusses a few applications andprojects currently being carried out withthe help of coLinux.KeywordsVirtualization, CVM (Cooperative VirtualMachine), Host OS, Kernel.1. IntroductionOperating system virtualization is populartechnology these days. People rundifferent operating systems on top of theirexisting ones not only for experimentalpurposes but also for production use.Many different virtualization systemsexist. In 2004, a novel concept of co-operative virtualization was introduced byMr. Dan Aloni which made it possible fortwo operating systems to work in co-operation, both having complete control ofthe host machine.1.1 VirtualizationVirtualization is a framework ormethodology of dividing the resources of acomputer into multiple executionenvironments, by applying one or moreconcepts or technologies such as hardwareand software partitioning, time-sharing,partial or complete machine simulation,emulation, quality of service, and manyothers.Figure 1.1: An Example of virtualization.1.2 Cooperative LinuxCooperative Linux, the first working freeand open source method for optimallyrunning Linux on Microsoft Windowsnatively. More generally, CooperativeLinux is a port of the Linux kernel thatallows it to run cooperatively alongsideanother operating system on a singlemachine. The term ‘Cooperative’ is usedto describe two Entities working inparallel, e.g. co-routines. In that sense thesimplest description of Cooperative Linuxis turning two operating system kernelsinto two big co-routines. In that mode,each kernel has its own complete CPUcontext and address space, and each kernel
3 --- Cooperative Linux.decides when to give control back to itspartner. However, only one of the twokernels has control on the physicalhardware, where the other is provided onlywith virtual hardware abstraction.2. Implementation2.1 Design of coLinuxcoLinux is a port of the Linux kernel thatis modified to run cooperatively withanother operating system. Dan Alonidescribes coLinux as a cooperative andparavirtualized Linux virtual machine.Cooperative means that it gives controlback to the host OS at will. Paravirtualizedmeans that the coLinux kernel has nonotion of the real hardware except that ofthe CPU and memory. The host operatingsystem (Windows or Linux) maintainscontrol of the physical resources of theoperating system, while the guestoperating system (coLinux) is providedwith a virtual abstraction of the hardware.The host operating system must providethe means to execute a driver in theprivileged ring (ring 0) and export themeans to allocate memory.This is unlike VMware which interceptsI/O to hardware devices and emulates it.coLinux feels like a separate Linux box --the guest kernels internals are separatedfrom the host kernels internals.Figure 2.1. coLinux internals.Notice that coLinux consists of two parts: The coLinux kernel driver thatoperates in the host kernel space. Several user space daemons.The coLinux kernel drivers main jobs areto: Load the Linux guest kernel image onstart. You can imagine this functionalitybeing similar to a bootloader (like LILO orGRUB). Execute ioctl() requests asinstructed by the coLinux-daemonprocess. This ioctl() call isresponsible for doing contextswitches between guest OS andhost OS.
4 --- Cooperative Linux. Act as a forwarder of interrupts andrequests from several virtualdrivers: cobd (block device), conet(network), and cocon (console).In the user space, the most important partis the coLinux-daemon-process. Besidesbeing responsible for triggering contextswitches, it works as the "manager" ofseveral other daemons such as coLinux-console-nt and coLinux-net-daemon. Forexample, via coLinux-console, users cansee the current display of the activeconsole of the Linux guest. When the usertypes or issues a command inside the shellof this coLinux-console, the coLinux-daemon will "wrap" it and forward it tocoLinux-driver.Figure 2.2: Virtualization in coLinuxThis concept is called ‘cooperativevirtualization’.2.2 Device DriverThe device driver port of CooperativeLinux is used for accessing kernel modeand using the kernel primitives that areexported by the host OS kernel. Most ofthe driver is OS independent code thatinterfaces with the OS dependentprimitives that include page allocations,debug printing, and interfacing with userspace.When a Cooperative Linux VM is created,the driver loads a kernel image from avmlinux file that was compiled from thepatched kernel withCONFIG_COOPERATIVE. The vmlinux filedoesn’t need any cross platform tools inorder to be generated, and the samevmlinux file can be used to run aCooperative Linux VM on several OSes ofthe same architecture.3. Comparison with other VMsIn this section we will compare coLinuxwith other Linux virtual machines. coLinux runs without anyhypervisor, it is quite faster, andif you install it on standardpartition you can get some speed inreading/writing to the disk. In contrast to coLinux, traditionalVMs are unprivileged and underthe complete control of the hostmachine. We can execute Linux applicationson coLinux without rebuilding. Virtual machine monitor thatArbitrates access to the physical hardware
5 --- Cooperative Linux. coLinux is faster than other VMsas coLinux allows the Linux kernelto run natively (as a Windowskernel driver).4. Advantages Effective way for casual windowsusers to install and exploreLinux.Windows users who are reluctant touse Linux and other open sourcesoftware because of the complicatedtechnicalities, can be encouraged to doso because of the relative easiness ofusing coLinux. Installing coLinux isrelatively easier if normal installationinstructions are followed. coLinux is portableYou can have a coLinux distributionwith a custom set of applications on agiven Windows host (within the rootfile system). You can move the rootfile system to another host, and thenrestart it. This allows for a mobiledevelopment platform where thecompressed root file system fits on astandard Universal Serial Bus (USB)memory stick. Using two OSes withoutrebooting.The people, who already use Linux,will use coLinux as a convenience, inorder to be able to do said Linux thingsin Windows without having to reboot. Linux kernel researchcoLinux kernel can be used to studythe Linux kernel, the two being quitesimilar5. Disadvantages The primary disadvantage ofcoLinux is that it has the abilityto crash the entire machine (allcooperating operating systems).The guest operating system runs in aprivileged mode in the host kernel. Italso has some dependencies onexternal software for normal operation(windows and networking support). coLinux cannot be run in NT 4.0.This is because some system calls aremissing in NT 4 (even with SP6) andpresent only in 2000, XP and 2003. Limited Graphics Support.Graphics performance is alsodependent on the speed of theconnection between the coLinux OSand the Hosting OS. Another disadvantage is security.Acquiring root user access on aCooperative Linux machine canpotentially lead to root access on thehost machine. An attacker can loadspecially crafted kernel module or findsome other way to inject code into the
6 --- Cooperative Linux.running coLinux kernel, causing theentire system to crash.6. Projects using coLinux IBM is attempting to combinecoLinux and openMosix to offer ahigh-performance clustermiddleware in a heterogeneousenvironment. In this heterogeneousenvironment, Linux™ provides thestability and performance, andWindows® users continue to use_their apps and never notice thedifference. A coLinux Cross Tools CD-ROMhas been available from SSVEmbedded Systems since June2005 and makes it possible usecoLinux for software developmentof DIL/NetPC-based embeddedLinux applications.7. Future of coLinuxcoLinux is still a project in its beta and hasa small developer community. Thecommunity will have to decide whether itwants to promote coLinux as tool for usersto try out Linux or as a convenience fordevelopers. If the former is the case thencoLinux will have to be made more user-friendly. A lot more documentation willhave to provided for troubleshooting.Developers on the other hand will requirefor it to have latest distribution support andsupport for architectures other than x86.India on the other hand can benefit a greatdeal from coLinux as more and moreenterprises attempt to migrate towardsLinux and open source software. coLinuxcan be used as a training tool in academicinstitutes and students can get involved inthe coLinux project development.8. ConclusionWhile there are many virtualizationschemes out there, coLinux is novel in itsapproach and the capabilities that itprovides. coLinux is not perfect but theexposure that Linux gets by the averagecomputer user can increase tremendously.Moreover it is an open source tool. Theimplications that Cooperative Linux has onwhat the media defines as ‘Linux on theDesktop’—are massive, as the world’smost dominant albeit proprietary desktopOS supports running Linux distributionsfor free, as another software, with the aimof possibility that the Linux newbie wouldswitch to the standalone Linux.So, if you want an easy way of runningsimple, not very graphics demandingapplications from Linux on Windows, youare a developer who develops for bothsystems, or if you are just a Linuxenthusiast who wants to have his beloved
7 --- Cooperative Linux.applications at hand while using Windows,and you don’t mind occasional problemswith graphics – coLinux is the solution foryou.References1. www.kernel.org2. http://colinux.wikia.com/wiki/Main_Page3. http://www.ibm.com/developerworks/opensource/4. coLinux 2004 publication – DanAloni5. Rute User’s Text and Exposition –Paul Sheer6. linux.colinux.devel.