Rss Feed

OPEN SOURCE OPERATING SYSTEM SUSE

First of all
You can download openSUSE now from Softpedia. I suggest you download a DVD version (x86, 86_64 or PPC) if you have a DVD-ROM drive in your PC or laptop, so you won't have to change the CDs all the time. You can also take a look at the hardware requirements and other installation methods

SECOND

Insert the CD/DVD into your drive and boot from it, you will be prompted with a boot menu, you have a couple of options here, like F2 if you want another language for the installation process (English is default) or to select the resolution and the installation source use F3 respective F4 buttons, then just select "Installation" option and hit enter. After the kernel will be loaded and you'll see a very nice openSUSE blue boot screen, the wizard appears, asking you to choose the language of the installation process and to agree to the openSUSE license.

THIRD

At the Installation Mode screen just hit next and then you have to choose your time zone for the system clock. After you've hit next at the Clock and Time Zone screen, you will have to make a big choice, select a desktop environment, GNOME or KDE are the biggest rivals right now on the Linux desktop battle, but you also have an option to choose another window manager. I suggest you stick to both KDE and GNOME, so right now, at this screen, choose either GNOME or KDE, because on the next step of the installation process, we will choose the other desktop environment as well.

FOURTH

You will see now a summary of the Installation Settings, which comes in a Standard (default) and Expert (for power users) view. I will suggest using an empty hard drive for this installation; that means no other operating system on it, ok? The partition process is automatic and it will erase all your data from the selected hard drive. Now click on the "Software" link and you'll arrive to the detailed software selection screen. Here, as I've told you a few rows above, you can select the other desktop environment (Graphical Environments section), and also more other software, regarding your needs.

FIFTH

After you have finished with the packages selection, click the "Accept" button to return to the initial screen (Installation Settings) so you can carry on with the installation process. Before you will return to the Installation Settings screen, you may see some windows that notify you about the modification in the package selection or to accept some licenses of non open source software. Now hit again the "Accept" button and an installation confirmation will appear, hit the "Install" button and the installation will begin. It will take about 20-30 minutes, depending on the software selection and specs of your PC.

SIX

When the install process is over, the system will automatically reboot and it will continue with the final configurations for the system. First, you must select a root (System Administrator) password, and then, you have to choose a hostname and Domain Name for the system. After this, you will see a screen with Network Configurations.

SEVEN

By default, your network card will be configured with DHCP (dynamic IP address), but if you have a static IP address, you must click on the "Network Interfaces" link and setup your IP manually (you must know the Netmask, Gateway and DNS from your provider). Just hit next after you've done all the settings here, and then you have the option to test your network connection. If everything is successful, click the next button and you'll arrive to "Novell Customer Center Configuration" screen, where I simply suggest you click on the "Configure Later" option and carry on with the installer.

EIGHT

Some additional installation sources will be prompted for you to register, but this will take some time and you can add them later, so I suggest you select No and then click the next button so you can opt for the authentication method. I suggest to leave it as it is if you don't know what these settings do and hit the next button again. Now, you must create a user for the system, because it's not a very smart idea to operate a Linux system as root, especially if you're a beginner.

NINE

After you have created the user, you will see the release notes for openSUSE 10.2, which you can view later on the Yast control panel. Hit next and the installer will scan and setup your computer hardware. Take a good look here to see that everything was recognized as it's supposed to be. Normally, the installer will recognize and setup all your hardware correctly, if not, you can click on the hardware component that you consider it was not set up correctly and do extra configuration.

That's it! Congratulations! Click the "Finish" button and you'll be automatically logged in into your new openSUSE machine.

OPEN SOURCE OPERATING SYSTEM Mac OS

INSTALLATION PROCESS OF MAC OS

.

Preparing for InstallationIf you plan to erase your hard disk or archive your current system without preservingyour users and network settings, you’ll need to note your current network settings tomake it easier to get connected again after installing Mac OS X. Go to SystemPreferences > Network, and then check for these settings:

If your network uses: Write down the following:

Ethernet, DSL, or cableconnected via DHCPNothing. DHCP

automatically configures your Internet connection.AirPort connected via DHCPAirPort or wireless network name and password provided by yourAirPort network administratorEthernet, DSL, or cableconnected manuallyInternet Protocol (IP) address (number that looks like 12.345.56.789)Subnet mask (number that looks like 10.255.255.255)Router address (number that looks like 10.208.32.2)Domain Name System (DNS) servers (optional number that lookslike 10.255.255.255, and name that looks like ISPname.com)Search domains (optional name that looks like ISPname.com)Dial-up modemTelephone number, user name, and password provided by yourservice providerDNS servers (optional number that looks like 10.255.255.255, andname that looks like ISPname.com)Search domains (optional name that looks like ISPname.com)
--------------------------------------------------------------------------------

Installing Mac OS XTo begin a custom installation of Mac OS X Leopard, follow these steps.

Step 1: Insert the Mac OS X Install discDouble-click the Install Mac OS X icon, and then click Restart. The installer opensautomatically when your computer restarts.WARNING: If you’re installing Mac OS X on your current Mac OS X startup disk, let theinstaller finish. If you quit, you may not be able to start up using your currentMac OS X startup disk.Double-click this iconon the Install disc.Click Restartto begin.
--------------------------------------------------------------------------------

Step 2: Follow the onscreen instructionsSelect the language you want to use, and then click the forward arrow. The Welcomescreen appears.The installer guides you through the installation process. Refer to the sections thatfollow for information about selecting a destination when you have more than onevolume, selecting installation options, and selecting additional software to install.

Step 3: Select a destinationOn the “Select a Destination” pane, select the volume on which you want to installMac OS X. The screen tells you how much space is required for installation.
--------------------------------------------------------------------------------

Step 4:

Select how you want to install Mac OS XClick the Options button to select “Archive and Install” or “Erase and Install.”

One of thefollowing screens appears:Select how you want to install Mac OS X, and then click OK. Click Continue when you’reready to proceed to the next pane.Install Mac OS XThis option appears if you don’t have Mac OS X installed on your computer or you havean early version of Mac OS X (v10.2.8) that can’t be upgraded.

