case study operating systems

27
Case Study Operating Systems: Linux And Windows

Upload: akhil-bevara

Post on 15-Apr-2017

1.040 views

Category:

Engineering


0 download

TRANSCRIPT

Case Study Operating Systems: Linux And Windows

Features of Modern os To facilitate easy,

efficient, fair, orderly, and secure use of resources› Provide a user interface› Organize files on disk › Allocating resource to

different users with security control

› Co-ordinate programs to work with devices and other programs

Begining of Linux and Windows In Sept 1991, Linus

Torvalds, a second year student of Computer Science at the University of Helsinki, developed the preliminary kernel of Linux, known as Linux version 0.0.1

It was put to the Internet and received enormous response from worldwide software developers

In 1988, Microsoft decided to develop a “new technology” (NT) portable operating system that supported both the OS/2 and POSIX APIs

Originally, NT was supposed to use the OS/2 API as its native environment but during development NT was changed to use the Win32 API, reflecting the popularity of Windows 3.0.

Advantages of Linux and windows Advantages over Windows

– It's almost free to relatively inexpensive

– Source code is included– Bugs are fixed quickly and help is

readily available through the vast support in Internet

– Linux is more stable than Windows– Linux is truly multi-user and multi-

tasking– multiuser: OS that can simultaneously

serve a number of users– multitasking: OS that can

simultaneously execute a number of programs

– Linux runs on equipment that other operating systems consider too underpowered, e.g. 386 systems, PDA, etc

Microsoft has made several advancements and changes that have made it a much easier to use Operating System, and although arguably it may not be the easiest Operating System, it is still Easier thanLinux.

Because of the large amount of Microsoft Windows users, there is a much larger selection of available software programs, utilities, and games for Windows.

Disadvantages of Linux and windows Disadvantages of linux

compared with Windows– Isn't as popular as Windows– No one commercial company

is responsible for Linux– Linux is relatively hard to

install, learn and use

Hence currently, Linux is mainly used in commercial applications, server implementation

Disadvantages of windows

Although Microsoft Windows has made great improvements in reliability over the last few versions of Windows, it still cannot match the reliability ofLinux.

to viruses and other attacks. Although Microsoft has made great improvements over the years with security on their Operating System,their Operating System continues to be the most vulnerable

Linux and Windows system Architecture

File management in Linux Unlike a Windows operating system, Linux does not use drive letters. In

Windows, you would address the floppy drive as A:\, Windows system data is under C:\, and so on. In Linux, all files and directories are located in a tree-like structure. The topmost directory is referred to as the file system root or just /. All other directories can be accessed from here.

The following is a short guide through the Linux file system tree, introducing the most important directories:

/home/<username> /home holds the private data of every user who has an account on your system. The files located here can only be modified by their owner or the system administrator. Your e-mail directory is located here, for example.

/media /media generally holds any type of drive except the hard drive of your system. Your USB flash drive appears under /media once you have connected it, as does your digital camera (if it uses USB) or your DVD or CD drive. As soon as the data source is disconnected (think of an USB flash drive or your camera), the respective directory under media is removed as well.

File management in windows

File management in windows can be done through Windows explorer or My Computer. Windows Explorer displays the hierarchical list of files, folders, and storage drives (both fixed and removable) on your computer. It also lists any network drives that have been mapped to as a drive letters on your computer. Windows Explorer can be used to copy, move, rename, and search for files and folders. For example, to copy a file, you can open a folder that contains the desired file to be copied or moved, and then just drag and drop the file to target folder or drive. Contents

1 Using Windows Explorer 2 Opening drives and folders 3 View file details 4 Copying and moving files using Explorer 5 Create a new folder 6 Rename a file or folder 7 Delete a file or folder

When files or folders are deleted from hard disk, Windows places them in the Recycle Bin, from where they can be retrieved, until the Recycle Bin is made empty. Files or folders deleted from a

File Management in Windows removable storage media such as network drive are permanently deleted and are not sent to the

Recycle Bin.

File management in Linux and Windows

Process Management In Linux– For a multitask system, multiple programs can be

executed simultaneously in the system– When a program starts to execute, it becomes a

process– The same program executing at two different times

will become two different processes– A linux excutes it changes state depending upon the

circumstances

States of process management

Running: A process will be in either running(current process in system)or ready to run(waiting to be assigned to system cpu)

Waiting:The process is waiting for a resource or event.Linux differentiates two types of waiting process; interputable and uninterputable.Interputable waiting process can be interputable by signals but are waiting directly on hardware conditions and cannot be interpated

States of process management (contd)

Stopped:The process can be stopped usually by receiving a signal. A process that is being debugged can be in a stopped state

Zombie:This is a halted process which for some reason still has task_struct data structure in task vector.It is like a dead process

Process management in windows

A process contains its own independent virtual address space with both code and data, protected from other processes. Each process, in turn, contains one or more independently executing threads. A thread running within a process can execute application code, create new threads, create new independent processes, and manage communication and synchronization among the threads.

By creating and managing processes, applications can have multiple, concurrent tasks processing files, performing computations, or communicating with other networked systems. It is even possible to improve application performance by exploiting multiple CPU processors

States of process management Ready:May be scheduled for execution. The microkernel dispatcher

keeps track of all ready threads and schedules them in priority order.

Standby:A standby thread has been selected to run next on a particular processor. The thread waits in this state until that processor is made available. If the standby thread's priority is high enough, the running thread on that processor may be preempted in favor of the standby thread. Otherwise, the standby thread waits until the running thread blocks orexhausts its time slice.

