A Report On Operation System Interface Computer Science Essay

Published:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Operating System is defined as a program of software that exibits and manage the different resources of computer or simply it is a program which runs the machine. The operating system makes the hardware useable. It has a key board or mouse as input device that can be used by user and display the result of the action and allows the user to run application. The operating system of one computer also communicates with operating system of another computer through networked connections. In any operating system there are different commands, these commands are for reading and writing data, moving the disk arm and formatting tracks as well as initializing. The most basic commands are read and write, each of which requires 13 Parameters, Packed into 9 bytes. The fig below simply represents the relation within hardware, os and user.

1.2 Operating system Interface:

Operating system is a sort of system software which controls the execution of computer programs and provides an interface between those programs and the hardware of the computer. Operating systems have tools designed for manipulating the component part of file names that are useful for implementing defaulting of file name components. Operating system also controls over the current corking directory which is done by placing the file system from which relative file names are interpreted. It also provides the procedures for rename, copy, delete, reading the contents of a directory, obtaining times in various formats converting between the formats and generating human readable time strings.

Examples of some common Operating systems in current times are listed below;

Microsoft

- MS-DOS, Window 95, Window XP, Window 2007

Lunix/ UNIX Operating systems

Unix-like

Minx

Plan 9

UNIX (OS developed at Bell Labs ca 1970 initially by Ken Thompson)

Xinu

Non UNIX like

Amoeba (research OS by Andrew S. Tanenbaum)

ILIOS Research OS designed for routing

EROS microkernel, capability-based

Apple:

Apple DOS

UCSD Pascal

ProDOS

system software 1 to system software 7

Mac OS 8

Mac OS 9

The above mentioned O S is the some commonly using Operating systems in world nowadays.

2. System Calls

System call in Operating systems

It is a system which handles how the program requests to the services from an operating system's kernel that is does not normally have permission to run the system. It also provides the interface different applications. It is also defined as his method by which user processes invoke kernel System provides a well controlled entry into the kernel.

Kernel level

Request (System calls)

User level

The Operating system carry out a task at the highest level of privilege and allows application to request services via system calls which are often implemented through interrupts. When system enters a higher privilege level, it carries a specific set of instructions over which the interrupting program has no direct control.

Some popular system calls

The popular system calls are Open, Read, Write, Wait exec, Fork, Exit and Kill. These are the system called especially designed on UNIX or Lunix-like Operating system. UNIX has more than 300 System calls. In Operating system, System calls are classified into different group based on their performance and task.

Read System call:

NAME

Read-read from a file descriptor

SYNOPSIS

int read(int devoid buf,int count);

DESCRIPTION

read() attmpts to read up to count bytes from file description fd into the buffer starting at buf. If count is zero,read() returns zero and has no othere results. If count is greater than SSIZE_MAX, the result is unspecified. Some other categories on system calls.

1. Process Control:

System calls can have ability to control process in different applications.There are various functions in operating system which are designed to execute different task which are end, abort, load, execute, create process, termination process. The system calls allows to wait for the other program to run that is it waits for time,event, signal event and it also allocate and provides free memory to the system.

2. File management

It allows to manage, create and delete different files in the applications.The othere tasks are opening the files, deleting files, closing files,reading files,repositioning the files, which also helps to get the file attribute and set the file attributes.

3. Device Management

Device Management provides use friendly navigation and organization of filed device,request device, read, write,Sheduling of procedures and storage of device configuration data. It also attached and detaches the device logically.

4. Information Maintenances and communication.

It has ability to maintain the system throughout the different program and communicate between the applications. The information maintenance handles to get time or data, set time of data, get system data, set system data, get process, file of device attributes.

Some examples of System calls:

idGen = {};

idGen_nextID = O;

id Gen.nextID = fuction() {return this_nextID++;}

This is the simple system call example while genarating a ID. In this system,generator must generate an increasing number of eacch new ID.

Another Example of System call; simple kernel function for the system call

asmlinkage long sys_getjiffies (void)

{

return (long)get_jiffies_64();

}

asmlinkage long sys_diffjiggies(long ujiffies)

{

return(long)get_diffjiffies_64()_ujiffies;

}

In above, two functions are provided for jiffies monitoring. The first funtion returns the current jiffies, while the second returns the different of the current and the value that the caller passes in.

3. Comparison between UNIX and window

3.1 UNIX System:

UNIX operating system is developed in 1960s. UNIX is a computer operating system originally developed at AT&T Bell Laboratories. It is very popular among the scientific, engineering, and academic communities due to its multi-user and multi-tasking environment, flexibility and portability, electronic mail and networking capabilities,and the numerous programming, text processing and scientific utilities available. It is a software which makes the computer work. Unix is a stable, multiuser, multi-tasking system for servers , desktops, laptos. Unix also has a graphical user interface which is very similar to the Microsoft Windows which provides easy to use environment.