Select this option toinstall Leopard on your computer.Archive and InstallSelect this option if you want to install a fresh system on your computer.“Archive and Install” moves your existing Mac OS X system files to a folder namedPrevious System, and then installs a new copy of Mac OS X on the selected volume.

Mac OS X–installed applications, such as Address Book and Safari, are archived, andnew versions are installed in the Applications folder.

Unless you choose “Preserve Users and Network Settings,” user accounts and theirhome folders are also archived in the Previous System folder.This is selected ifMac OS X is alreadyinstalled on the volume.This is selected if Mac OS Xisn’t installed.

Select the “Preserve Users and Network Settings”checkbox to import your existing useraccounts, home folders, and network settings into the new system.

User accountsinclude such things as:

 Home folders and their contents

 Preference settings

 Address Book databases

 Browser favorites

 Network settings and locations

“Preserve Users and Network Settings” also copies the existing Shared folder in theUsers folder to your new system.

Note: You can’t start up your computer using the Previous System folder, but settings,preference files, fonts, plug-ins, and other items remain available in case you needthem.

Some applications, plug-ins, and other software may have to be reinstalled after an“Archive and Install.” Fonts that were installed in the Fonts folder in the top-levelLibrary folder can be installed in your new system by copying them from the PreviousSystem folder.

Erase and Install

This method completely erases the destination volume, and then installs a new copy ofMac OS X

Step 5: Select additional software packages to install

The default installation contains all the software you need to use Mac OS X. However,the Mac OS X Install disc contains additional software—such as printer drivers, fonts,and language translations—that you may want to install. To see the available packages,click Customize on the Install Summary screen.The Custom Install pane appears, as shown on the following page. Click the arrowsto reveal specific components. Select the software you want to install, and thenclick Done.WARNING: If you erase the destination volume, everything on the volume—youruser accounts, network settings, and all of your files and folders—will be deleted.If necessary, quit the installer and back up your files before you erase the destinationvolume.
--------------------------------------------------------------------------------

Note: You can always use the Mac OS X Install disc to install additional softwarepackages later.When you’re ready to install Mac OS X and the selected software, click Install on theInstall Summary screen.Click the arrow toreveal components.All componentswill be installed.Only the selectedcomponents willbe installed.
--------------------------------------------------------------------------------

WINDOWS VISTA INSTALLATION GUIDE

WINDOWS VISTA OPERATING SYSTEM
INSTALLATION GUIDE


Important Information
This guide assumes a "clean" installation and not an "upgrade" from a previous OS. Ensure that you backup all of your important files (documents, music, etc) to CD/DVD/another hard drive before following these steps.

If you are using Hard Disks in a RAID or ACPI setup, you will first need to download the latest Vista compatible (32-bit or 64-bit) for your particular hardware before installing clean. Check with your chipset/hard drive controllers manufactures web site for the latest drivers/information before starting.


BEGINNING
After configuring the system for booting from a CD/DVD, the Windows Setup screen appears.

At this point, Setup is loading the driver files it needs to continue with installation.


Progress Bar: The next screen is a more graphical progress bar indicating Windows Vista is still working in the background.


Option Selections:
The first options you will come across are selections for Language, Time and currency format, and Keyboard layout.

Make your selections by using the pull down menus and press the Next button.


Install Now:
Here we have the option of repairing a previous installation or "Install Now."

Highlight the "Install Now" button to continue to the next screen.

Please Wait:
Windows Vista is working in the background. This may take several minutes depending on the system.

Product Key:
This screen is where you enter your product key or "CD Key" as it is sometimes called.

An option also exists to automatically activate Vista upon first coming online. I uncheck this box to ensure everything is running smoothly before activating and having issues later on. 30 days is the standard amount of time before activation is required, though some products (such as MSDN subscriptions) have 60 days or more.

After entering your product key, press the Next button.


License Agreement:

Here we see the License Agreement you must accept before continuing.

After reading the agreement, check the box next to "I accept the license terms".


Option Selections:
Here we would be able to choose an "Upgrade" install (if running setup from a previous version of Windows, such as XP) or a "Custom" (clean) install.

Select the whole box containing "Custom (advanced)" to continue to the next screen.


Product Key:
This screen is where you enter your product key or "CD Key" as it is sometimes called.

An option also exists to automatically activate Vista upon first coming online. I uncheck this box to ensure everything is running smoothly before activating and having issues later on. 30 days is the standard amount of time before activation is required, though some products (such as MSDN subscriptions) have 60 days or more.

After entering your product key, press the Next button.


License Agreement:
Here we see the License Agreement you must accept before continuing.

After reading the agreement, check the box next to "I accept the license terms".


Option Selections:
Here we would be able to choose an "Upgrade" install (if running setup from a previous version of Windows, such as XP) or a "Custom" (clean) install.

Select the whole box containing "Custom (advanced)" to continue to the next screen.


Hard Drives:
This is where you can select which hard drive/partition to install Vista on. Since this system only has one hard drive, only one place Vista can go. Advanced options are shown in the next screen shot.

This is also where you would install drivers for your ACPI/RAID/SATA controller by using the "Load Driver" option. After the installation of the ACPI/RAID/SATA drivers, your hard drives should appear as shown on the right.

If no additional drivers are needed, select the Next button.


Advanced Options:
The advanced options allow creation of multiple partitions and the option of formatting existing partitions.

After finishing your particular partition configuration that you desire, select the Next button.

Installing...:
Here is where Vista installs major components of the OS. This process can take 10 to 60 minutes depending on the system.


Reboot:

Here we see the system needing to reboot to continue installation tasks.

You can hit the Restart Now button or just allow the reboot to happen automatically after several seconds.


First Time:
Here we see a "..." progress as Vista tries to start for the first time. This process may take several minutes before going to the next screen.


Completing Installation:
Vista continues to install at this screen. Depending on system, another reboot or two may happen before the next screen is displayed.


Account Creation:
Here is where we create the first user account for the system and select an icon to be displayed on the login screen. Ensure you password your account.

