Welcome to uCoder.com

Our intension behind developing this website is that We see, most of the students often struggule searching micro-projects and notes during exams or submission.Thus we decided to upload all the notes and micro-projects here.

Continue reading...

You can also help us by sending your micro-projects and notes to our whatsapp.Yor are always welcome here.
Operating Systems

Overview of operating system

Sept 6,2020

What is an operating system ?
An Operating System is a imediator between the user and the hardware.

Continue reading
Software Testing

Introduction of software testing

Sept 9,2020

What is software testing ?
In case we need to know what is a bug or error.Error is a varience between expected result & the actual result and to find out that bug or error is termed as software testing.

Continue reading
Advance Java Programing

AWT -1st chapter

Sept 10,2020

What do you mean by AWT package or toolkit ?
Java AWT is an API to develop GUI or window-based applications in java. AWT is heavyweight i.e. its components are using the resources of OS.
Java swing can be a better option developers mostly prefer.

Continue reading
Client Side Scripting

Basics of JavaScript

Nov 11

What do you mean by CSS ?
It may seem familiar to the HTML,CSS but it is not "Cascading Stylle Sheets" it is called as "Client Side Scripting "

Client-side scripting simply means running scripts, such as JavaScript, on the client device, usually within a browser.

Continue reading

Microprojects

OSY-Micro Project
21 hr ago
CSS-Micro Project
1 day before
AJP-Micro Project
5 mins ago
Recent posts

Overview of operating system

An Operating System (OS) is an interface(imediator) between a computer user and computer hardware


An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.

Responsive image
Explain different generations of operating systems.

Ans -

1. First generation 1945 – 1955 - The earliest electronic digital computers had no operating systems. Machines of the time were so primitive that programs were often entered one bit at time on rows of mechanical switches (plug boards). Programming languages were unknown (not even assembly languages).

2.Second generation 1955 – 1965 - By the early 1950's, the routine had improved somewhat with the introduction of punch cards. The General Motors Research Laboratories implemented the first operating systems in early 1950's for their IBM 701. The system of the 50's generally ran one job at a time. These were called singlestream batch processing systems because programs and data were submitted in groups or batches.

3. Third generation 1965 – 1980 - The systems of the 1960's were also batch processing systems, but they were able to take better advantage of the computer's resources by running several jobs at once. So operating systems designers developed the concept of multiprogramming in which several jobs are in main memory at once; a processor is switched from job to job as needed to keep several jobs advancing while keeping the peripheral devices in use.

4. Fourth generation 1980 – With the development of LSI (Large Scale Integration) circuits, chips, operating system entered in the system entered in the personal computer and the workstation age. Microprocessor technology evolved to the point that it becomes possible to build desktop computers as powerful as the mainframes of the 1970s.

Types of OS

Explain different types of operating systems.

Ans -

List of different types of operating systems:

  1. Batch Operating System.
  2. Multiprogramming Operating system.
  3. Time shared operating systems.
  4. Multiprocessor Operating System.
  5. Distributed Operating System.
  6. Real time Operating System.
  7. Mobile Operating System.
Batch Operating System

The users of a batch operating system do not interact with the computer directly. Each user prepares his job on an off-line device like punch cards and submits it to the computer operator.
Responsive image
To speed up processing,jobs with similar needs are batched together and run as a group. The programmers leave their programs with the operator and the operator then sorts the programs with similar requirements into batches.

The problems with Batch Systems are as follows −
  • 1) Lack of interaction between the user and the job.
  • 2) CPU is often idle, because the speed of the mechanical I/O devices is slower than the CPU.
  • 3) Difficult to provide the desired priority
Multiprograming Operating System
Responsive image

1. In this the operating system picks up and begins to execute one of the jobs from memory.

2. Once this job needs an I/O operation operating system switches to another job (CPU and OS always busy).

3. Jobs in the memory are always less than the number of jobs on disk(Job Pool).

