Friday, February 26, 2010

Ethical Behavior with regards to Computer Usage

When we talk of computer usage there are things we should consider especially ethical behavior.Ethical issues nowadays which is related to information system are important to the IT technology professionals.
“Computer ethics” has been used to refer to a kind of professional ethics in which computer professionals apply codes of ethics and standards of good practice within their profession.
Where did our ethical principles came from? It comes from metaphysical issues, psychological issues, linguistic issues. Then the concept of normative ethics arrive at moral standards that regulate right and wrong conduct. Afterwards is the applied ethics this ethics is taking specific controversial issues, use normative ethics (and metaethics)to try to resolve the controversy.
These are examples in Computer Ethics the Computer in the workplace, computer Crime, Privacy and Anonymity, Intellectual Property,Professional Responsibility, Globalization and the Metaethics of Computer Ethics.
When we talk of "computer" it is said to be the universal tool nowadays and because of this problem regarding computer in the workplace. Workplace issue concerns health and safety. When information technology is introduced into a workplace, it is important to consider likely impacts upon health and job satisfaction of workers who will use it. It is possible, for example, that such workers will feel stressed trying to keep up with high-speed computerized devices — or they may be injured by repeating the same physical movement over and over — or their health may be threatened by radiation emanating from computer monitors. These are just a few of the social and ethical issues that arise when information technology is introduced into the workplace.
Second one is the Computer Crimes specifically the viruses and hackers.The problem The problem is not so much the physical security of the hardware (protecting it from theft, fire, flood, etc.), but rather “logical security”.There five aspects privacy and confidentiality,integrity,unimpaired service, consistency, controlling access to resources. Some computer crimes, such as embezzlement or planting of logic bombs, are normally committed by trusted personnel who have permission to use the computer system. Computer security, therefore, must also be concerned with the actions of trusted computer users.
One of the more controversial areas of computer ethics concerns the intellectual property rights connected with software ownership. Ownership is a complex matter, since there are several different aspects of software that can be owned and three different types of ownership: copyrights, trade secrets, and patents. With regards with this issue we should use the referencing method to avoid intellectual property issues.
Computer professionals have specialized knowledge and often have positions with authority and respect in the community. For this reason, they are able to have a significant impact upon the world, including many of the things that people value. These relationships involve a diversity of interests, and sometimes these interests can come into conflict with each other. Responsible computer professionals, therefore, will be aware of possible conflicts of interest and try to avoid them. this also one of the problem nowadays.
Computer ethics today is rapidly evolving into a broader and even more important field, which might reasonably be called “global information ethics”. Global networks like the Internet and especially the world-wide-web are connecting people all over the earth. This may very well be one of the most important social developments in history. The global laws, Global Cyberbusiness and Global Education.
The issues which I've mentioned are the reasons why we need to practice the different ethical behavior to avoid such problem. Because it minimizes the problems in Computer Usage.

Friday, February 5, 2010

Exercise (Feb. 06, 2010)

Deadlocks

Case 1: Deadlocks on File Request

Example:


- if jobs can request and hold files for duration of their execution, deadlock can occur.

-Any other programs that require F1 or F2 are put on hold as long as this situation continues.

-Deadlock remains until a programs is withdrawn or forcibly removed and its file is released.

Case 2: Deadlocks in Database

Example:
1. P1 accesses R1 and locks it.

2. P2 accesses R2 and locks it.

3. P1 requests R2, which is locked by P2.

4. P2 requests R1, which is locked by P1.

-Deadlock can occur if 2 processes access & lock records in database.

-3 different levels of locking :
entire database for duration of request
a subsection of the database
individual record until process is completed.

-If don’t use locks, can lead to a race condition.

Case 3: Deadlocks in Dedicated Device Allocation

Example:
1. P1 requests tape drive 1 and gets it.

2. P2 requests tape drive 2 and gets it.

3. P1 requests tape drive 2 but is blocked.

4. P2 requests tape drive 1 but is blocked.

-Deadlock can occur when there is a limited number of dedicated devices.

-examples are printers, plotters or tape drives.

Case 4: Deadlocks in Multiple Device Allocation

Example:


-Deadlocks can happen when several processes request, and hold on to, dedicated devices while other processes act in a similar manner.

Case 5: Deadlocks in Spooling

-Most systems have transformed dedicated devices such as a printer into a sharable device by installing a high-speed device, a disk, between it and the CPU.
-Disk accepts output from several users and acts as a temporary storage area for all output until printer is ready to accept it (spooling).
-If printer needs all of a job's output before it will begin printing, but spooling system fills available disk space with only partially completed output, then a deadlock can occur.

