A Comparative Case Study of Linux and Windows XP
A Comparative Case Study of Linux and Windows XP
A Comparative Case Study of Linux and Windows XP
...page 2 The meaning of an interface in an operating system The visual interface The underlying interface Description of a system call Examples
Differences and similarities between Windows XP and Linux with respect to system calls and interfaces
Differences and similarities in regard to system calls Differences and similarities in regard to interfaces
What is process handling? Ways to handle processes About memory Memory management explained About inputs and outputs The file systems The Windows and Linux security myth
Memory management
Input/Output
File management
Security
3. Appenedix References
Page: 1/14
A comparative case study of Linux and Windows XP Introduction About the essay
The basis of this essay is to introduce and compare 2 of the most popular OSs(Operating System/s) known to the general public, these operating systems are Windows XP and Linux. Windows XP is a Windows 2000 spin-off which in turn is based on the Windows NT kernel, each new update of Windows brings many improvements and unfortunately new headaches as well. Linux has many different distributions which differ in many ways except for the core parts like the kernel. Wikipedia <http://en.wikipedia.org/wiki/Linux#Distributions> states that the only difference between the Linux distributions or distros (very popular way to refer to the word distributions in regards to Linux) is the software packages and processes which are usually aimed at specific things such as real time systems. I would like to clean up 2 commonly used terms, user space and kernel space. These 2 terms respectively refer to the memory in which the user uses for games and other programs, and memory in which the operating system occupies. Whenever I refer to Windows I mean Windows XP/2000, the reason I also refer to Windows 2000 is because Windows XP is an updated version of Windows 2000, and while many things have been enhanced, whatever was in Windows 2000 is still there but may work differently, and I will notify the reader if this is the case. I will sometimes refer to Linux as Unix. This is because of the similarities which are identical among these 2 models. This essay will then proceed to analyse some of the basic differences in the operating systems. The essay is split into 2 main parts, part 1 and part 2. The introduction is meant to give the reader a basis of understanding and becoming familiar with the operating systems, this will make the user more aware of the facts in the 2nd part of the essay. The 2nd part of the essay concerns itself with specifics of the 2 operating systems, the way they handle processes, memory management, inputs and outputs, file management and security.
Page: 2/14
A comparative case study of Linux and Windows XP What is an operating system interface?
The meaning of an interface in an operating system First let's define what an interface is. Answers.com <http://www.answers.com/main/ntquery;jsessionid=3oa4itw27csk6?tname=interface-computerscience&sbid=lc02b&method=6> defines an interface as: An interface is a specification that exists between software components that specifies a selected means of interaction, by means of properties of other software modules, which abstract and encapsulate their data. A more abstract meaning can be taken directly from a dictionary, Dictionary.com <http://dictionary.reference.com/search?q=interface> states that an interface is: A point at which independent systems or diverse groups interact: the interface between crime and politics where much of our reality is to be found (Jack Kroll). Effectively the first meaning from Answers.com states that an interface is just a set of rules for the communication (aka protocol) for other pieces of software. Dictionary.com's meaning is generic, it's just saying that there are 2 entities not related to each other, talk to the others in a certain way. An OS(Operating System) has 3 core interfaces, the kernel and the GUI(Graphical User Interface) and the driver interface. The visual interface A visual interface is generally called a GUI. Modern Operating Systems Second Edition(2001) <Page 342> describes a GUI by it's [...] four essential elements, those being [...] windows, menus, icons and pointing device or WIMP for short. Effectively a GUI is just a way for a user(you or I) to tell the computer what to do in a visual context. However GUIs haven't always been very visual, Modern Operating Systems Second Edition(2001) <Page 342> tells us that earlier OSs used [..] character based interfaces.
Page: 3/14
Page: 4/14
A comparative case study of Linux and Windows XP What are system calls?
Description of a system call Webopedia <http://www.webopedia.com/TERM/s/system_call.html> tells us what a system call is: The invocation of an operating system routine. Operating systems contain sets of routines for performing various low-level operations. For example, all operating systems have a routine for creating a directory. If you want to execute an operating system routine from a program, you must make a system call. A system call is nothing more than a procedure within the kernel to accomplish a task which may look simple but internally can be very complex. System calls make a programmer's life much simpler. According to Modern Operating Systems Second Edition(2001), page 44 considers a system call as an interface between user programs and the operating system. Judging by Webopedia's description this seems to be correct, for a programmer to create a file you need some way to tell the operating system to do so, and a system call achieves that purpose. A system call is a software level interface because it is called from the kernel by your programs or even by command line but not by any hardware. Examples These examples are taken from Modern Operating Systems Second Edition(2001) on page 55. Unix/Linux: fork >> Creates a new process. exit >> Exits a process. close >> Closes a file. Windows: CreateProcess >> Creates a new process. ExitProcess >> Exits a process. CloseHandle >> Closes a file. These are some very basic system calls, and you can see even though the system calls are named differently their functionality corresponds with one other.
Page: 5/14
A comparative case study of Linux and Windows XP Differences and similarities between Windows XP and Linux with respect to system calls and interfaces
Differences and similarities in regard to system calls I would now like to introduce Microsoft's way of using system calls in an operating system; services. MSDN(Microsoft Developer Network) <http://msdn.microsoft.com/library/default.asp?url=/library/enus/dnanchor/html/anch_winbaseservices.asp> states that Windows services allow for programs to access hardware directly. If you've read the above topic about system calls, then you should be aware that a system call is a routine to access the operating system's functions. Microsoft's services are nothing more than system calls under a different name. Linux uses services as well according to Wikipedia <http://en.wikipedia.org/wiki/Operating_system#Common_core_services>, which states that As operating systems evolve, ever more services are expected to be common core.. However there is one thing that separates Window and Linux in regard to system calls. While Window's system calls have underlying access to the OS as services, Linux's system calls are not services on a higher level. Here is a description of this information at Wiki's Home at UIUC: <http://wiki.cs.uiuc.edu/cs427/Architecture+of+Linux> A strict Layered Architecture would only have calls from higher to the next lower layers, and then returns to the next higher level [SAIP98]. Here is the layers of the Linux architecture as shown in the above link. User Interface (optional) User Programs O/S Services (optional) System Calls Kernel Services Device Drivers Hardware As you can see that the unlike Microsoft's services which have direct access to resources and the underlying system, Linux has a clear separation of system calls and services. In fact Linux has kernel and OP services. You can think of Linux's OS services as modules you load up which perform a function. Kernel services are things like memory management routines as described Wiki's Home at UIUC <http://wiki.cs.uiuc.edu/cs427/Architecture+of+Linux>. Linux Kernel
Page: 6/14
One major difference between Linux and Windows is the GUI. Window runs the GUI in kernel mode while Linux runs it's GUI in user space. (Modern Operating Systems Second Edition(2001) page 342). Kernel wise Windows purely uses an event driven model (Modern Operating Systems Second Edition(2001) page 53) whilst Linux does not. Window's uses services to interface with system resources while Linux requires either a direct call to a system call or a OS service(a module run in user space) to perform a function by calling the appropriate system calls. Linux's driver model isn't integrated into it's kernel while Windows's model is.
Page: 7/14
A comparative case study of Linux and Windows XP Detailed comparison between both systems Process handling
What is process handling? Process handling is about taking care of processes. Processes are programs, and a program is composed of instructions. These instructions need to be run and when they run they shouldn't cause problems. Like all things processes require resources, these resources are shared throughout your computer, the problem is that those resources are all limited. For example you only have a certain amount of RAM(Random Access Memory, the memory in the computer), you may have only 1 printer, 2 hard drives, CD burner and a CPU. If you have 3 different processes wanting the CPU, how do you give them all access without causing problems? Algorithms, which are basically steps to solving a problem, which in this case is sharing a limited set of resources. 2 major problems that could arise are deadlocks and racing. Deadlocks are caused by processes wanting resources and getting them at a bad time which leaves all the processes waiting for the resource, this is referred to as starvation. Racing occurs when you have 2 or more processes trying to get to the same resource at a bad time. FreeBSD Developers' Handbook <http://www.freebsd.org/doc/en_US.ISO8859-1/books/developershandbook/secure-race-conditions.html> explains it brilliantly: A race condition is anomalous behavior(sic) caused by the unexpected dependence on the relative timing of events. In other words, a programmer incorrectly assumed that a particular event would always happen before another. Effectively what it's saying is that a programmer assuming the timing of events causes a race condition, which just means that racing could occur.
Page: 8/14
This is how round-robin works, however try and visualise the person in the chair selecting those with a higher priority to go first and get more time over those of a lower priority. In Linux this means that process 2 is next to be served and will have more CPU time than process 3, but less time than process 1.
Page: 9/14
Registers are incredibly fast but hold the least amount of data. Cache isn't as fast as a register but can hold more data. RAM is slower than cache but can hold far more data than cache. Virtual memory is an emulation of RAM, this is the slowest method of holding data because it uses a 3rd party storage device which are customarily slow due to either spin up times or the inability to transfer information across your computer fast enough. However storage devices like hard drivers are massive compared to the amount of RAM and are also non-volatile. (Answers.com <http://www.answers.com/virtual+memory&r=67>)
Memory management explained Both OS's sit in an untouchable part of the memory. The reason it's untouchable is because the kernel makes sure programs don't write anything to that part of memory, otherwise problems will occur, such problems are the infamous THIS PROGRAM HAS CAUSED AN ILLEGAL OPERATION AND MUST BE SHUT DOWN error, also referred to as the BSOD(Blue Screen of Death) under the Windows 9x kernels because they don't have the protections Windows XP or 2000 have. (Everything2, http://www.everything2.com/index.pl?node_id=668981). Windows and Linux also both have virtual memory and both split it up into pages, and when your RAM runs out it will use virtual memory on your hard drive to continue running your computer. Although this is significantly slower. Windows will trick an application hat it has 2GB of memory available and if it's not there Windows will attempt to get it by force. Windows will also assign resources on a thread by thread basis, which means that there are no strict rules for all programs in order to obtain resources. Windows also uses events while Linux does not. (General references used Modern Operating Systems Second Edition pg 720, MSDN, <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngenlib/html/msdn_virtmm.asp>, MSDN, <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html/UCMGch06.asp>)
Page: 10/14
File management
The file systems The file system is used to store your data, how it's done is dependent on your OS. Windows and Linux have very different models for their file systems. Linux for instance, combines all the partitions(how your space is split up) into a single hierarchy while Windows splits them up into different letters. Windows will automatically detect your partitions and give them a letter, think of this letter as an ID, and the user cannot change this. Linux on the other hand doesn't know about your partitions and the user has to manually mount the partition in order for Linux to recognise it, because of this you have greater flexibility in determining what goes where. You can change the location of important files and Linux wouldn't care, on Windows however you will be in for a nasty surprise. You could end up crashing your computer and losing a lot of important data. Semantic differences are visible in Linux, naming schemes are sensitive compared to Windows. A folder called Pics is the same as pics under Windows, while under Linux they are not the same. (General references FreeOS, <http://www.freeos.com/articles/3102/>, Wikipedia, <http://en.wikipedia.org/wiki/Filesystem#File_systems_under_Unix>)
Page: 11/14
Page: 12/14
MSDN, Virtiual memory, n.d, 4/05/2005, <http://msdn.microsoft.com/library/default.asp?url=/library/enKrunoslav Saho, s3634868 Page: 13/14 Operating Systems, SCM2112
Page: 14/14