The unix Operating system is made up of three parts; the kernel, the shell and the program. All three parts have their own work in the operating system. Kernel allocates time and memory to programs and handles the file store and communication in response to system calls.

Some system calls in UNIX operating system, such as open for opening a file, and exec for executing a program file.

System calls in UNIX for low level file I/O

- create (name, permissions)

-open(name, mode)

-close(fd)

System calls for process control.

-fork ()

-wait ()

-exit ()

3.2 Windows Operating System

Window is the most famous and popular Operating system in computing world, that runs on high -end desktop and PCs and Servers. Microsoft Window is a serious of software operating system which is produced by Microsoft Company based on United State of America. Microsoft introduced window first time in 1985 as an MS-DOS in response to the growing interest in GUI. The latest version of the Window is the Window 7 which is released in 2009. Some products from windows are listed below;

Windows 1.0, Windows 2.0, Windows 2.1x, Windows 3.0 and Window 3.1, Window 95, Window 98 and Me, Windows NT, Window 2000, Window XP, Window Vista, Window 7.

Window has developed several tools for advanced users. These include the support Tools, the Software Development Kit, the Driver Development Kit and the monitoring the system. The Window Operating systems form Window family has some common similarities with UNIX and UNIX like Operating System. They share different processor access mode: the user mode and the kernel mode. Comparisons of UNIX and Window in terms of; GUI- Both Unix and Windows provide a GUI and a command line interface. The Windows GUI has changed from Windows 3.1 to Windows 95 (drastically) to Windows 2000 (slightly) to Windows XP (fairly large) and is slated to change again.eg, system calls in window,

To edit directory list open dirList

OPEN(FIle=dirList, Format='"",5F,')

DLG (Edit=dirList, Format="A8, i12,z4, 3UWWW YY-MM-DD HH:mm")

Windows operating system supports the following features and capabilities:

I. Multitasking.

II. Window Operating system is flexibility to choose a programming interface (user and kernel APIs).

III. Persistent system service processes called "Windows Services" and managed by the Windows Service Control Manager (SCM).

The UNIX operating system supports the following features and capabilities:

I. This is also capable to working as Multitasking and multiuser Operating system.

II. In this System the Kernel written in high-level language.

III. This Operation system is built-in networking. (TCP/IP is standard.)

IV. Single compatible implementation irrespective of the vendor from whom it is purchased.

4. Case Study

4.1 Process Handling

4.1.1 UNIX Environment

All the software in the computer, including operating system is organied into a numumber of sequential processes which is simply call Process Handling.A process is just an executing program, including the current value of program counter. UNIX is a multiprogramming system, so multiple, independent process may be running at the same time. Each user have several active processes at once in a large system, there are thousands of processes running. When we type a command in computer and press enter key , the Unix operating system initiates a process, creating an instance of the command. The processes can be requested by using commands at the shell's command line. for example, Requesting a process; we can type following at the prompt and hit the Enter key; % sleep 60

This will cause our shell to wait for 6 seconds, and then generate another command prompt and wait for next job. We can stop the running process if we can't wait for 60 seconds. it means we ccan suspend this process, we can do this by hitting Control-Z before 60 seconds have passed and we can see the following result;

^Z [1] + suspended sleep 60

%

In Unix each and every processes are separate and can be created in Unix in a unique manner. The fork system call creates an exact copy of the original process.The forking System is also called parent system and process is called child process and they have their own, private memory image.

System calls for process handling

-fork ()

-wait ()

-exit ()

-execl(),execv(),execvp()

-kill( sig,pid)

4.1.2 Window Environment

In the windows systems the are various types of processes and most of them are traditional and can communicate and synchronize with one another, just as they can in Unix.The processes is a very general set of tools for managing resources, both on uniprocessors on multiprocessors. Processes are more important than other applications just like in UNIX, processes are container for resources. Every processes have address have 4GB space, where user occupying 2GB Space. Every process in window system can be created dynamically and it starts with one thread in beginning. Every thread has its state which executes to be ready, running, blocked etc. but process does not have state. A process can runs in user mode, but when it makes a system call it switches to kernel mode and continues to run as the same process with the same properties.

In a Window Operating system kernel that lets on multi tasking needs processes to have certain states. Names for these states are not standardized but have similar functionality. At first, the process is created which is loaded from a secondary storage device ie CD-ROM or hard disk into main memory. While the process is waiting it waits for the scheduler called context switch which load the process into the processor. When process is wait to open the file, it is assigned to the block state. When the process finishes its function the process is removed instantly or is moved to the terminated state.