Case 6: Deadlocks in a Network

Example:


-Disks are designed to be shared, so it’s not uncommon for 2 processes access different areas of same disk.
-Without controls to regulate use of disk drive, competing processes could send conflicting commands and deadlock the system.

Case 7: Deadlocks in Disk Sharing

Example:


-A network that’s congested (or filled large % of its I/O buffer space) can become deadlocked if it doesn’t have protocols to control flow of messages through network.

Friday, January 15, 2010

process scheduling algorithm

1. Arrival time: 0 1 2 3 4 5 6 7 8 9 10

       Job Name: A B C D F G H I J K

   CPU CYCLE: 5 2 8 4 3 1 2 9 7 3 4

FCFS

A

B

C

D

E

F

G

H

I

J

K

0-5

7

15

19

22

23

25

34

41

44

48

                      

ATT= 5+7+15+19+22+23+25+34+41+44+48

                                         11

              ATT= 25.73 ms

SJF

F

B

G

E

J

D

K

A

I

C

H

0-1

3

5

8

11

15

19

24

31

39

48

 

                ATT= 1+3+5+8+11+15+19+24+31+39+48

                                                                11

              ATT= 18.55ms 

SRT

A

B

C

D

F

G

E

H

I

J

A

0-1

3

4

8

9

11

13

14

15

18

22

 

K

I

C

H

26

32

39

47

 

                ATT= 22+2+2+5+9+5+5+40+24+9+16

                                                                11

              ATT= 12.64ms 

Round-Robin

A

B

C

D

E

F

G

H

I

J

K

0-2

4

6

8

10

11

13

15

17

19

21

 

A

C

D

E

H

I

J

K

A

C

H

23

25

27

28

30

32

33

35

36

38

40

 

I

C

H

I

H

42

44

46

47

48

 

                ATT= 36+3+42+24+24+6+7+41+39+24+25

                                                                11

              ATT= 24.64ms 



Friday, January 8, 2010

Prelim Examination

I.Concept Question

  1.  Name the five key concepts about an operating system that you thinks a user needs to know and understand.
  • there are  5 key concepts about an operating system that user should know and understand.Users would be greatly benefited by an understanding of these main properties of operating systems:

             1. User Command Interface or GUI
                This is the interface from which the user issues commands to the operating system.                        Also called the “shell” (container inside which the entire user interface is presented),                    this is the visible interface with which users interact. 


            2. Device Manager
                This component monitors all devices, channels, and control units. The Device Manager                     must select the most efficient method for allocation of a system's devices, printers,                          terminals, disk drives, and other hardware. 


            3. Processor Manager
               This component is responsible for allocating the central processing unit (CPU). The                           status of each process must be tracked, and the Processor Manager handles matters                       such as process prioritize and multi-threading. The tasks of the Processor Manager                   can be divided into two main categories: accepting or rejecting incoming jobs (handled                   by the Job Scheduler) and determining which process is given access to the CPU and for                  how long (handled by the Process Scheduler).
 
            4. Memory Manager
            This component controls main memory. It evaluates the validity of each memory request,             and allocates memory space (as needed and available). For multi-user systems, the                        Memory Manager maintains a log of what memory resources are in use by which users.                  When items stored in main memory are no longer needed, the Memory Manager handles              memory deallocation.

           5. File Manager
           This component tracks every file in the system. These files include data files, assemblers,             compilers, and applications. The File Manager can use predetermined access policies to                enforce restrictions on file access. It also handles all other file permissions. The File                         Manager allocates file resources by opening a particular file and deallocates resources by                closing the file.

2. List three tangible (physical) resources of a computer system and explain how it works.

  • Printer

    Printers are still accessories, for now at least. They perform a process, transferring information onto paper, that is truly external to the other functions of the computer. On a home computer, the printer is usually wired directly to the computer, but it is common to find printers in businesses where the printer is off away from the computer and performing printing operations for several computers, rather than just one.
  • Monitor

    The monitor is the part that looks a lot like a TV set. You look at it and see pictures and words. When you type things on the keyboard, the letters and numbers show up on the monitor, or at least you hope they will. The monitor is also called the Display Monitor, or just the Display, or sometimes the Video Display, or maybe just The Screen. The important thing to know about the monitor is that it is not really the computer, it's just the part that makes pictures for you to see. 
  • Random Access Memory, RAM, also known as main memory or system memory, is a term commonly used to describe the memory within a computer. It is consider as primary storage device, it is where data are being stored.