4. If several jobs are ready to run at the same time, then the system chooses which one to run through the process of CPU Scheduling.

5. In Non-multiprogrammed system, there are moments when CPU sits idle and does not do any work. In Multiprogramming system, CPU will never be idle and keeps on processing.

Multiprocessor operating systems
Responsive image

A Multiprocessor system consists of several processors that share a common physical memory. Multiprocessor system provides higher computing power and speed. In multiprocessor system all processors operate under single operating system. Multiplicity of the processors and how they do act together are transparent to the others.

Advantages
  • Execution of several tasks by different processors concurrently, increases the system's throughput without speeding up the execution of a single task.
  • If possible, system divides task into many subtasks and then these subtasks can be executed in parallel in different processors. Thereby speeding up the execution of single tasks.
Distributed Operating System
Responsive image

Distributed systems use multiple central processors to serve multiple real-time applications and multiple users.
Data processing jobs are distributed among the processors accordingly.
The processors communicate with one another through various communication lines (such as high-speed buses or telephone lines).
These are referred as loosely coupled systems or distributed systems. Processors in a distributed system may vary in size and function.
These processors are referred as sites, nodes, computers, and so on.

Advantages -
  1. As there are multiple systems involved, user at one site can utilize the resources of systems at other sites for resource-intensive tasks.
  2. Fast processing.
  3. Less load on the Host Machine.
Real Time Operating System
Responsive image

A real-time system is defined as a data processing system in which the time interval required to process and respond to inputs is so small that it controls the environment.
The time taken by the system to respond to an input and display of required updated information is termed as the response time. So in this method, the response time is very less as compared to online processing.

  • Real-time systems are used when there are rigid time requirements on the operation of a processor or the flow of data and real-time systems can be used as a control device in a dedicated application.
  • A real-time operating system must have well-defined, fixed time constraints, otherwise the system will fail. For example, Scientific experiments, medical imaging systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

There are types of real time operating systems.

1.Hard Real Time- systems -

Hard real-time systems guarantee that critical tasks complete on time. In hard real-time systems, secondary storage is limited or missing and the data is stored in ROM. In these systems, virtual memory is almost never found.

2.Soft Real Time- systems -

Soft real-time systems are less restrictive. A critical real-time task gets priority over other tasks and retains the priority until it completes. Soft real-time systems have limited utility than hard real-time systems. For example, multimedia, virtual reality, Advanced Scientific Projects like undersea exploration and planetary rovers, etc

Time Sharing Operating System
Responsive image

1.Time-sharing is a technique which enables many people, located at various terminals, to use a particular computer system at the same time. Time-sharing or multitasking is a logical extension of multiprogramming. Processor's time which is shared among multiple users simultaneously is termed as time-sharing.

2.The main difference between Multiprogrammed Batch Systems and Time-Sharing Systems is that in case of Multiprogrammed batch systems, the objective is to maximize processor use, whereas in Time-Sharing Systems, the objective is to minimize response time.

3.Multiple jobs are executed by the CPU by switching between them, but the switches occur so frequently. Thus, the user can receive an immediate response. For example, in a transaction processing, the processor executes each user program in a short burst or quantum of computation. That is, if n users are present, then each user can get a time quantum. When the user submits the command, the response time is in few seconds at most.

Mobile Operating system
Responsive image

Handheld systems include Personal Digital Assistants(PDAs), such as Palm-Pilots or Cellular Telephones with connectivity to a network such as the Internet. They are usually of limited size due to which most handheld devices have a small amount of memory, include slow processors, and feature small display screens.


Components Of Operating System


Enlist system components. Describe any two in detail.

Ans -

List of operating system components:

Responsive image
  • Process management
  • Main memory management
  • File management
  • I/O system management
  • Secondary storage management
Process Management