After finishing entering your information and icon selection, select the Next button.

PC Name:
Here is where we can name the system for networking purposes. By default, it uses the account name entered in the previous step and adds "-PC" to it. We can also select a background for the desktop.

After making your selection, select the Next button.


Updates:
Here we can configure Windows Update with several options. I suggest "Use recommended options" or the top option for most PC users.


Time Settings:
Here is where you can set the time and daylight savings time options.

After configuring your time zone, clock settings and date, select the Next button.


Network Configuration:
Vista now asks our network configuration by asking "Home, Work or Public Place."

Descriptions are expanded on screen so I will no go into them here.

Make your selection to continue to the next screen.


FINISH:
On this screen, we are thanked by Bill G. for installing Windows Vista.

After you are done being thanked, select the Next button.

WINDOWS XP PROFESSIONAL OS

INSTALLATION PROCESS OF WINDOWS XP PROFESSIONAL

Using "fdisk" does not have to be a difficult chore. If you know what to expect, it is a rather easy task.

Note: If you are "clean" installing Windows 2000, XP Home or XP Pro, and do not wish to multi-boot your system, you do not have to run fdisk before hand as, during the install process, options for creating partitions are built in.

WARNING: Using fdisk to "resize" or recreate a partition will effectively destroy what ever information you have on your hard drive. Do not use fdisk if you wish to save any information that it may contain.

Boot Using a Floppy Image 1.1: (4KB .gif)

1) Boot using a Floppy: (Image 1.1)

I use a Windows Me created boot floppy to run fdisk because:

  • It contains the "latest" fdisk utility
  • The boot floppy has built in CD ROM support

I always start with CD ROM support, so I picked option 2.

No partitions are detected Image 1.2: (8KB .gif)

2) Virus Warning: (Image 1.2)

If no partitions are detected, such as a new hard drive, the Windows Me boot disk is rather helpful in telling you this fact. At this point, do not be alarmed at the "virus warning" statement, as it is generic.

At the "command prompt," in this example, A:, type "fdisk" without the quotes.

'enable Image 1.3: (8KB .gif)

3) Large Disk Support: (Image 1.3)

Unless you have a need, ensure that you enable "Large Disk Support."

Why would you "not" want this? If you have any requirements for DOS, Win3.1, Win95, or WinNT to access the partitions, you may not be able to if the partitions are greater than 2.1 GB.

I selected "Y" for yes.

Deleting Existing Partitions Image 1.4: (4KB .gif)

4) Main Menu: (Image 1.4)

The main menu offers few, but powerful options.

If you have a new drive or one that has previous partitions already deleted, you may jump to that section, below, but it would be a good idea to look over this process, just in case you will need to perform it.

Here, I selected "3" to "Delete partition or Logical DOS Drive."

You may also select "4" to display current partition information.

' Image 1.5: (4KB .gif)

5) Extended Space: (Image 1.5)

If you have more than one partition already defined, you will need to delete the ones located in the "Extended" space.

Select "3" to do just that.

Choose what is best Image 1.6: (5KB .gif)

6) Choose Partition to Delete: (Image 1.6)

Here, you may choose which, if any, partitions you need to delete. If you want to resize your "Primary" partition, you will need to delete all existing partitions, redefine the Primary partition, then recreate (described below) the Extended partition section.

I chose to delete the partition (drive) marked as "E:" here. Choose what is best for your setup.

Delete as many as you desire Image 1.7: (5KB .gif)

7) Are you sure? (Image 1.7)

A prompt will appear to ensure that you know what you are doing. You must type the "Volume" name of the partition, hit enter, then choose "Y" to continue with the delete.

Delete as many as you desire. After clearing out the Extended partition, you may delete the primary partition from the main menu and resize it as necessary.

Creating Partitions Image 1.8: (5KB .gif)

8) Create Primary Partition: (Image 1.8)

Here, we need to create the Primary partition by selecting "1" from the main fdisk menu.

create Primary DOS Partition Image 1.9: (4KB .gif)

9) Create Primary DOS Partition: (Image 1.9)

If no partitions have been defined, select "1" to create Primary DOS Partition.

If you have already created a Primary Partition, skip the next few steps.

searching for problems Image 1.10: (2KB .gif)

10) Scan Hard Drive: (Image 1.10)

The hard disk will now be scanned searching for problems.

Take note: This process may take a some time, a very long time on "large" drives.

Primary partition using all available space Image 1.11: (3KB .gif)

11) All available space? (Image 1.11)

If you wish to create the Primary partition using all available space, select "Y" at the prompt. Otherwise, choose "N" to define something smaller.

drives integrity is scanned Image 1.12: (3KB .gif)

12) Scan Hard Drive: (Image 1.12)

Again, the drives integrity is scanned.

No one ever accused fdisk of being a "speedy" solution.

Enter in the amount of space Image 1.13: (4KB .gif)

13) Enter Size in MB: (Image 1.13)

Enter in the amount of space, in MegaBytes, that you wish to use for your Primary partition.

partition information is displayed Image 1.14: (3KB .gif)

14) Updated partition information: (Image 1.14)

After choosing an amount, the partition information is displayed. Here, I choose "1000 MB" for my Primary partition.

Hit "ESC" to continue with fdisk.

A warning Image 1.15: (4KB .gif)

15) Make active partition: (Image 1.15)

A warning will appear under the main menu explaining the importance of an "active" partition. Really, this is no longer required, but for compatibility's sake, I choose to make a partition active, anyway.

Select "2" to set the active partition.

Setting the active partition Image 1.16: (4KB .gif)

16) Choose active partition: (Image 1.16)

Setting the active partition is as easy as choosing the number next to "C:." In this example, it is "1."

extended partition Image 1.17: (24KB .gif)

17) Create Extended DOS Partition: (Image 1.17)

You now can create the "extended partition" portion of the hard drive. It is subject to debate whether this step is required, but, once again, for compatibility purposes, I choose to do so.

Select "2" to Create the Extended DOS Partition.

how much space Image 1.18: (24KB .gif)

