JustKernel

Ray Of Hope

CoLinux – Architecture and operational details.

Cooperive Linux – Both the kernels executes simultaneously. Each kernel has its own CPU context, address space and each kernel decides when to give back the control to the partner .. I happens at Hz/sec speed so difference is not detected. But quite obvious, at a time only one kernel will be executing.

Host OS can be any OS that exports certain kernel level APIs for memory allocation,  memroy managment, CPU scheduling and that allows cooperative linux protable driver to run in CPL0 mode (ring 0) mode. – allowing linux. sys to execute in CPL0 mode.

At the startup, Cooperative linux is given a pseudo physical RAM i.e. a set of RAM pages which it considers as its own. Its in this set that it performs map ping and unmapping. All the memory that coLinux considers physical is inside this space (what we call pseudo physical RAM)..

Memory Allocation for VM – Now CoLinux (VM) needs memory to perform it operations or even to executes.. Now, it has to borrow memroy from Host OS. No other option dear..  It cant create its own virtual space..

So memory for guest OS (CoLinux) is allocated in the host OS using approprate kernel functions (like alloc_pages if host is LInux or MMAllocatePagesforMdl if host is WinNT).  But this space is not mapped to any address space in host. Its mapped to space in guest.. The pages (as you can make out from the APIs) are non pageable  and are allocated from the non-paged pool of host. ..  They will remain valid as long as guest is using those pages. Page tables are created for mapping the allocated pages (allocated by using  the host kernel APIs) in the VMs kernel virtual address space..

Here the hostOS driver is the primary interface. All the requirements of the guest OS are fulfilled by this driver. Guest OS asks for a resource (suppose wants to access a device,), then this request is forwarded to driver which then forwards it to Host kernel. Host kernel actually services the request.

Guest OS is provided with the abstraction of the driver.  Real driver lies with the Host OS. But that’s not true for memory. Guest OS is given its own memory..

Other details also available at colinux.org.

Originally Posted On: 2011-07-15 18:43:14

Anshul Makkar, anshul_makkar@justkernel.com

Tags:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.