The operating system manages many kinds of activities ranging from user programs to system programs like printer spooler, name servers, file server etc.
Each of these activities is encapsulated in a process. A process includes the complete execution context (code, data, PC, registers, OS resources in use etc.). The basic unit of software that the operating system deals with in scheduling the work done by the processor is either a process or a thread, depending on the operating system.

It’s tempting to think of a process as an application, but that gives an incomplete picture of how processes relate to the operating system and hardware.
The application you see (word processor or spreadsheet or game) is, indeed, a process, but that application may cause several other processes to begin, for tasks like communications with other devices or other computers. There are also numerous processes that run without giving you direct evidence that they ever exist. A process, then, is software that performs some action and can be controlled by a user, by other applications or by the operating system.

It is processes, rather than applications, that the operating system controls and schedules for execution by the CPU. In a single-tasking system, the schedule is straightforward. The operating system allows the application to begin running, suspending the execution only long enough to deal with interrupts and user input.

The five major activities of an operating system in regard to process management are -
  • Suspension and resumption of processes.
  • A mechanism for process synchronization.
  • A mechanism for process communication.
  • A mechanism for deadlock handling.
  • Creation and deletion of user and system processes.
Main-Memory Management

Services provided under Memory Management are directed to keeping track of memory and allocating/de allocating it to various processes.
The OS keeps a list of free memory locations. Before a program is loaded in the memory from the disk, this MM consults the free list, allocates the memory to the process, depending upon the program size and updates the list of free memory. Primary-Memory or Main-Memory is a large array of words or bytes. Each word or byte has its own address. Main-memory provides storage that can be access directly by the CPU. That is to say for a program to be executed, it must in the main memory.

The major activities of an operating in regard to memory-management are -
  • Keeping track of which parts of memory are currently being used and by whom.
  • Deciding which processes (or parts thereof) and data to move into and out of memory.
  • Allocating and deallocating memory space as needed.
File Management

A file is a collected of related information defined by its creator. Computer can store files on the disk (secondary storage), which provide long term storage. Some examples of storage media are magnetic tape, magnetic disk and optical disk.

Each of these media has its own properties like speed, capacity, and data transfer rate and access methods.
A file system normally organized into directories to ease their use.
These directories may contain files and other directions.

The five main major activities of an operating system in regard to file management are -
  • The creation and deletion of files.
  • The creation and deletion of directions.
  • The support of primitives for manipulating files and directions.
  • The mapping of files onto secondary storage.
  • he backup of files on stable storage media.
I/O Device Management

Input / Output device management provides an environment for the better interaction between system and the I / O devices. To interact with I/O devices in an effective manner, the operating system uses some special programs known as device driver.

The device drivers take the data that operating system has defined as a file and then translate them into streams of bits or a series of laser pulses.
The device driver is a specialized hardware dependent computer program that enables another program, typically an operating system to interact transparently with a hardware device, and usually provides the required interrupt handling necessary for the time dependent hardware interfacing.

The I/O subsystem consists of several components -
  • A memory management component that includes buffering, caching, spooling
  • A general device driver interface
  • Drivers for specific hardware devices
Seconary Storage Management

Systems have several levels of storage, including primary storage, secondary storage and cache storage. Instructions and data must be placed in primary storage or cache to be referenced by a running program.

Because main memory is too small to accommodate all data and programs, and its data are lost when power is lost, the computer system must provide secondary storage to back up main memory.
Secondary storage consists of tapes, disks, and other media designed to hold information that will eventually be accessed in primary storage (primary, secondary, cache) is ordinarily divided into bytes or words consisting of a fixed number of bytes.
Each location in storage has an address; the set of all addresses available to a program is called an address space.

The three major activities of an operating system in regard to secondary storage management are :
  • Managing the free space available on the secondary-storage device
  • Allocation of storage space when new files have to be written.
  • Scheduling the requests for memory access.

Operating system operations


Explain operating system operations.

Ans -