18) Choose space allocated: (Image 1.18)

Choose how much space the Extended partition is allowed to use.

Under usual circumstances, choose all. Your requirements may vary, but I have yet to find a reason "not" to choose all of the remaining space.

partition information will be displayed Image 1.19: (24KB .gif)

19) Updated partition information: (Image 1.19)

The partition information will be displayed, including your previous "Primary" and now your "Extended" partition information.

Hit "ESC" to continue.

the drive will be verified Image 1.20: (24KB .gif)

20) Scan Hard Drive: (Image 1.20)

Once again, the drive will be verified.

amount of each additional partition Image 1.21: (24KB .gif)

21) Enter Size in MB: (Image 1.21)

Choose the amount of each additional partition, up to the maximum size.

Here, I chose 2000 MB.

Partition information is displayed Image 1.22: (24KB .gif)

22) Updated partition information: (Image 1.22)

The Partition information is displayed, as well as drive integrity confirmed.

At this point, you may continue defining partitions, or exit out and define them using the setup program of a "newer" OS, like Linux, Win2k, or XP. Again, Win9x/Me does not have the option of partition creation during setup.

3 additional partitions Image 1.23: (24KB .gif)

23) Additional Partitions: (Image 1.23)

Here, I defined 3 additional partitions, not including the Primary one, taking up all of the available space.

Hit "ESC" to continue.

'a Image 1.24: (24KB .gif)

24) Reboot System: (Image 1.24)

You are prompted with a "restart" message.

This is a vital step. Ensure that you do restart the computer before continuing with the installation of any OS. I even power down the computer, but that is not necessary.


INSTALLATION PROCESS STARTS AFTER REBOOTING


Resource-Allocation Graph

Resource Allocation Graph SLIDE # 8:

In slide #9 the graph shows that the R1 is holding for the instance in P2, the P2 is requesting



for instance in R3 then R3 is holding an instances of P3. The R2 has 2 instances whis is holding



the instances of P1 and P2. Then the R4 is null.







Resource Allocation Graph SLIDE # 9:

In slide #9 the graph shows that R1 is holding for the instance in P2, the P2 is requesting


for instance in R3, then R3 is holding an instance in P3, P3 is requesting for instance is R2, then


R2 has 2 instances which is holding the instances of P1 and P2. The R4 is null.



Resource Allocation Graph SLIDE # 10:

In slide #10 the graph shows that P1 is requesting for instance in R1 which has 2 instances. The

R1 is holding the instances of P2 and P3. P3 is requesting instance from R2. R2 contains 2


instances which holding the instances of P1 and P4.



Resource Allocation Graph SLIDE # 20:

In slide #20 the graph shows that R1 is holding the instances of P1, then P1 is requesting for a

resource in R2, P2 is requesting intance for R1 and P2 is requesting for a resource in R2.

Resource Allocation Graph SLIDE # 21:

In slide #21 the graph shows that R1 is holding the instances of P1, then P1 is requesting for a resource in R2, then R2 is holding the instances of P2 and P2 is requesting instance of R1.

DEADLOCK

RESOURCE ALLOCATION GRAPH

A set of vertices V and a set of edges E.

�V is partitioned into two types:

* P = {P1, P2, …, Pn}, the set consisting of all the processes in the system.

* R = {R1, R2, …, Rm}, the set consisting of all resource types in the system.

� Request edge – directed edge P1 ® Rj

� Assignment edge – directed edge Rj ® Pi

�Process

�Resource Type with 4 instances

�Pi requests instance of Rj

�Pi is holding an instance of Rj
How would you know if there is a deadlock based on the Resource Allocator Graph?
� If graph contains a cycle :
* if only one instance per resource type, then deadlock.
* if several instances per resource type, possibility of deadlock.





DEADLOCK

DEADLOCK RECOVERY


{} Recovery from Deadlock: Process Termination {}


Abort all deadlocked processes.


Abort one process at a time until the deadlock cycle is eliminated.


In which order should we choose to abort?

* Priority of the process.

* How long process has computed, and how much longer to completion.

* Resources the process has used.

* Resources process needs to complete.F How many processes will need to be terminated.

* Is process interactive or batch?


Abort all deadlocked processes - this method clearly will break the deadlock cycle, but at a great expense, since these processes may have computed for a long time, and the results of these partial computations must be discarded, and probably must be recomputed later.


Abort one process at a time until the deadlock cycle is eliminated - this method incurs considerable overhead, since, after each process is aborted, a deadlock-detection algorithm must be invoked to determine whether any processes are still deadlock.


Minimum cost


{} Recovery from Deadlock: Resource Preemption {}


Selecting a victim – minimize cost.

Rollback – return to some safe state, restart process for that state.

Starvation – same process may always be picked as victim, include number of rollback in cost factor.




DEADLOCK

DEADLOCK DETECTION
� An algorithm that examines the state of the system to determine whether a deadlock has occurred

� An algorithm to recover from the deadlock
Allow system to enter deadlock state
Detection algorithmn
Recovery scheme

DEADLOCK

DEADLOCK PREVENTION

The case of never enter.

Restrain the ways request can be made (at least one of the necessary conditions should not be true).

Mutual Exclusion – not required for sharable resources; must hold for nonsharable resources.In general not possible to prevent deadlock by this, some resources are intrinsically non-sharable

Hold and Wait – must guarantee that whenever a process requests a resource, it does not hold any other resources.

* Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none.

* Low resource utilization; starvation possible.

No Preemption –

* If a process that is holding some resources requests another resource that cannot be immediately allocated to it,then all resources currently being held are released.

* Preempted resources are added to the list of resources for which the process is waiting.

* Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting.

Circular Wait – impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration.

DEADLOCK