Running:Once the microkernel performs a thread or process switch, the standby thread enters the running state and begins execution and continues execution until it is preempted, exhausts its time slice, blocks, or terminates. In the first two cases, it goes back to the ready state

Process management in Linux and Windows

Memory Managemnt in Linux

Memory management– Memory in a computer is divided into main memory

(RAM) and secondary storage (usually refer to hard disk)

– Memory is small in capacity but fast in speed, and hard disk is vice versa

– Data that are not currently used should be saved to hard disk first, while data that are urgently needed should be retrieved and stored in RAM

– The mechanism is referred as memory management

Address Types in physical Memeory

The following is a list of address types used in Linux.

User virtual addresses:These are the regular addresses seen by user-space programs. User addresses are either 32 or 64 bits in length, depending on the underlying hardware architecture, and each process has its own virtual address space.

Physical addresses:The addresses used between the processor and the system's memory. Physical addresses are 32- or 64-bit quantities; even 32-bit systems can use larger physical addresses in some situations.

Bus addresses:The addresses used between peripheral buses and memory. Often, they are the same as the physical addresses used by the processor, but that is not necessarily the case. Some architectures can provide an I/O memory management unit (IOMMU) that remaps addresses between a bus and main memory. An IOMMU can make life easier in a number of ways (making a buffer scattered in memory appear contiguous to the device, for example), but programming the IOMMU is an extra step that must be performed when setting up DMA operations. Bus addresses are highly architecture dependent, of course.

Address Types in physical Memeory (contd)

Kernel logical addresses: These make up the normal address space of the kernel. These addresses map some portion (perhaps all) of main memory and are often treated as if they were physical addresses. On most architectures, logical addresses and their associated physical addresses differ only by a constant offset. Logical addresses use the hardware's native pointer size and, therefore, may be unable to address all of physical memory on heavily equipped 32-bit systems. Logical addresses are usually stored in variables of type unsigned long or void *. Memory returned from kmalloc has a kernel logical address.

Kernel virtual addresses: Kernel virtual addresses are similar to logical addresses in that they are a mapping from a kernel-space address to a physical address. Kernel virtual addresses do not necessarily have the linear, one-to-one mapping to physical addresses that characterize the logical address space, however. All logical addresses are kernel virtual addresses, but many kernel virtual addresses are not logical addresses. For example, memory allocated by vmalloc has a virtual address (but no direct physical mapping). The kmap function (described later in this chapter) also returns virtual addresses. Virtual addresses are usually stored in pointer variables.

Memory management in WIndows

Each process on 32-bit Microsoft Windows has its own virtual address space that enables addressing up to 4 gigabytes of memory. Each process on 64-bit Windows has a virtual address space of 8 terabytes. All threads of a process can access its virtual address space. However, threads cannot access memory that belongs to another process, which protects a process from being corrupted by another proces

Virtual Address Space Memory Pools Memory Performance Information Virtual Memory Functions Heap Functions File Mapping Large Memory Support Global and Local Functions Standard C Library Functions Comparing Memory Allocation Methods

Memory management in Linux And windows

User Interface of Linux Traditional Linux (Unix also) uses command-

driven interface (or text-based interface)› User needs to type lines of command to instruct

the computer to work, similar to DOS› Advantage: fast in speed. Very few resource is

required for its implementation› Disadvantages: user needs to type, hence can

easily make error. Besides, user needs to memorize all commands

› Suitable for expert users and for the systems that interaction with user is not frequent, such as servers

User Interface of Linux (contd)

By adopting the X-Window technology, graphical user interface (GUI) is available for Linux:– Uses pointing devices (e.g. mouse) to control the system,

similar to Microsoft’s Windows– Provide menu-driven and/or icon-driven interfaces

– menu-driven: user is provided with a menu of choices. Each choice refers to a particular task

– icon-driven: tasks are represented by pictures (icon) and shown to user. Click on an icon invokes one task

– Advantages: No need to memorize commands. Always select task from menus or icons

– Disadvantages: Slow and require certain resource for its implementation

– Suitable for general users and systems, such as PC

User Interface of Windows The Windows 9x user interface (9x

refers to Windows 95 and Windows 98 together) is characterised by a bar at the bottom of your screen (it may be moved to another edge by left-mouse-clicking on it and dragging it to the desired edge while continuing to hold down the mouse button).

User Interface in windows (Contd)

This bar is called the "taskbar." It includes: The "Start menu" (which contains shortcuts to

applications stored on your hard drive) The list of open windows on your desktop (the

Windows desktop is the entire portion of the screen located above the taskbar, where shortcuts to applications may be placed in the form of icons)

Icons representing shortcuts to programs loaded in the computer memory, and which can be configured

User Interface in windows (Contd)

It includes the following shortcuts: Shut down: To shut down or restart a computer, or restart it in MS-DOS

mode Run: Run a program using a command line (like in DOS). Arguments can be

added to an application (for example, in "dir /s", "/s" is an argument) Help: Windows online help Find: Lets you search for a file on the hard drive, or for another computer if

you are on a network Settings: This is the computer's "control center", where display, hardware,

and software settings can be configured. Programs: This contains links to your favorite programs. It can be modified

by going to Settings/Taskbar and Start menu, then clicking on Start menu The menu can include other shortcuts, too, such as: Documents: List of the

most recently opened documents Favorites: Lets you sort your favorite shortcuts, whether on the Internet or

your hard drive etc.

User Interface between linux and windows

THANK YOU By B.Akhil 13E51A0511 CSE-A