4.2 Memory Management.
4.2.1 Unix Environment

UNIX has very sophisticated momory management system and resources. Unix got very straightforward memory system which makes program to implement into the machine. In Unix there are three kinds of memory, which are Main, File System, Swap Space. Most Unix system have system calls for managing memory. Some common system calls relating to memory management are listed below.

SYSTEM CALL DESCRIPTION

S=brk(addr) Change data segment size

a=map(addr,len,prof,flags,fd.) Map in file

s=unmap(addr,len) Unmap a file

Text, data and stack are the three segments in address space of every Unix process . The text segment consists the machine instructions that form the programs executable code.C,C++ is translated by the compiler run by text segment. The text segment is normally read-only. That is why the text segment neither grows nor shrinks nor changes in any other way. Data segments contains storage for the program's variables, strings, arrys and others data's. It is categorized into two parts, the initialized data and the uninitialized data. The segment is the stack segment and in the machine this segment starts at or near the top of the virtual address space and grows down towards. In the Unix the memory management system decides which processes should reside in main memory, which monitors the amount of available primary memory and may periodically write processes to a secondary device called the swap device to provide more space in primary memory. At the end , the kernel reads the data from swap device back to main memory.

4.2.2 Window Environment

Window is very complicated operating system, which has numerous sohisticated virtual merory systems.As we mentioned above, in Window, every user process has its virtual address space that 32 bit long and each process has 4 GB of virtual address space. The lower 2GB are available for the process code and data.

64 KB of space in top and buttom is narmally unmapped. The starting at 64KB is for user's private code and datas. The last part of the 2GB contains some system counter and timers.The upper part of the 2GB adress space contains the data ,code and the paged and nonpaged pools which is used for the object. These upper part of the space is not writable and readable for user mode process. For example Window 2000, and other many versions of Unix, allows files to be mapped directly onto regions of the virtual address space. If we once dragged a file onto the address spaces it can be read and write using ordinary memory references. Memory mapped file can be used by same way like other committed pages, where only the shadow pages are in the user's file insted of in the paging file. If we unmapped the file, the disk version is brought up to date. The Win32 API has a number of functions that hels a process to manage its virtual memory explicity. The differnt functions are developed to work different work, these functions are described below.

The VirtualAlloc function in Win32 API allows to Reserve or commit a region in the system calls, while Virtual free function helps to release or decommit a region. The other functions are VirtualProtect, VirtualQuery, VirtualLock, Virtual Unlock etc. Othere functions are CreateFileMapping, MapViewOfFile,UnmapViewOfFile and OpenFileMapping, which ara for managing memory-mapped files. In order to map a file, a mapping object must be created, with CreateFileMapping function.

4.3. Input and Output
4.3.1 Unix Environment;

The Input/output system in Unix is straightforward process. The computes which are running Unix have Input and Output devices such as disks, printers and networks connected to them. There are various solutions which are possible in the Unix Input/Output devices. Each and e very I/O device is assinged a path name. For example, "cp file/dev/lp" , it means copies the file to the printer causing it to be printed. In the Unix there are some special files and are divided into two parts, block and character. A block special file is one consisting of a sequence of numbered block. The main feature of these files is that each block can be individually addressed and accessed. The most Unix systems had system call functions that performed a large number of device-specific actions on speccial files. There are six system calls associate with it. The first four are used to set and get the terminal speed. Different calls are provided for inpurt and output because some modems operate at split speed. The reaming two system calls are for setting and rading back all the special characters used for erasing character and lines, interrupting processes.

System calls for Input/Output;

-create(name, permissions)

-open(name, mode)

-close(fd)

Unlike(fd)

-read( fd,buffer,n_to_read)

-write(fd,buffer,n_to_write)

The main function of the Input/output system in Window is to provide a frame work for efficiently handling a very wide variety of Input/output devices. The most common Input devices in window systems are various kinds of Keyboard, mice, touch pads, joysticks, scanners, still cameras, Bar code reader etc. And the Output devices are monitor, printers, CD-recorders and sound cards. The Input/output manager is very useful terms with the plug-and-play manager. There are some co-relation between input and output manager and the powered manager; the power manager can put the computer into different states. These features are usually very important on servers, which are not available in Unix Systems. There are various way that we can find thread in the I/O when it is completed. The first is to specify an event object at the time of the call and then wait.

4.4 File Management
4.4.1 Unix Environment

The UNIX system is organized into the files and files are managed into directories. These are categories into tree-like structure which is called the file management. The basic types of files are listed below;

I. Ordinary Files:

An Ordinary file is which contains data, text or program instructions.

II. Directories:

It stores both special and ordinary files. The Directories in UNIX files are quite similar to the Window or Mac OS.