METHOD FOR HANDLING DEADLOCKS
Never enter (prevention & avoidance), detect/recover, ignore…
We can use a protocol to ensure that the system will never enter a deadlock state.
We can allow the system to enter a deadlock� state and then recover
We can ignore the problem all together, and pretend that deadlocks never occur in the system.
This solution is the one used by most operating systems, including UNIX.
Deadlock prevention is a set of methods for ensuring that at least one of the necessary conditions cannot hold.
Deadlock avoidance, on the other hand, requires that the operating system be given in advance additional information concerning which resources a process will request and use during its lifetime.
Ensure that the system will never enter a deadlock state.
Allow the system to enter a deadlock state and then recover.
Ignore the problem and pretend that deadlocks never occur in the system; used by most operating systems, including UNIX.

DEADLOCK

DEADLOCK CHARACTERIZATION
Deadlock can arise if four conditions hold simultaneously.

Mutual exclusion - only one process at a time can use a (non-sharable) resource.

Hold and wait - a process holding at least one resource is waiting to acquire additional resources held by other processes.

No preemption - a resource can be released only voluntarily by the process holding it, after that process has completed its task.

Circular wait - there exists a set {P0, P1, …, P0} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn–1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0.

Thread Scheduling
• Executes separate from the rest of the process
• An application can be a set of threads that cooperate and execute concurrently in the same address space
• Threads running on separate processors yields a dramatic gain in performance
• Local Scheduling – How the threads library decides which thread to put onto an available LWP
• Global Scheduling – How the kernel decides which kernel thread to run next
Multiprocessor Scheduling
• Very little has to be done to schedule a multiprocessor system.
• Whenever a CPU needs a process to run, it takes the next task from the ready list.
• The scheduling queue must be accessed in a critical section. Busy waiting is usually used.
• Load sharing
– Processes are not assigned to a particular processor
• Gang scheduling
– A set of related threads is scheduled to run on a set of processors at the same time
• Dedicated processor assignment
– Threads are assigned to a specific processor
• Dynamic scheduling
– Number of threads can be altered during course of execution

Will consider only shared memory multiprocessor
Salient features:
One or more caches: cache affinity is important
Semaphores/locks typically implemented as spin-locks: preemption during critical sections
Central queue – queue can be a bottleneck
Distributed queue – load balancing between queue

REAL - TIME SCHEDULING

• Many real time systems run a known collection of tasks. The execution time of the tasks is frequently known ahead of time.


• Tasks have deadlines by which they must complete.


• If a task that runs for 3 time units must be done at time 10, it must start by time 7.


• If two tasks that runs for 3 time units each must be done at time 10, one must start by time 4.


Hard real-time systems – required to complete a critical taskwithin a guaranteed amount of time.


Soft real-time computing – requires that critical processesreceive priority over less fortunate ones.

Correctness of the system may depend not only on the logical result of the computation but alsoon the time when these results are produced,

example:

– Tasks attempt to control events or to react to eventsthat take place in the outside world

– These external events occur in real time andprocessing must be able to keep up

– Processing must happen in a timely fashion

• neither too late, nor too early

• EDF – Earliest Deadline First Scheduling


• Static table-driven
– Table determines at run time when a task begins execution
• Static priority-driven preemptive
– Traditional priority-driven scheduler is used
• Dynamic planning-based
– Feasibility determined at run time
• Dynamic best effort
– No feasibility analysis is performed

SUBSTANIAL INFORMATION ABOUT THREADS OF OS

WINDOWS NT’s Threads


Processes in NT can consist of one or more threads.

[] Primary thread - When a process is created, one thread is generated along with it.

This object is then scheduled on a system wide basis by the kernel to execute on a processor.
After the primary thread has started, it can create other threads that share its address space and system resources but have independent contexts, which include execution stacks and thread specific data. A thread can execute any part of a process' code, including a part currently being executed by another thread.

It is through threads, provided in the Win32 application programmer interface (API), that Windows NT allows programmers to exploit the benefits of concurrency and parallelism.

[ ] Fiber - is NT’s smallest user-level object of execution. It executes in the context of a thread and is unknown to the operating system kernel. A thread can consist of one or more fibers as determined by the application programmer. ˝Some literature ˝[1,11] assume that there is a one-to-one mapping of userlevel objects to kernel-level objects, this is inaccurate. Windows NT does ˝provide the means for many-to-many ˝scheduling. However, NT's design is poorly documented and the application programmer is responsible for the control of fibers such as allocating memory, scheduling them on threads and preemption.

Solaris’s LWPs and Threads
[ ] light weight process (LWP) - Solaris’s smallest kernel-level object of execution.

A Solaris process consists of one or more light weight processes. Like NT’s thread, each LWP shares its address space and system resources with LWPs of the same process and has its own context. However, unlike NT, Solaris allows programmers to exploit parallelism through a user-level object that is built on light weight processes.

In Solaris, a thread is the smallest user-level object of execution. Like Windows NT's fiber, they
are not executable alone.

[ ] Solaris thread
* execute in the context of a light weight process.
* implemented and controlled by a system library.
The library controls the mapping and scheduling of threads onto LWPs automatically.
[ ] mapping - determined by the library or the application programmer. Since the threads execute in the context of a light weight process, the operating system kernel is unaware of their existence.

Solaris's thread library defines two types of threads according to scheduling.

