On Saturday 14 October 2006 09:10, Flavio wrote:
> 2006/10/14, Blaisorblade <[EMAIL PROTECTED]>:
> > Since UML has been integrated in mainline, it is not any more correct to
> > talk
> > about "UML patch" - that's misleading for people (including Jeff Dike).
>
> I'm sorry, probably you misunderstood me. I didn't want to mislead anyone.
> I simply want to explain what I was doing. I'm writing on my thesis that I
> use a patch
> on vanilla sources, to get an executable guest kernel. I only want motivate
> my actions.
> Why don't write more on what am I doing? If someone ask me "Ok, let's
> explain better about
> your work with patching the guest kernel, what does really do that patch?
> etc...", What can
> I reply?


> I found some information on http://www.honeynet.org/papers/uml/ where I
> read:
>
> Unlike VMware, UML does not require any additional virtualization software.
>
> > Instead, you patch the source of the Linux kernel you want to run as your
> > Guest OS. This UML patch converts the kernel into a executable binary
> > called 'linux', which allows the Guest kernel to run on your system as a
> > seperate operating system. When you run this UML patched kernel, all you
> > need to do is give it a filesystem to use, and you now have a independent
> > Linux system running on your computer, two for the price of one! This new
> > kernel is a userspace application running on the real kernel (Host OS).
> > The UML kernel receives system calls from its applications and
> > sends/requests them to the Host kernel. There are also additional
> > management and networking UML tools you can install on the computer that
> > makes your life easier.
>
> Is it right, when expecially thalks about uml patch??? It says:  "This UML
> patch converts the kernel into a executable binary called 'linux', which
> allows the Guest kernel to run on your system as a seperate operating
> system."

> You said guest kernel works also without patch, but it's slower. Ok, but,
> it seems (reading above sentence) the patch is applied to get an executable
> binary kernel image at the end. Does it means if I don't apply uml patch, I
> cannot get an executable binary kernel even if I do "make linux ARCH=um"
> ???

That was the correct meaning, and the sentence was correct until about 2.6.9 
kernels, but it is now wrong. You can now get a UML kernel from a kernel.org 
tree with "make ARCH=um".

Ok, let's explain from scratch.
The howto's you found talk about a guest/UML patch. That is now included in 
kernel.org sources; -bs*/-bb* trees have a meaning similar to the -stable 
tree* (i.e. they deploy some fixes without waiting for a full release cycle), 
even if -bs hasn't very strict rules. Ideally, everything would go 
in -stable. So the guest -bs patch is simply a set of bugfixes.

* releases like 2.6.18.1 are from the -stable tree.

Also, they talk about a SKAS patch. That is applied to the host kernel, and 
guest kernel transparently detects and uses it.

> parse error - what do you mean? What is the alternative to patches? You

> > mean "why don't you run UML on vanilla hosts"? The answer is "we can, but
> > it's slower".

> Ok, thanks...  but.. that's all???
No, but it's technical to explain and I didn't have (and don't have) the time, 
and I didn't know if that was the exact answer.

> > - Why do they work?
> >
> > Sorry, but the answer to this question is because they were coded by
> > competent
> > programmers, and I can't find your real question (I'm not perfect at
> > mind-reading ;-)).

> Ok, don't warry. I only want to know a simple information: what is the
> foundation of
> patch functioning? (qual'รจ il principio di funzionamento che sta alla base
> delle patch?)
Ok, "how do UML code and SKAS patch work? What's the basic principle?"

UML in itself is based on creating a thread/process for each guest process. 
After a fork on the guest a new "process" is created on the host, while after 
a pthread_create() (or a clone(CLONE_VM)) a host thread is created, i.e. they 
share the memory space or not.

UML then uses ptrace() (the API used by gdb and strace) to intercept system 
calls and page faults done by the process; when it executes pure userspace 
code it works exactly like a host process (no layer is interposed between the 
code and the CPU). When a system call is done, UML intercepts and blocks it, 
providing the return value after performing requested work. Page faults are 
also intercepted and resolved by intercepting SIGSEGV signals.

Currently after installing mappings on guest page tables, they're made 
executive by calling mmap()/munmap()/mprotect() on a file representing 
virtual RAM (the one placed in /dev/shm) - Ingo Molnar and I have written 
faster APIs to do it and code for UML to use it.

Two problems arise:
a) how does UML execute mmap() and friends for another process?
b) how does UML gather the address for which SIGSEGV is delivered and the 
exact fault mode?

The SKAS3 patch adds system calls to the host to solve both problems; 
additionally it allows collapsing all threads representing guest processes 
into a single one, since on an UniProcessor(UP) UML they never execute 
together, but only one at a time.

When SKAS3 patch is not applied, a different solution has been devised by me 
and Jeff, called SKAS0: the code to do this is run inside the thread - it 
is "copied" (remapped actually) there, then when needed we modify EIP via 
ptrace() and redirect execution there.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to