Operating Systems

Some Operating Systems questions and answers

Operating Systems has been one of my pet subjects ever since I got hooked on Linux many years ago. Here are some exercises that Mr. Samantha gave us and my answers to them. I had apparently misunderstood one of the problems, but I included my answer nonetheless.

What is a Virtual Machine (VM)? What structure do they use? What are their advantages?

There are three types of virtual machines, but all are used to give the illusion of an actual, separate, physical machine on which a guest operating system (or Java bytecode, in the case of the JVM) could run.

One type of VM runs directly on top of the hardware, like an operating system in and of itself. These systems (like IBM’s VM Operating System)  use virtual hard drives (minidisks) to give the virtual machines disk storage. Direct resource sharing does not occur between two virtual machines (running on the same machine), so a shared minidisk or a virtual communications network might be made available for two VMs to share files.

Another type of VM (like Oracle VirtualBox or VMWare), runs like a normal application program on top of a host OS such as Linux or Windows, but gives the guest OS running inside it the feeling that it’s running on actual physical hardware.

Different VM structures
Left: The structure of IBM’s VM OS, and right: VMWare’s structure

The Java Virtual Machine (JVM) is also another type of virtual machine. It sits on top of a host OS or specially designed hardware (such as set top boxes) and executes Java bytecode as its native machine language. It monitors and manages memory, runs a garbage collector to deallocate unused memory and performs other tasks.

What’s the difference between System calls and System programs?

System programs act as an interface between users and the OS, and do a lot of system tasks by executing system calls on behalf of the user. System programs allow users to perform a lot of system tasks, including:

  • File management
  • Status Information (System time, disk usage stats, users logged into system, process info etc.)
  • File modification (Text processing, editors, text search and transformation etc.)
  • Programming language support (Compilers, assemblers, debuggers, interpreters etc.)
  • Program loading and execution (Used to load compiled files – linkage editors etc.)
  • Communications (Network and inter-process communication tools)

What’s the kernel structure used by modern operating systems?

Expected answer: Modern OSes, such as Linux, Solaris and Mac OS X, employ a modular kernel, where kernel code and components can be loaded dynamically during run time. These modular kernels are like layered kernels (in that functionality is separated into different parts), but are more advantageous in that each module can independently communicate with one-another  without having to go through many layers. They are also like microkernels, but differ in that they don’t use message passing and that most of the code runs in kernel space. (Which makes them faster than microkernels)

My answer (I did an OS by OS analysis): Windows XP is based on Windows NT. Windows NT 1.0 had a microkernel design. Unfortunately, this led to many performance issues, and therefore user space modules were moved into kernel space and integrated more closely with the core kernel. This was responsible for the speed and stability boosts in Windows NT 4.0. By the time Windows XP came out, the NT kernel had more of a monolithic structure than a microkernel one.

Mac OS X (with the Darwin open source kernel) uses a hybrid kernel model. The Mach microkernel provides memory management, remote procedure call (RPC) and inter-process communication (IPC) support. The BSD monolithic kernel provides a command line interface, a POSIX API and networking and file system support.

The Linux kernel started out as a monolithic kernel, but has added support for dynamically loadable kernel modules.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s