[ ] bound thread is one that permanently executes in the context of a light weight process in which no other threads can execute. Consequently, the bound thread is scheduled by the operating system kernel on a system wide basis.
[ ] unbound thread is one that can execute in the context of any LWP of the same process. Solaris uses the thread library for the scheduling of these unbound threads. The library works by creating a pool of light weight processes for any requesting process. The initial size of the pool is one. The size can be automatically adjusted by the library or can be defined by the application programmer through a programmatic interface. It ˝is the library’s task to increase or decrease the pool size to meet the requirements of an application. Consequently, the pool size determines the concurrency level (CL) of the process. The threads of a process are scheduled on a LWP in the pool, by using a priority based, first-in first-out (FIFO) algorithm. The priority is the primary algorithm and FIFO is the secondary algorithm (within the same priority). In addition, a
thread with a lower priority may be preempted from a LWP by higher priority thread or by a library call.
CPU SCHEDULING ALGORITHMS
First-Come, First Come, First-Served (FCFS) Scheduling
This non-preemptive scheduling algorithm follows the first-in, first-out (FIFO) policy. As each process becomes ready, it joins the ready queue. When the current running process finishes execution, the oldest process in the ready queue is selected to run next.
Shortest-Job Job-First (SJF) Scheduling
Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time
Two schemes:
􀁺 nonpreemptive –once CPU given to the process it cannot be preempted until completes its CPU burst
􀁺 preemptive –if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as theShortest-Remaining-Time-First (SRTF)
SJF is optimal –gives minimum average waiting time for a given set of processes
Round Robin (RR)
􀂄 Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.
􀂄 RR is designed specially for time-sharing systems.
􀂄 A small unit of time, called a time quantum or time slice, is defined.
􀂄 The ready queue is treated as a circular queue. The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum.
􀂄 If there are nprocesses in the ready queue and the time quantum is q, then each process gets 1/nof the CPU time in chunks of at most qtime units at once. No process waits more than (n-1)q time units.
􀂄 Performance
􀁺 qlarge
⇒ FIFO
􀁺 q small
⇒ q must be large with respect to context switch, otherwise overhead is too high
Shortest Remaining Time (SRT)
This preemptive scheduling algorithm favors processes with the shortest remaining expected process time. As each process becomes ready, it joins the ready queue. This triggers an interrupt which preempts the current running process back into the ready queue. The process in the ready queue with the shortest remaining service time is selected to run next.
THREAD LIBRARY

[ ] Thread Library schedules user-level threads to run on LWP
[ ] Thread management done by user-level Threads Library
[ ] The Thread Library is responsible for scheduling user threads on the available schedulable entities; this makes context switching of threads very fast, as it avoids system calls. However, this increases complexity and the likelihood of priority inversion, as well as suboptimal scheduling without extensive (and expensive) coordination between the userland scheduler and the kernel scheduler.
Multi - threading Models





Many-to-One Model



[ ]Many user-level threads mapped to single kernel thread





* Thread management is done in user space




* Blocking problem




* No support for running in parallel on MP




* Used on systems that do not support kernel threads.




* Green-threads library in Solaris 2





One-to-One Model
[ ]Each user-level thread maps to a kernel thread


* Creating a user thread requires creating the corresponding kernel thread


* Overhead


* Restrict the number of threads supported by the OS


•Examples


* Windows NT/2000


* OS/2

Many-to-Many Model

[ ] Multiplex many user-level threads to a smaller or equal number of kernel threads

[ ] Allows many user level threads to be mapped to many kernel threads.

[ ] Allows OS to create a sufficient number of kernel threads.

•Examples

* Solaris 2, IRIX, HP-UX, Tru64 UNIX

* Windows NT/2000 with the ThreadFiber package


Kernel Thread
[ ] Kernel maintains context information for the process and the threads
[ ] Supported by the Kernel
[ ] Slower to create and manage threads than are user threads
[ ] If a thread performs a blocking system call, then the kernel can schedule another thread in the application for execution.
[ ] Multiple threads are able to run in parallel on multiprocessors.
[ ] Scheduling is done on a thread basis
[ ] Slower to create and manage
[ ] If a thread performs a blocking system call, the kernel can schedule another thread in the application for execution
[ ] Can take advantage of a multi-processor environment
Examples
{}Windows 95/98/NT/2000
{}Solaris
{}Tru64 UNIX
{}BeOS
{}Linux

Thread

[ ] Lightweight process (LW)

[ ] Basic unit of CPU utilization

[ ] A thread comprises a thread ID, a program counter, a register set, and a stack

[ ] A thread shares with other threads belonging to the same process its code section, data section, and other OS resources, such as open files and signals

[ ] A process with multiple threads can do more than one task at a time

Single-Threaded Process

Single threaded programs have one path of execution, and multi-threaded programs have two or more paths of execution. Single threaded programs can perform only one task at a time, and have to finish each task in sequence before they can start another. For most programs, one thread of execution is all you need, but sometimes it makes sense to use multiple threads in a program to accomplish multiple simultaneous tasks.

Multi-Threaded Process

Multithreading as a widespread programming and execution model allows multiple threads to exist within the context of a single process. These threads share the process' resources but are able to execute independently. The threaded programming model provides developers with a useful abstraction of concurrent execution. However, perhaps the most interesting application of the technology is when it is applied to a single process to enable parallel execution on a multiprocessor system.

Multithreading computers have hardware support to efficiently execute multiple threads. These are distinguished from multiprocessing systems (such as multi-core systems) in that the threads have to share the resources of single core: the computing units, the CPU caches and the translation lookaside buffer(TLB). Where multiprocessing systems include multiple complete processing units, multithreading aims to increase utilization of a single core by leveraging thread-level as well as instruction-level parallelism. As the two techniques are complementary, they are sometimes combined in systems with multiple multithreading CPUs and in CPUs with multiple multithreading cores.

User Threads
[ ] Thread management done by user-level threads library
[ ] No support from the kernel (The kernel is not aware of the existence of threads)
[ ] Fast to create and manage
[ ] Block all threads for a blocking system call if the kernel is single threaded
[ ] Cannot take advantage of multi-processors
 Three primary thread libraries:
 POSIX Pthreads
 Win32 threads
 Java threads

BENEFITS OF MULTITHREADED PROGRAMMING

BENEFITS

 Responsiveness

 Resource Sharing

 Economy

 Utilization of MP Architectures

INTERPROCESS COMMUNICATION
- - -is a set of techniques for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC techniques are divided into methods for message passing, synchronization, shared memory, and remote procedure calls (RPC). The method of IPC used may vary based on the bandwidth and latency of communication between the threads, and the type of data being communicated. - - -
DIRECT COMMUNICATION
[ ] Sender/receiver refer to each other, as seen before
[ ] Properties of communication link
Link is established automatically between communicating processes
Link is associated with exactly two processes
Exactly one link for every pair of processes
[ ] Communication is symmetric (above) or asymmetric
send(P,m) // send a message to P
receive(&id, m) // receive from any process, set id to sender
INDIRECT COMMUNICATION


[ ] Communication via mailboxes (or ports)

[ ] Processes communicate by putting and taking messages in/from mailboxes