III. Special Files:

Special files gives access to hardware such as CD-ROM drives, hard drives, modems. Other specials are equivalent to aliases or shortcuts and enable to access a single file.

UNIX file system is sequence of 0 or more bytes containing arbitrary information. In Unix file names are limited to 255 characters, and this has been adopted by system and others versions as well. There are two ways to specify file names in UNIX, both to the shell and when opening a file within a program. The first way is called an absolute path, the example of absolute path is /urs/ast/books/mos2/chap-10. This explains the system to see in the root directories called usr, then see there for another directory, ast. Which contains the directory mos 2 with files in chap-10? Another way is called relative path. The file management is also relatd to the system calls. System calls operate on individual files. To create a new file, we can used the creat call. The parameters in the unix provide the name of the file and protection mode.ie fd=creat("abc,mode"); creates a file called abc with protection bits taken from mode.

4.4.2 Window Environment

In window, the File managements have different job which are, file handling, file access, file control and directory operations. In window NTFS are also limited to 255 characters. In window the files names are in Unicode. NTFS are designed to support case sensitive names but Win32 API does not fully support case-sensitivity for files name and not all for directory name. Create file, which can be used to create a new file and return a handle to it.

4.5 Security
4.5.1 Unix Environment

The UNIX system is well known for its security system and its more secure than window operating system. UNIX system is identified by its unique user id which is called and denoted by User ID and simply called UID. UID is ranges between 0 and 65,535. The user can be organized into the groups. Which are also numbered with 16-bit integers called GIDs Group IDs.There are few number of system calls relating to security. And it is used to change the protection mode,eg

S=chmod(“/usr/ast/newgame”, 0755);

Some System calls relating to security are shown below;

System call

Description

S=chmod(path,mode)

Change a file protection mode

S=access(path, mode)

Check access using the ral UID and GID

Uid=getuid()

Get the real UID

Uid=getuid()

Get the effective UID

4.5.2 Window Environment

The window system have many security properties, which are; Secure login with ant spoofing measures, discretionary access controls, Privileged access controls, Address space protection per process, Security auditing. Every window user is identified by a security ID called SID. SID is always unique by its nature. When user starts a process, the process and its threads run under the user's SID. Security system is designed to make sure that each object can be accessed only by threads with SID.

Some system calls relating to the security are shown below;

Win32 API function

Description

Initialize security description

Prepare a new security description for use

lookupAccountSid

Look up the SID for a given user name

setSecurityDescriptionOwner

Enter the owner SID in the security description

5. Summary

System calls are the function or instructions which are implemented in both unix and window operating system that can be used by user process. Window and UNIX have their own system calls and are used in various applications. Both unix and Window systems are using in various machines and ranging from notebook computer to supercomputers. The UNIX operating systems are designed to be portable, multi-tasking and multi-user in a time-sharing configuration which is widely used in banking, engineering and other companies. The UNIX and Windows consists of many utilities along with the master control program called kernel but the system calls are defined quite differently in both systems.

6. References

1. A. Tanebaum, Modern operating system 2nd edition

2. Per Brinch Hansen, Classic operating system

3. Jerry Peek ,G.T and J. Strang, Learning the unix operating system.

4. Unix, UNIX introduction <http://www.eesurry.ac.uk>

5. <http://www.technet.microsoft.com>

6. http://www.answers.com/topic/system-call-1

7. http://cpmnet.columbia.edu/computers/html/unix

Writing Services

Essay Writing
Service

Find out how the very best essay writing service can help you accomplish more and achieve higher marks today.

Assignment Writing Service

From complicated assignments to tricky tasks, our experts can tackle virtually any question thrown at them.

Dissertation Writing Service

A dissertation (also known as a thesis or research project) is probably the most important piece of work for any student! From full dissertations to individual chapters, we’re on hand to support you.

Coursework Writing Service

Our expert qualified writers can help you get your coursework right first time, every time.

Dissertation Proposal Service

The first step to completing a dissertation is to create a proposal that talks about what you wish to do. Our experts can design suitable methodologies - perfect to help you get started with a dissertation.

Report Writing
Service

Reports for any audience. Perfectly structured, professionally written, and tailored to suit your exact requirements.

Essay Skeleton Answer Service

If you’re just looking for some help to get started on an essay, our outline service provides you with a perfect essay plan.

Marking & Proofreading Service

Not sure if your work is hitting the mark? Struggling to get feedback from your lecturer? Our premium marking service was created just for you - get the feedback you deserve now.

Exam Revision
Service

Exams can be one of the most stressful experiences you’ll ever have! Revision is key, and we’re here to help. With custom created revision notes and exam answers, you’ll never feel underprepared again.