Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

Thursday, September 9, 2010

UNIX process

UNIX process

process is a running instance of a program,identified with "pid"

process consist of
  • allocated system resources
  • a section of memory
  • security attributes (like its owner and set of permissions)
  • the process state(running,blocked,waiting)
  • process can also be called as execution context of a running program in the current time slice, which is given by the OS as part of scheduling the processes running in the CPU
  • process can also be defined in terms of data structure which stores the information about the process
  • new process is created by "fork" command in Unix
  • program is an executable file in binary format that can be read by the CPU, and process is a program in action (execution)
process control system provides services for
  • process scheduling, giving cpu time(divided into time slice) to each process, context switch(when time slice ends or the process waiting for a resource) from one process to other when execution context changes
  • context is the contents of the CPU register and the program counter
  • when context switch occur
  • when scheduling multiple tasks(from one process or thread to another), handling the hardware interrupt,user and kernel mode switching

Unix File System

Unix filesystem
  1. Unix has only files (directory,special file or device file) and processes
  2. Tree like structure (hierarchy)
  3. root node topmost (only one root)
  4. all data in files is a stream of bytes, for the kernel
  5. files dynamically grow
Internal View
  1. made up of blocks (eg 512 or 1024 bytes blocks)
  2. block 0 is boot block (used for booting)
  3. block 1 is super block (store info about file system, like type,free and used space)
  4. then comes the i-list blocks (contains the i-node blocks for all the files in the system)
  5. then comes the data block (storing the actual data)