send(A, m) and receive(A,m)

[ ] Properties of communication link

A link is established between two processes, if they share a mailbox
Link maybe associated with more than two processes
A number of different links may exist between any pair of processes; each one a separate mailbox


SYNCHRONIZATION

- - - is timekeeping which requires the coordination of events to operate a system in unison. The familiar conductor of an orchestra serves to keep the orchestra in time. Systems operating with all their parts in synchrony are said to be synchronous or in sync. Some systems may be only approximately synchronized, or plesiochronous. For some applications relative offsets between events need to be determined, for others only the order of the event is important. - - -


[ ] BLOCKING SEND – sender blocked until message is received by receiver (or by mailbox)

[ ] NON - BLOCKING SEND – sending process resumes operation right after sending

[ ] BLOCKING RECEIVE – receiver blocks until message is available

[ ] NON - BLOCKING RECEIVE – receiver retrieves a valid message or returns an error code


BUFFERING

[ ] Zero capacity – queue has length 0, no messages can be outstanding on link, sender blocks for
message exchange

[ ] Bounded capacity – queue has length N, N messages can be in queue at any point in time, sender blocks if queue is full, otherwise it may continue to execute

[ ] Unbounded capacity – queue has infinite length, sender never blocks


PRODUCER COUNTER EXAMPLE


[ ] PRODUCER – generates an integer between 0 and 9 (inclusive), then stores it in a CubbyHole object. To make the synchronization problem more interesting, the Producer sleeps for a random amount of time between 0 and 100 milliseconds before repeating the number generating cycle.

[ ] CONSUMER – consumes all integers from the CubbyHole (the exact same object into which the Producer put the integers in the first place) as quickly as they become available.
Interprocess Communication (IPC)
[ ] Mechanism for processes to communicate and to synchronize their actions.
[ ] Message system – processes communicate with each other without resorting to shared variables.
[ ] IPC facility provides two operations:
* send(message) –message size fixed or variable
* receive(message)
[ ] If P and Q wish to communicate, they need to:
* establish a communication link between them
* exchange messages via send/receive
[ ] Implementation of communication link
* physical (e.g., shared memory, hardware bus) considered later
* logical (e.g., logical properties) now
Cooperating Processes
[ ] Independent process cannot affect or be affected by the execution of another process.
[ ] Cooperating process can affect or be affected by the execution of another process
[ ] Advantages of process cooperation:
* Information sharing
* Computation speed-up
* Modularity
* Convenience
Operations on Processes

Process Creation

[ ] Parent process creates children processes, which, in turn create other processes, forming a tree of processes.
* Resource sharing
[ ] Parent and children share all resources.
[ ] Children share subset of parent’s resources.
[ ] Parent and child share no resources.
* Execution
* Parent and children execute concurrently.
* Parent waits until children terminate.
[ ] Address space
* Child duplicate of parent.
* Child has a program loaded into it.
[ ] UNIX examples
* fork system call creates new process
* fork returns 0 to child , process id of child for parent
* exec system call used after a fork to replace the process’ memory space with a new program.



Process Termination

[ ] Process executes last statement and asks the operating system to delete it (exit).
* Output data from child to parent (via wait).
* Process’ resources are deallocated by operating system.
[ ] Parent may terminate execution of children processes (abort).
* Child has exceeded allocated resources.
* Task assigned to child is no longer required.
* Parent is exiting.
= Operating system does not allow child to continue if its parent terminates.
= Cascading termination.
* In Unix, if parent exits children are assigned init as parent
Process Scheduling


Scheduling Queue

[ ] The operating System must allocate resources to processes, enable processes to share and exchange information, protect the resources of each process from other processes and enable synchronization amongst process.

[ ] Job queue – set of all processes in the system.

[ ] Ready queue – set of all processes residing in main memory, ready and waiting to execute.

[ ] Device queues – set of processes waiting for an I/O device.

[ ] Processes migrate between the various queues.


Schedulers

[ ] Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue.

[ ] Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU.

[ ] Short-term scheduler is invoked very frequently (milliseconds) fi (must be fast).

[ ] Long-term scheduler is invoked very infrequently (seconds, minutes) fi (may be slow).

[ ] The long-term scheduler controls the degree of multiprogramming.

[ ] Processes can be described as either:

* I/O-bound process – spends more time doing I/O than computations, many short CPU bursts.

* CPU-bound process – spends more time doing computations; few very long CPU bursts.


Context Switch

[ ] When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process.

[ ] Context-switch time is overhead; the system does no useful work while switching.

[ ] Time dependent on hardware support.
The Concept of Process


[ ] An operating system executes a variety of programs


* Batch system – jobs
* Time-shared systems – user programs or tasks



[ ] Textbook uses the terms job and process almost interchangeably.

[ ] Process – a program in execution; process execution must progress in sequential fashion.

[ ] A process includes:


* program counter
* stack
* data section




Process State

[ ] As a process executes, it changes state

* new: The process is being created.
* running: Instructions are being executed.
* waiting: The process is waiting for some event to occur.
* ready: The process is waiting to be assigned to a processor

* terminated: The process has finished execution.



Diagram of Process State




Process Control Block (PCB)

Information associated with each process.

[ ] Process ID
[ ] Process state
[ ] Program counter

[ ] CPU registers
[ ] CPU scheduling information
[ ] Memory-management information

[ ] Accounting information
[ ] I/O status information



Process Control Block (PCB) :

Threads

[ ] Results from a fork of a computer program into two or more concurrently running tasks.

[ ] The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process.

[ ] Multiple threads can exist within the same process and share resources such as memory, while different processes do not share these resources.


System Generation

A process that creates a particular and uniquely specified operating system; it combines user-specified options and parameters with manufacturer-supplied general-purpose or nonspecialized program subsections to produce an operating system (or other complex software) of the desired form and capacity. Abbreviated sysgen.
System Boot

