cooperative linux

7

Click here to load reader

Upload: ankit-singh

Post on 30-Oct-2014

900 views

Category:

Technology


0 download

DESCRIPTION

An old paper presentation held at Kolhapur Institute of Technology, India.

TRANSCRIPT

Page 1: Cooperative Linux

1 --- Cooperative Linux

.

COOPERATIVE LINUX

Mr. Ankit Singh

Final year, Computer Engineering,

AISSMS’s College of Engineering, Pune.

Email : ankit***@***.com

Contact no. : - +91-9******5

Mr. Sushant Bhadkamkar

Final year, Computer Engineering,

AISSMS’s College of Engineering, Pune.

Email : ***sushant@***.com

Contact no. : - +91-9*****4

Page 2: Cooperative Linux

2 --- Cooperative Linux

.

Abstract

In this paper we will describe Cooperative

Linux (short-named coLinux), an effective

way to run Linux under other operating

system such as Windows, Linux etc. The

paper briefly presents technical details as

to how cooperation between two operating

systems is achieved. We will compare

coLinux with other virtual machines

available and discuss the advantages and

the downsides of using coLinux. The paper

also discusses a few applications and

projects currently being carried out with

the help of coLinux.

Keywords

Virtualization, CVM (Cooperative Virtual

Machine), Host OS, Kernel.

1. Introduction

Operating system virtualization is popular

technology these days. People run

different operating systems on top of their

existing ones not only for experimental

purposes but also for production use.

Many different virtualization systems

exist. In 2004, a novel concept of co-

operative virtualization was introduced by

Mr. Dan Aloni which made it possible for

two operating systems to work in co-

operation, both having complete control of

the host machine.

1.1 Virtualization

Virtualization is a framework or

methodology of dividing the resources of a

computer into multiple execution

environments, by applying one or more

concepts or technologies such as hardware

and software partitioning, time-sharing,

partial or complete machine simulation,

emulation, quality of service, and many

others.

Figure 1.1: An Example of virtualization.

1.2 Cooperative Linux

Cooperative Linux, the first working free

and open source method for optimally

running Linux on Microsoft Windows

natively. More generally, Cooperative

Linux is a port of the Linux kernel that

allows it to run cooperatively alongside

another operating system on a single

machine. The term ‘Cooperative’ is used

to describe two Entities working in

parallel, e.g. co-routines. In that sense the

simplest description of Cooperative Linux

is turning two operating system kernels

into two big co-routines. In that mode,

each kernel has its own complete CPU

context and address space, and each kernel

Page 3: Cooperative Linux

3 --- Cooperative Linux

.

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.

2. Implementation

2.1 Design of coLinux

coLinux is a port of the Linux kernel that

is modified to run cooperatively with

another operating system. Dan Aloni

describes coLinux as a cooperative and

paravirtualized Linux virtual machine.

Cooperative means that it gives control

back to the host OS at will. Paravirtualized

means that the coLinux kernel has no

notion of the real hardware except that of

the CPU and memory. The host operating

system (Windows or Linux) maintains

control of the physical resources of the

operating system, while the guest

operating system (coLinux) is provided

with a virtual abstraction of the hardware.

The host operating system must provide

the means to execute a driver in the

privileged ring (ring 0) and export the

means to allocate memory.

This is unlike VMware which intercepts

I/O to hardware devices and emulates it.

coLinux feels like a separate Linux box --

the guest kernel's internals are separated

from the host kernel's internals.

Figure 2.1. coLinux internals.

Notice that coLinux consists of two parts:

The coLinux kernel driver that

operates in the host kernel space.

Several user space daemons.

The coLinux kernel driver's main jobs are

to: Load the Linux guest kernel image on

start. You can imagine this functionality

being similar to a bootloader (like LILO or

GRUB).

Execute ioctl() requests as

instructed by the coLinux-daemon

process. This ioctl() call is

responsible for doing context

switches between guest OS and

host OS.

Page 4: Cooperative Linux

4 --- Cooperative Linux

.

Act as a forwarder of interrupts and

requests from several virtual

drivers: cobd (block device), conet

(network), and cocon (console).

In the user space, the most important part

is the coLinux-daemon-process. Besides

being responsible for triggering context

switches, it works as the "manager" of

several other daemons such as coLinux-

console-nt and coLinux-net-daemon. For

example, via coLinux-console, users can

see the current display of the active

console of the Linux guest. When the user

types or issues a command inside the shell

of this coLinux-console, the coLinux-

daemon will "wrap" it and forward it to

coLinux-driver.

Figure 2.2: Virtualization in coLinux

This concept is called ‘cooperative

virtualization’.

2.2 Device Driver

The device driver port of Cooperative

Linux is used for accessing kernel mode

and using the kernel primitives that are

exported by the host OS kernel. Most of

the driver is OS independent code that

interfaces with the OS dependent

primitives that include page allocations,

debug printing, and interfacing with user

space.