An operating system is a construct that allows the user application programs to interact with the system hardware.Operating system by itself does not provide any function but it provides an atmosphere in which different applications and programs can do useful work.

The major operations of the operating system are process management, memory management, device management and file management. These are given in detail as follows:

  • Process management
  • Memory management
  • Device management
  • File management
Process Management

The operating system is responsible for managing the processes i.e assigning the processor to a process at a time. This is known as process scheduling. The different algorithms used for process scheduling are FCFS (first come first served), SJF (shortest job first), priority scheduling, round robin scheduling etc.

There are many scheduling queues that are used to handle processes in process management. When the processes enter the system, they are put into the job queue. The processes that are ready to execute in the main memory are kept in the ready queue. The processes that are waiting for the I/O device are kept in the device queue.

Memory Management

Memory management plays an important part in operating system. It deals with memory and the moving of processes from disk to primary memory for execution and back again.

The activities performed by the operating system for memory management are:
  • The operating system assigns memory to the processes as required. This can be done using best fit, first fit and worst fit algorithms.
  • All the memory is tracked by the operating system i.e. it nodes what memory parts are in use by the processes and which are empty.
  • The operating system deallocated memory from processes as required. This may happen when a process has been terminated or if it no longer needs the memory.
Device Management

There are many I/O devices handled by the operating system such as mouse, keyboard, disk drive etc.
There are different device drivers that can be connected to the operating system to handle a specific device. The device controller is an interface between the device and the device driver. The user applications can access all the I/O devices using the device drivers, which are device specific codes.

File Management

Files are used to provide a uniform view of data storage by the operating system. All the files are mapped onto physical devices that are usually non volatile so data is safe in the case of system failure.
The files can be accessed by the system in two ways i.e. sequential access and direct access

  • Sequential Access

    The information in a file is processed in order using sequential access. The files records are accessed on after another. Most of the file systems such as editors, compilers etc. use sequential access.

  • Direct Access

    In direct access or relative access, the files can be accessed in random for read and write operations. The direct access model is based on the disk model of a file, since it allows random accesses.

Program Management

Program Manager contains all the executable files of every application and program present in the computer, and is placed in the root directory of system.

Resource Management

Internally an Operating System acts as a manager of resources of the computer system such as processor, memory, files, and I/O device.
Responsive image
In this role, the operating system keeps track of the status of each resource, and decides who gets a resource, for how long and when. In system that supports concurrent execution of program, the operating system resolves conflicting requests for resources in manner that preserves system integrity, and in doing so attempts to optimize the resulting performance.

Security and protection

Security refers to providing a protection system to computer system resources such as CPU, memory, disk, software programs and most importantly data/information stored in the computer system.
If a computer program is run by an unauthorized user, then he/she may cause severe damage to computer or data stored in it. So a computer system must be protected against unauthorized access, malicious access to system memory, viruses, worms etc.

  • Authentication
  • One Time passwords
  • Program Threats
  • System Threats
  • Computer Security Classifications



Recent projects

Make a Simple Operating System

We'll make a basic Operating System in C#, don't worry, if you even know some basics of c++ or java, you'll understand the code.


By end of this tutorial, you'll be able to make your cool operating system!

Responsive image

Step 1 The Concept

So, how actually a OS works? I'll explain from the level of a electric circuit.
Most of you know logic gates in electric circuits. when many logic gates are connected, i.e. billions of transistors are connected together inside a chip, they can store 0s and 1s. Each gate could store either 0 or 1. Then the connected transistor forms a Micro-Controller or a Micro-Processor. Here we are going to program on the micro-processor which is in your computer.

Did you know that your computer can also run with a operating system!? Wonder how! Every chip in your computer can run individually without a microprocessor but then without OS, it can't do multi tasking or run multiple threads together like in simple words, play a video in which one time music can play and one time graphics can play. But both can't run together.

