Wednesday, 23 April 2014

Operating System Concepts

os9 book coverOperating System Concepts
Ninth Edition
Avi Silberschatz
Peter Baer Galvin
Greg Gagne
John Wiley & Sons, Inc. 
ISBN 978-1-118-06333-0 

Face The Real World of Operating Systems Fully Equipped


line separatorWelcome to the Web Page supporting Operating System Concepts, Ninth Edition. This new edition, published
by John Wiley & Sons, became available on December 7, 2012.
General Resources:

Resources of Particular Interest to Instructors:
Resources of Particular Interest to Students:

Friday, 11 April 2014

Solution To Remove Autorun.inf Virus



Solution to Remove Autorun.inf Virus

Step 1: First Disable CD/DVD or USB Autorun in windows
Follow the below steps and ensure your system safety:
    Click start à Run and type GPEDIT.MSC – this opens Group Policy editor window.
    On the left side à expand Computer Configuration à Administrative Templates à System.
    Locate the entry for turn auto play off on the right side.
    Double click it and select ‘Enabled’.
Step 2: Open Winrar.exe (Start à All Programs à WinRar à WinRar.exe)
Step 3: Now browse to any drive that is infected with Autorun.inf virus using winrar explorer.
Step 4: Here you will see all the hidden files under winrar for that particular drive.
Step 5: Look for the file Autorun.inf and open it using notepad.
Step 6: In that Autorun file, some .EXE file will be mentioned that will be executed along with the autorun file. This exe file is the main culprit.
Step 7: Note the exe file mentioned in the Autorun.inf file. Close this Autorun.inf file.
Step 8: Now look for that .Exe file in the drive (Ex: c:/), Delete that .exe file along with Autorun.inf
Step 9: Restart your Operating System. Now your system is free with Autorun.inf Virus.

Note: Repeat the same process if your Usb or Pendrives are infected with Autorun.inf virus..!

Wednesday, 9 April 2014

Sixth semester lectures.


from now onward, all lectures will be uploaded here.
save/ bookmark this link for your easy accessibility.


 LINK





Sunday, 6 April 2014

How to Compile a C program on Ubuntu Linux



How to Compile a C program on Ubuntu Linux

Write, Compile and Run a C program on Ubuntu Linux : For Beginners

This tutorial explains how to compile and run your first C program on Ubuntu Linux operating system.


As a prerequisite i assume that you have
1. Installed an Ubuntu Linux operating system on your computer (probably Ubuntu 10.10 or greater). The pictures shown below are from Ubuntu 12.04. The user interface would be a bit different for the older Ubuntu systems (older than 10.10)
2. A basic idea of Operating system(OS) & Files
3. A very basic idea of C programming OR maybe you could start learning after this session


Note: 
1. This tutorial does not require installation of any additional programs.
2. Key words are emphasized, you could explore on them further in the Internet.

So here we go ...


STEP 1:
Click on the Dash home to your top left and type gedit in the text box. Gedit is a simple text editor. Click on the "Text Editor" icon.




STEP 2:
The text editor would open with an Untitled document. We would type our first C program in it.



I would not go into much detail about C programming. Just a little description of what the above program contains.

The first line of the above program tells the compiler to include a header file that contains function prototypes or function signatures to gain access to standard input output functions, hence the name stdio.h.

The main function is the point of start of execution of a C program. Here we call the printf function, by passing a string within double quotes "" that we want to appear on our terminal. The character '\n' represents printing of a new line after the string. And the semicolon ';' ends the statement.


STEP 3:
We would like to save our C program to hard disk. A simple way to do it is to press 'Ctrl' key and 'S' key on your keyboard together. A dialog box would appear that would ask you details about the filename and its location for saving the text file.

We name it as helloworld.c and save it in Desktop as shown below.



You can notice that once you save it, the text is highlighted! . Yes the gedit text editor has done syntax highlighting of our C program in the text file by understanding that the filename has an extension of ".c".





STEP 4: 
Close the text editor. Now again click on the Dash home to the top left and type terminal in the text box. Click on the "Terminal" icon that appears.




Terminal is a command line application (CLI) that helps the user to interact with OS or run certain programs by issuing text commands at the command prompt provided by the terminal.


STEP 5:
Once the terminal is open, we would like to know where is our current location in the hard disk. So type the commandpwd and press enter (pwd represents present working directory). 



In Linux '/' is used to separate directories or folders (a collection of files and other folders). The first '/' represents theRoot directory (A directory that contains everything that belongs to your operating system & applications).


The path shown is /tmp/guest-rJhn7b. Usually the path would be something like /home/<user name>, but since i have logged in as a guest user hence this path.

By default the terminal opens always at the home directory of a user.



STEP 6:
Now we would like to know what are the contents of our current location. We type the command ls (list directory contents) and press enter.




You can see subdirectories like Desktop, Downloads, Music, Pictures etc.


STEP 7: 
As we have saved our C program in Desktop, we would like to navigate to Desktop subdirectory. For that we would type the command cd Desktop and press enter. (Note: The directory and file names are case sensitive).

Again execute ls command to know contents of Desktop.



You could see the C program that we saved i.e helloworld.c

STEP 8:
Now we would compile this program to create a binary executable that can be run on your computer. We would use the gcc (GNU C compiler) to compile our program.

Type gcc helloworld.c and press enter. Gcc would exit without any errors or warning indicating that the compilation was successful.

Now to run the program type ./a.out and press enter and there you go with the output of your first program !!!



If an output filename is not specified the binary executable is always named a.out and placed in the same directory where you compiled your program.

An alternate way to compile the program is as shown below
gcc helloworld.c -o helloworld
this tells the compiler to compile the program helloworld.c and name the output binary executable as helloworld. 

To execute the binary type ./helloworld (i.e execute a file helloworld which is under current directory. The current directory is represented by a dot '.'. And ./helloworld forms the path of the binary executable).

Hope you could now have fun compiling and running more programs on Linux. 

And don't forget to comment in case you have any doubts. I hope i would be able to clear some basic doubts and for the rest of the doubts a lot of experts are out there on the Internet to help you :)