When a Cooperative Linux VM is created,

the driver loads a kernel image from a

vmlinux file that was compiled from the

patched kernel with

CONFIG_COOPERATIVE. The vmlinux file

doesn’t need any cross platform tools in

order to be generated, and the same

vmlinux file can be used to run a

Cooperative Linux VM on several OSes of

the same architecture.

3. Comparison with other VMs

In this section we will compare coLinux

with other Linux virtual machines.

coLinux runs without any

hypervisor[1]

, it is quite faster, and

if you install it on standard

partition you can get some speed in

reading/writing to the disk.

In contrast to coLinux, traditional

VMs are unprivileged and under

the complete control of the host

machine.

We can execute Linux applications

on coLinux without rebuilding.

[1] Virtual machine monitor that

Arbitrates access to the physical hardware

Page 5: Cooperative Linux

5 --- Cooperative Linux

.

coLinux is faster than other VMs

as coLinux allows the Linux kernel

to run natively (as a Windows

kernel driver).

4. Advantages

Effective way for casual windows

users to install and explore

Linux.

Windows users who are reluctant to

use Linux and other open source

software because of the complicated

technicalities, can be encouraged to do

so because of the relative easiness of

using coLinux. Installing coLinux is

relatively easier if normal installation

instructions are followed.

coLinux is portable

You can have a coLinux distribution

with a custom set of applications on a

given Windows host (within the root

file system). You can move the root

file system to another host, and then

restart it. This allows for a mobile

development platform where the

compressed root file system fits on a

standard Universal Serial Bus (USB)

memory stick.

Using two OSes without

rebooting.

The people, who already use Linux,

will use coLinux as a convenience, in

order to be able to do said Linux things

in Windows without having to reboot.

Linux kernel research

coLinux kernel can be used to study

the Linux kernel, the two being quite

similar

5. Disadvantages The primary disadvantage of

coLinux is that it has the ability

to crash the entire machine (all

cooperating operating systems).

The guest operating system runs in a

privileged mode in the host kernel. It

also has some dependencies on

external software for normal operation

(windows and networking support).

coLinux cannot be run in NT 4.0.

This is because some system calls are

missing in NT 4 (even with SP6) and

present only in 2000, XP and 2003.

Limited Graphics Support.

Graphics performance is also

dependent on the speed of the

connection between the coLinux OS

and the Hosting OS.

Another disadvantage is security.

Acquiring root user access on a

Cooperative Linux machine can

potentially lead to root access on the

host machine. An attacker can load

specially crafted kernel module or find

some other way to inject code into the

Page 6: Cooperative Linux

6 --- Cooperative Linux

.

running coLinux kernel, causing the

entire system to crash.

6. Projects using coLinux

IBM is attempting to combine

coLinux and openMosix to offer a

high-performance cluster

middleware in a heterogeneous

environment. In this heterogeneous

environment, Linux™ provides the

stability and performance, and

Windows® users continue to use

_their apps and never notice the

difference.

A coLinux Cross Tools CD-ROM

has been available from SSV

Embedded Systems since June

2005 and makes it possible use

coLinux for software development

of DIL/NetPC-based embedded

Linux applications.

7. Future of coLinux

coLinux is still a project in its beta and has

a small developer community. The

community will have to decide whether it

wants to promote coLinux as tool for users

to try out Linux or as a convenience for

developers. If the former is the case then

coLinux will have to be made more user-

friendly. A lot more documentation will

have to provided for troubleshooting.

Developers on the other hand will require

for it to have latest distribution support and

support for architectures other than x86.

India on the other hand can benefit a great

deal from coLinux as more and more

enterprises attempt to migrate towards

Linux and open source software. coLinux

can be used as a training tool in academic

institutes and students can get involved in

the coLinux project development.

8. Conclusion

While there are many virtualization

schemes out there, coLinux is novel in its

approach and the capabilities that it

provides. coLinux is not perfect but the

exposure that Linux gets by the average

computer user can increase tremendously.

Moreover it is an open source tool. The

implications that Cooperative Linux has on

what the media defines as ‘Linux on the

Desktop’—are massive, as the world’s

most dominant albeit proprietary desktop

OS supports running Linux distributions

for free, as another software, with the aim

of possibility that the Linux newbie would

switch to the standalone Linux.

So, if you want an easy way of running

simple, not very graphics demanding

applications from Linux on Windows, you

are a developer who develops for both

systems, or if you are just a Linux

enthusiast who wants to have his beloved

Page 7: Cooperative Linux

7 --- Cooperative Linux

.

applications at hand while using Windows,

and you don’t mind occasional problems

with graphics – coLinux is the solution for

you.

References

1. www.kernel.org

2. http://colinux.wikia.com/wiki/Main

_Page

3. http://www.ibm.com/developerwor

ks/opensource/

4. coLinux 2004 publication – Dan

Aloni

5. Rute User’s Text and Exposition –

Paul Sheer

6. linux.colinux.devel

.