Operating System Lecture Notes

This is the final lecture notes on Operating System based on Pokhara University Curriculum. I have tried to compile it in more concise and meaningful so that the students feel comfortable with it.I  believe that it would be beneficial for their coursework.

Operating-System-PU

References:

1.  Modern Operating System by: Andrew S. Tannenbaum

2. Operating System Concepts by: Abraham Silberschatz, G. Gange, P.B Galvin

3. Wikipedia, the free Encycolpedia

4. Operating System internals and Design principle by: William Stalling

5. Distributed Systems: Principles and Paradigms. Andrew S. Tanenbaum

6. IISc Bangalore

7. Kent University lecture Notes

8. Berkely University Lecture Notes

 

 

 

 

OS Notes (Draft Version)

Hello Guys, please have a look on this draft  version of Operating System notes. Complete version will be available within 2 weeks.

Operating-System-NEC

Compiling C program including math functions

Generally you can compile C program as: gcc -Wall <programname.c> and for linking math functions such as pow, you need to specify the -lm option. Note that -lm option should be at the end of the command for Ubuntu11.10. So its better to always put the -lm option at the end of the gcc compilation.

Example:

daya@daya-Aspire-4937:~/Desktop/gcc$ gcc -Wall lab2ac.c
/tmp/ccHP22fZ.o: In function `main’:
lab2ac.c:(.text+0x8d): undefined reference to `pow’
collect2: ld returned 1 exit status
daya@daya-Aspire-4937:~/Desktop/gcc$ gcc -Wall lab2ac.c -o lab2ac.o -lm
daya@daya-Aspire-4937:~/Desktop/gcc$

 

 

Tutorial Sheets

Tutorial sheet-1

tutorials1

Lab-Sheets

lab-sheet-1

Why Gcc and Linux System in NEC

C is the great Programming language, and if you know detail about C you can do everything with Computer . Python, Perl, and Java are based on C. The most fabulous part is that the GNU/Linux system is built under C. This year I am teaching C as well as Operating System. Actually , I am breaking the conventional trend in C labs, earlier labs were based on  Turbo-C and on Windows system. However, from this year onward  student would be using GNU/Linux (Ubuntu) and as Gcc Compiler for C Programming.

One of the student asks me about the reason for migration. To be precise and simple,its due to the following reasons.

  1. Linux System offers us the freedom, its due to the liberty of open-source and free software.
  2. Turbo C is very inefficient Compiler than Gcc.
  3. Have opportunity to learn both (Linux System and C Programming) at one time.
  4. To exhilarate student their enthusiasm and passion on FOSS.
  5. To guide and lit  student rather than put them in dark room.
  6. Lastly, to get rid of Piracy, Viruses, Naughty Licenses and much more …………….

Command Line Audio Player using Python

Gstreamer  is the Opensource  multimedia Framework. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.

Here, we use the gstreamer through Python to play the audio file. (mp3,wav etc). —usage ptyhon audio-player.py <File to Play>

<pre>#!/usr/bin/python
import pygst,sys
pygst.require("0.10")
import gst
import pygtk
import gtk

class Main:
def __init__(self):
# Create the pipeline.
self.pipeline = gst.Pipeline("mypipeline")
self.filesrc = gst.element_factory_make("filesrc", "source")

self.filesrc.set_property("location", sys.argv[1])
self.decode = gst.element_factory_make("decodebin", "decode")
self.decode.connect("new-decoded-pad", self.OnDynamicPad)
self.convert = gst.element_factory_make("audioconvert", "convert")
self.sink = gst.element_factory_make("alsasink", "sink")
# add the elements to the pipeline.
self.pipeline.add(self.filesrc,self.decode,self.convert,self.sink)
# Link them.
self.filesrc.link(self.decode)
self.convert.link(self.sink)
# state in Playing mode.
self.pipeline.set_state(gst.STATE_PLAYING)

def OnDynamicPad(self, dbin, pad, islast):
print "OnDynamicPad Called!"
pad.link(self.convert.get_pad("sink"))

start=Main()
gtk.main()