Because of an operating system, today you can listen to music while browsing the internet. The OS works based on its kernel. The kernel stores all the library files and whenever we run a program, the program's code calls header files from the kernel. In windows, kernel is 'Win32'

Step 2 Materials and Prerequisite Knowledge

What will you need-

Step 3 Introduction to COSMOS

Cosmos (C# Open Source Managed Operating System) is an operating system development kit which uses Visual Studio as its development environment.
Despite C# in the name, any .NET based language can be used including VB.NET, Fortran, Delphi Prism, IronPython, F# and more. Cosmos itself and the kernel routines are primarily written in C#, and thus the Cosmos name. Besides that, NOSMOS (.NET Open Source Managed Operating System) sounds stupid.

Cosmos is not an operating system in the traditional sense, but instead it is an "Operating System Kit", or as I like to say "Operating System Legos".

Cosmos lets you create operating systems just as Visual Studio and C# normally let you create applications. Most users can write and boot their own operating system in just a few minutes, all using Visual Studio. Milestone 5 includes new features such as an integrated project type in Visual Studio, and an integrated debugger.

You can debug your operating system directly from Visual Studio using breakpoints. Cosmos is available in two distributions, the developer kit (dev kit), and the user kit. The dev kit is designed for users who want to work on Cosmos itself. The user kit is designed for those who are interested in building their own operating system and doing some Cosmos work. The dev kit might be thought of as the Cosmos SDK. Most users should start off with the user kit as it is not so overwhelming like the dev kit. This article focuses on the user kit.

Step 4 Writing Your First Operating System

So, first lets write a OS which can simply print some text on screen!
For that install all of the software required that is mentioned in the previous step.

  • Open visual studio and navigate to File>New Project
  • In the new project dialog box, select COSMOS and then COSMOS Project in the templates box. Name the project and click OK!
Responsive image
  • Now you'll see a file "program.cs" in the solution explorer. Click and load it.
  • You'll see a whole lot of code in it, don't be scared, we just need to edit code under "public static void Init()" block only
Responsive image
  • Now click on start button you see on visual studio toolbar or from Debug menu, click "start debugging"
  • You'll see a COSMOS Builder window appear, without any modification, just boot click build
Responsive image
  • WOW! So that QEMU window appear? QEMU is actually a operating system emulator so you are seeing the code being executed.

Now lets make some modifications and personalize the OS.

Step 5 Personalizing the OS

Now just make some simple changes in code,

under public static void Init() Change

Console.WriteLine("Welcome! You just booted C# code. Please edit Program.cs to fit your needs");

to

Console.WriteLine("Hello World! This is my first operating system"); Responsive image

So, you've changed Welcome! You just booted C# code. Please edit Program.cs to fit your needs to Hello World! This is my first operating system.
We've just edited the text. Now lets compile the code and see the output. Perform the steps in previous step to compile the code.

Responsive image Saw that! Text has changed! you can even put your name here. Congrats! you've won half the battle by understanding the basics. But how about a operating system that takes input from user and gives user a output? Just like command line operating systems or Linux terminal.

Step 6 Making a Command Line OS

So here we'll make a command line operating system. As we saw the previous code, the code just writes some text on screen via Console.WriteLine() function. Now we will write a OS where the user gives the input and the computer processes it.

Responsive image
So, lets make a code which prints Hello User! Thanks for using this operating system! when we give hello as input to the computer.
In programming, there are different kinds of loops which most of you know like If loop which does the action if the conditions are met. So here will will use if loop and if the input of a user is hello, then it will print the line we mentioned above.

Code :
string input;

input = Console.ReadLine();

if (input == "hello")
{

Console.WriteLine("Hello User! Thanks for using this operating system!");

}

Here in this code, we made a string named input in which we read some data. The If loop checks that if the input matches the word hello, then it should print Hello User! Thanks for using this operating system!

Now lets go and execute this code! You can now type into the operating system now! type hello
Excited? Saw the output?

Responsive image
You made your own command line OS. but how about adding many more features in this? Like if you type about, it tells you the info about the OS and if you type help it shows the list of commands? Lets do it in the next step.

Step 7 Adding More Features to Our OS

So, lets add more features like about which displays COSMOS OS 1.0 and help which displays

hello - Simple OS command

about - Know about OS

Similarly like the previous step, make 2 more if loops.

Responsive image
Code :
string input;

input = Console.ReadLine();

if (input == "hello") {

Console.WriteLine("Hello User! Thanks for using this operating system!");

}

if (input == "about") {

Console.WriteLine("COSMOS OS 1.0 ");

}

if (input == "help") {

Console.WriteLine("hello - Simple OS command"); Console.WriteLine("about - Know about OS ");

}

In this code as you see we've made 2 more if loops. Now execute the code and type about.
Saw that, it displays COSMOS OS 1.0 and then close the window and re-execute the code and then type help. Saw that? This means everything is going good.

Now every OS has a option of shut down or power off. So lets add features like shutdown and restart.

Step 8 Adding Shutdown and Restart Features

Adding shutdown and restart feature is also extremely easy. In cosmos the code to shutdown is Cosmos.Sys.Deboot.ShutDown(); and to restart is
Cosmos.Sys.Deboot.Reboot();

Now make IF loops which have input as shutdown and restart .

Code :
string input;

input = Console.ReadLine();

if (input == "hello") {

Console.WriteLine("Hello User! Thanks for using this operating system!");

}

if (input == "about") {

Console.WriteLine("COSMOS OS 1.0 ");

}

if (input == "help") {

Console.WriteLine("hello - Simple OS command");

Console.WriteLine("about - Know about OS ");

}

if (input == "shutdown") {

Cosmos.Sys.Deboot.ShutDown();

}

if (input == "restart") {

Cosmos.Sys.Deboot.Reboot(); }

Now execute the code and type restart. Saw it xD! It restarted! Now type shutdown. Saw it, the window closed which means the OS shut down.

Responsive image
This may be the most exciting part when you made a OS which can shutdown and restart itself!
Responsive image
Now lets improve this OS by giving it final touches.

Step 9 Final Touches

In the final touches, we will use the switch case because it is much more simpler and better then IF statement. Responsive image
We will also make a command that when the user types a keyword which is not in list of our commands, it should show No such command Responsive image Just see the code once.

Code :
while (true)
{

string command = Console.ReadLine();

switch (command) {

case "shutdown": { Cosmos.Sys.Deboot.ShutDown();

break;

}

case "help":
{ Console.WriteLine("hello - Simple OS command"); Console.WriteLine("about - Know about OS ");

break; }

case "about":
{

Console.WriteLine("COSMOS OS 1.0 "); break;

}

case "reboot":
{

Cosmos.Sys.Deboot.Reboot(); break;

}

case "hello":
{

Console.WriteLine("Hello User! Thanks for using this operating system!"); break;

}

default:
{

Console.WriteLine("No such command"); command = null; break; }

}

}

Ok, just copy the code into visual studio and execute the code. Note that we added the break;. This is used in switch case. Now have the fun with your OS!

Responsive image
Now try to type a wrong command like help me. this command was not defined so it shows No command found. This means now our OS won't accept wrong commands. And try all commands. You may have noted that now you can type another command after previous as we are taking input in a constant loop.

Step 10 Running & Testing the OS

So i'm now going to test the OS we made. I'll be using a Virtualization software to run the OS. I'll be using VMware player which is free to download!

Responsive image
Ok, so create a virtual machine and open C:\Users\ {Your Username} \AppData\Roaming\Cosmos User Kit

Responsive image
Here you will find cosmos.iso file after you select build ISO in visual studio. Just boot this file in VMware and enjoy your operating system! (make it full screen)

Responsive image

www.000webhost.com