3.Explain the following:

         a. Internal fragmentation occurs when storage is allocated without ever intending to use it.This space is wasted. While this seems foolish, it is often accepted in return for increased efficiency or simplicity. The term "internal" refers to the fact that the unusable storage is inside the allocated region but is not being used.

For example, in many file systems, each file always starts at the beginning of a cluster, because this simplifies organization and makes it easier to grow files. Any space left over between the last byte of the file and the first byte of the next cluster is a form of internal fragmentation called file slack or slack space.

          b. External fragmentation is the phenomenon in which free storage becomes divided into many small pieces over time. It is a weakness of certain storage allocation algorithms, occurring when an application allocates and deallocates ("frees") regions of storage of varying sizes, and the allocation algorithm responds by leaving the allocated and deallocated regions interspersed. The result is that although free storage is available, it is effectively unusable because it is divided into pieces that are too small to satisfy the demands of the application. The term "external" refers to the fact that the unusable storage is outside the allocated regions.

For example, in dynamic memory allocation, a block of 1000 bytes might be requested, but the largest contiguous block of free space has only 300 bytes. Even if there are ten blocks of 300 bytes of free space, separated by allocated regions, one still cannot allocate the requested block of 1000 bytes, and the allocation request will fail.

External fragmentation also occurs in file systems as many files of different sizes are created, change size, and are deleted. The effect is even worse if a file which is divided into many small pieces is deleted, because this leaves similarly small regions of free spaces.

          c. Compaction is a process in which empty blocks or wasted memory are being gathered to make it one block of memory large enough to accommodate jobs that are waiting to be process. Compaction attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes. 

4. Cache memory how it works?

  • Cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM. As the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory.

5.Which is the fastest cache's L1,L2 or L3?Why?

  •  L1 cache is special,very fast memory built into the central processing unit (CPU) to help facilitate computer performance.By loading frequently used bits of data into L1 cache, the computer can process requests faster. Most computers also have L2 and L3 cache, which are slower than L1 cache but faster than Random Access Memory (RAM).

II. Memory Utilization Problem

  1. Given the following information:

Table 1A

Job Number

Memory Requested

J1

700KB

J2

500KB

J3

740KB

J4

850KB

J5

610KB

a. Use the best-fit algorithm to allocate the memory blocks to the five arriving jobs.

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

J1

700KB

BUSY

NONE

1003

720KB

J2

500KB

BUSY

220KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

FREE

1755

610KB

J5

610KB

BUSY

NONE

 *J4-IDLE

b. Use the first-fit algorithm to allocate the memory blocks to the five arriving jobs.

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

J1

700KB

BUSY

NONE

1003

720KB

J5

500KB

BUSY

220KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

J5

610KB

BUSY

140KB

1755

610KB

FREE

 *J4-IDLE

C. Use the next-fit algorithm to allocate the memory blocks to the five arriving jobs.

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

FREE

1003

720KB

J5

610KB

BUSY

110KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

J1

700KB

BUSY

50KB

1755

610KB

J2

500KB

BUSY

110KB

*J4-IDLE

d. Use the worst-fit algorithm to allocate the memory blocks to the five arriving jobs.

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

J2

500KB

BUSY

200KB

1003

720KB

J5

610KB

BUSY

110KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

J1

700KB

BUSY

50KB

1755

610KB

FREE

 *J4-IDLE

2. Given the following information:

Table 2A.

Job Number

Memory Requested

J1

30KB

J2

50KB

J3

30KB

J4

25KB

J5

35KB

A.fixed partition

ORIGINAL STATE


OF MAIN MEMORY



100KB
25KB
25KB
50KB
30KB

 

AFTER JOB ENTRY

J1


(P1)

J4


(P2)


J3


(P3)


J2


(P4)


30KB



*J5-IDLE

B. Dynamic Partition


NOT INCLUDED




Original State of Main Memory




J1

30KB


J2

50KB



J3

30KB





J5

35KB




initial job entry memory allocation

Original State of Main Memory



J1

30KB



J6

45KB



J5

35KB





after job 2, job 3 and job 4 have finished

Original State of Main Memory

J1

30KB

J7

45KB

J5

35KB

after job 7 have entered and job 6 is waiting

*J6-IDLE

3. Illustrate and find the page number with the displacement of a given program line:          

  •  page size divided by the line number to be located

                                                       200/542=2(quotient)

                                                                          142(remainder)

  •  the quotient (2) is the page number, and the remainder (142) is the displacement. So the line is located on Page 2, 143 lines (Line 142) from the top of the page.