Sunday, June 22, 2014

Virutalization and CPU Rings

Operating system runs in ring 0.  Modern processor inserts a ring -1 for the hypervisor to control access to CPU and resources.

Type-2 hypervisor sits on the top of an OS.  The hypervisor core module - VMM (VM monitor) runs as a kernel driver.  The main hypervisor and the guest OS runs in ring 1 or 3.  This is called ring compression because the using less ring (4 rings to 3 rings) by the architecture.  When a guest OS needs to do I/O, the request will be trapped by the hypervisor and pass onto the host OS via VMM.  This caused some performance penalty.

dwm

Windows Desktop Manager runs as a service - dwm session manager (internal name UxSMS - User Experience SMS).  dwm compose the desktop.  In past version, including Windwos Vista not running Aero, each application write directly to the frame buffer.  When an application windows is overlaid by another application, Windows will send a WM_PAINT message to the affected application to ask it to redraw its window on screen.  If the application is busy and does not handle the WM_PAINT message, it may result in a trial of the moving window image and this situation is called "tearing".

With dwm, each application is allocated with its own frame buffer.  dwm took these images and produce a composite image to display. dwm is also responsible to give a shade of wait over an unresponsive windows, called ghosting.

Sunday, June 8, 2014

Entanglement

When 2 particles interacted and they become correlated, or mathematically, their wavefunctions are intertwined and become one wavefunction in superposition, any change (e.g. collapse of wavefunction by taking a measurement or one of the wavefunction encountered a double-slit) to one of the particle will have a nonlocal effect to the other instantaneously, no matter how far the 2 particles are apart in distance.

*wavefunction contains a lot of information.  One of them is the probability of finding a particle in a specific location.  It is not a definite position but a "wave" spread over a space.