Install latest eclipse in Linux

Guidance from: http://askubuntu.com/questions/26632/how-to-install-eclipse

How to install Eclipse 4.2 on Ubuntu 12.04
Since the Eclipse packages in the Ubuntu repositories are out of date, if we want to install latest releases, we are going to have to do it manually. You can just download the tar.gz file fromeclipse.org.
  1. Download Eclipse. I got eclipse-jee-juno-SR1-linux-gtk.tar.gz
  2. Extract it by executing a command line
    tar -xzf eclipse-jee-juno-SR1-linux-gtk.tar.gz
    Or with Archive Manager extraction.
  3. Move extracted eclipse folder to /opt/ folder
    mv eclipse /opt/
    sudo chown -R root:root /opt/eclipse
    sudo chmod -R +r /opt/eclipse
  4. Create an eclipse executable in your user path
    sudo touch /usr/bin/eclipse
    sudo chmod 755 /usr/bin/eclipse
    Create a file named eclipse in /usr/bin/ with your preferred editor (nanogeditvi…)
    Copy this into it
    #!/bin/sh    
    export ECLIPSE_HOME="/opt/eclipse"
    ECLIPSE_HOME/eclipse*
    And save the file
  5. Create a Gnome menu item
    Create a file named eclipse.desktop in /usr/share/applications/ with your preferred editor (nanogeditvi…)
    Copy this into it
    [Desktop Entry]
    Encoding=UTF-8
    Name=Eclipse
    Comment=Eclipse IDE
    Exec=eclipse
    Icon=/opt/eclipse/icon.xpm
    Terminal=false
    Type=Application
    Categories=GNOME;Application;Development;
    StartupNotify=true
    And save the file
  6. Launch Eclipse
    /opt/eclipse/eclipse -clean &
  7. Now you can Lock Eclipse to the launcher bar by clicking right button on Lock to Laucher

User Mode and Kernel Mode

Mode Bit

  • A bit, called mode bit, is added to the hardware of the computer to indicate current mode.
    • 0: kernel mode
      • When a task is executed on behalf of the operating system
    • 1: user mode
      • When a task is executed on behalf of the user

Switch

  • Whenever a trap or interrupt occurs, the hardware switches from user mode to kernel mode
    • i.e., change mode bit to 0
  • When a user application requests a service from the operating system (via a system call)
    • It must transition from user to kernel mode to fulfill the request
  • Privileged Instructions
    • The hardware allow privileged instructions to be executed only in kernel mode. 
    • The instruction to switch to kernel mode is an example of a privileged instruction. Some other example include I/O control, timer management, and interrupt management. 

Virtual Memory

Advantage

  • It allows the execution of a process that is not completely in memory. So that it enables users to run programs that are larger than actual physical memory.
  • In addition, it abstracts main memory into a larger, uniform array for storage, separating logical memory as viewed by the user from physical memory. This arrangement free programmers from concern over memory-storage limitations. 

Driver

Device Controller

  • A device controller is in charge of the devices. 
  • It maintains 
    • some local buffer
    • and a set of special purpose registers
  • It is responsible for moving the data between the peripheral devices that it is controls and its local buffer storage.

Device Driver

  • The operating system has a device driver for each device controller
  • This device driver understands the device controller and presents a uniform interface to the device to the rest of the operating system

Interrupt Driver IO

  • Procedure
    • The device driver loads the appropriate registers within the device controller.
    • The device controller, in turn, examines the contents of these registers to determine what action to take.
    • The controller starts the transfer of the data from the device to its local buffer.
    • Once the transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its operation.
    • The device driver then returns control to the operating system, possibly returning the data or a pointer to the data if the operation was a read.
  • Drawback
    • High overhead when used for bulk data movement such as disk I/O.
    • To solve this problem, directed memory access (DMA) is used.

Directed Memory Access (DMA)

  • After setting up buffer, pointers and counters for the I/O device, the device controller transfers an entire block of data directly to or from its own buffer storage to the memory, with no intervention by the CPU.

Interrupt

Introduction


The occurrence of an event is usually signaled by an interrupt from either the hardware or the software.

  • Hardware
    • Hardware may trigger an interrupt at any time by sending signal to the CPU, usually by way of the system bus.
  • Software (called Trap)
    • Software may trigger an interrupt by executing a special operation called a system call.
    • The Trap could be, e.g., division by zero, or invalid memory access

Return Address

  • Before the interrupt
    • Before enter the interrupt, the return address will be stored on the system stack.
  • After the interrupt
    • After the interrupt is serviced, the saved return address is loaded into the program counter, and the interrupted computation resumes s through the interrupt had not occurred.

Bootstrap

Bootstrap

When a computer start running, i.e., when it is powered up or rebooted. it needs to have an initial program to run.

This initial program, or bootstrap program, tends to be simple. Typically, it is stored in read-only memory (ROM) or eletrically erasable programmable read-only memory (EEPROM), known by the general term firmware, within the computer hardware.

Computer Storage Unit

Bit

A bit is the basic unit of computer storage. It can contain one of two values, zero or one.

Byte

A byte is 8 bits, and on most computers it is the smallest convenient chunk of storage. 
  • For example, most computers don’t have an instruction to move a bit but do have one to move a byte

Word

A word is generally made up of one or more bytes. 
  • For example, a computer may have instructions to move 64-bit (8-byte) words.

KiloByte

  • 1024 Bytes

MegaByte

  • (1024)^2 Bytes
    • Usually round off as 1 million bytes

GigaByte

  • (1024)^3 Bytes
    • Usually round off as 1 billion bytes

Completely Fair Scheduler

Introduction

CFP uses a concept called “sleeper fairness“,

  • which considers sleeping or waiting tasks equivalent to those on the runqueue. This means that interactive tasks which spend most of their time 
  • So that the interactive tasks which spend most the their time waiting for user input or other events get a comparable share of CPU time when they need it.

Algorithm

  • The data structure used for the scheduling algorithm is a red-black tree in which the nodes are scheduler-specific structures, entitled “sched_entity”. 
    • These are derived from the general task_struct process descriptor, with added scheduler elements. These nodes are indexed by processor execution time in nanoseconds. 
    • Idea Processor
      • an “idea processor” would equally share processing power among all processes
    • Maximum execution time
      • Thus the maximum execution time is the time the process has been waiting to run, divided by the total number of processes, or in the other words, the maximum execution time is the time the process would have expected to run on an “ideal processor”
      • A maximum execution is also calculated for each process. This time is based upon the idea that an “idea processor” would equally share processing power among all processes. 
  • When the scheduler is invoked to run a new process, the operation o the scheduler is as follows
    • The left most node of the scheduling tree is chosen (as it will have the lowest spent execution time), and sent for execution
    • If the process simply completes execution, it is removed from the system and scheduling tree
    • If the process reaches its maximum execution time or is otherwise stopped (voluntarily or via interrupt), it is reinserted into the scheduling tree based on its new spent executiom time.
    • The new left-most node will then be selected from the tree, repeating the interation. 

Reference

[1] https://en.wikipedia.org/wiki/Completely_Fair_Scheduler