Operating system must be made available to hardware so hardware can start it

  • Small piece of code – bootstrap loader, locates the kernel, loads it into memory, and starts it
  • Sometimes two-step process where boot block at fixed location loads bootstrap loader
  • When power initialized on system, execution starts at a fixed memory location
  • Firmware used to hold initial boot code
  • Virtual Machine

    - Is a software implementation of a machine (computer) that executes programs like a real machine.

    - Provides a complete system platform which supports the execution of a complete operating system (OS).

    - Takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware.

    IMPLEMENTATION

    - Modes:
  • virtual user mode and virtual monitor mode,
  • Actual user mode and actual monitor mode
    -Time
  • Whereas the real I/O might have taken 100 milliseconds, the virtual I/O might take less time (because it is spooled) or more time (because it is interpreted.)
  • The CPU is being multi-programmed among many virtual machines, further slowing down the virtual machines in unpredictable ways.

    BENEFITS

    - concept provides complete protection of system resources since each virtual machine is isolated from all other virtual machines.

    - perfect vehicle for operating-systems research and development. System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation.

    - multiple OS environments can co-exist on the same computer, in strong isolation from each other

    - the virtual machine can provide an instruction set architecture (ISA) that is somewhat different from that of the real machine

    - application provisioning, maintenance, high availability and disaster recovery

    EXAMPLE

    - A program written in Java receives services from the Java Runtime Environment (JRE) software by issuing commands to, and receiving the expected results from, the Java software. By providing these services to the program, the Java software is acting as a "virtual machine", taking the place of the operating system or hardware for which the program would ordinarily be tailored.

System Structure

Simple Structure

– any part of the system may use the functionality of the rest of
the system
– MS-DOS (user programs can call low level I/O routines)

Layered Approach

– layer n can only see the functionality that layer n-1 exports
– provides good abstraction from the lower level details
• new hardware can be added if it provides the interface required of a particular layer
– system call interface is an example of layering
– can be slow if there are too many layers
System Calls

Provide the interface between application programs and the kernel
Are like procedure calls

take parameters
calling routine waits for response
Permit application programs to access protected resources

Process Control

– create/terminate a process (including self)

File Management

– open, create
– read, write
close, delete
get or set file attributes

Also referred to as simply a file system or filesystem. The system that an operating system or program uses to organize and keep track of files. For example, a hierarchical file system is one that uses directories to organize files into a tree structure.

Although the operating system provides its own file management system, you can buy separate file management systems. These systems interact smoothly with the operating system but provide more features, such as improved backup procedures and stricter file protection.

Device Management

Device Management is a set of technologies, protocols and standards used to allow the remote management of mobile devices, often involving updates of firmware over the air (FOTA). The network operator, handset OEM or in some cases even the end-user (usually via a web portal) can use Device Management, also known as Mobile Device Management, or MDM, to update the handset firmware/OS, install applications and fix bugs, all over the air. Thus, large numbers of devices can be managed with single commands and the end-user is freed from the requirement to take the phone to a shop or service center to refresh or update.

Information Maintenance

get time
set system data (OS parameters)
get process information (id, time used)
Operating System Services


- Program execution – system capability to load a program into memory and to run it.

- I/O operations - since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O.

- File-system manipulation – program capability to read, write, create, and delete files.

- Communications – exchange of information between processes executing either on the same computer or on different systems tied together by a network. Implemented via shared memory or message passing.

- Error detection – ensure correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs.

OPERATING SYSTEM STRUCTURE

SYSTEM COMPONENTS


Operating Systems Process management

- In operating systems, process is defined as “A program in execution” [10]. Process can be
considered as an entity that consists of a number of elements, including: identifier, state, priority, program counter, memory pointer, context data, and I/O request. The above information about a process is usually stored in a data structure, typically called process block. Figure 1 shows a simplified process block [10]. Because process management involves scheduling (CPU scheduling, I/O scheduling, and so on), state switching, and resource management, process block is one of the most commonly accessed data type in operating system. Its design directly affects the efficiency of the operating system. As a result, in most operating systems, there is a data object that contains information about all the current active processes. It is called process controller. Figure 2 shows the structure of a process controller [10], which is implemented as a linked-list of process blocks. In order to achieve high efficiency, process controller is usually implemented as a global variable that can be accessed by both the kernel modules and nonkernel modules. For example, any time a new process (task) is created, the module that created this process should be able to access the process controller to add this new process. Therefore, process controller – the data object that controls the current active process – is usually implemented as a category-5 global variable. This means, both the kernel modules and nonkernel modules can access process controller to change its fields and these changes can affect the uses of process controller in kernel modules.
Main Memory Management
- the act of managing computer memory. In its simpler forms, this involves providing ways to allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. The management of main memory is critical to the computer system.
- tricky compromise between performance (access time) and quantity (available space). We always seek the maximum available memory space but we are rarely prepared to compromise on performance. Memory management must also perform the following functions:
> allow memory sharing (for a multi-threaded system);
> allocate blocks of memory space for different tasks;
> protect the memory spaces used (e.g. prevent a user from changing a task performed by another user);
> optimise the quantity of available memory, specifically via memory expansion systems.

File Management
- A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data.
- The operating system is responsible for the following activities in connections with file management:

> File creation and deletion.
> Directory creation and deletion.
> Support of primitives for manipulating files and directories.
> Mapping files onto secondary storage.
> File backup on stable (nonvolatile) storage media.
INPUT / OUTPUT SYSTEM MANAGEMENT
- The I/O system consists of:
> A buffer-caching system
> A general device-driver interface
> Drivers for specific hardware devices
Secondary Storage System
- Main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory.
- Modern computer systems use disks as the principle on-line storage medium, for both programs and data.
- The operating system is responsible for the following activities in connection with disk management:
> Free space management
> Storage allocation
> Disk scheduling
Protection System
- A mechanism for controlling access by programs, processes, or users to both system and user resources.

- The protection mechanism must:

> distinguish between authorized and unauthorized usage.
> specify the controls to be imposed.
> provide a means of enforcement.

Command Interpreter System

- Many commands are given to the operating system by control statements which deal with:

>process creation and management

>I/O handling
>secondary-storage management
>main-memory management
>file-system access
>protection
>networking