Computer hardware is the collection of all the parts you can physically touch. Computer software, on the other hand, is not something you can touch. Software is a set of instructions for a computer to perform specific operations. You need both hardware and software for a. The main difference between hardware and software is that hardware is a physical device something you can touch and see, unlike software cannot be touched or seen.
Software is a set of instructions installed on the computer. Monitors, keyboards and printer are examples of computer hardware. It is important to monitor a software firewall once installed and to download any updates available from the developer.
The differences between a software and hardware firewall are vast, and the best protection for your computer and network is to use both, as each offers different but much-needed security features and benefits. Computer hardware is any physical device used in or with your machine, whereas software is a collection of programming code installed on your computer's hard drive. In other words, hardware is something you can hold in your hand, whereas software cannot be held in your hand.
Short term scheduler is faster than long term scheduler. Medium Term Scheduler Medium term scheduling is part of the swapping. It removes the processes from the memory. It reduces the degree of multiprogramming. The medium term scheduler is in-charge of handling the swapped out-processes. Suspended processes cannot make any progress towards completion. In this condition, to remove the process from memory and make space for other process, the suspended process is moved to the secondary storage.
This process is called swapping, and the process is said to be swapped out or rolled out. Swapping may be necessary to improve the process mix. It controls the degree of It provides lesser control multiprogramming over degree of It reduces the degree of 3 multiprogramming multiprogramming.
It is almost absent or It is also minimal in time It is a part of Time sharing 4 minimal in time sharing sharing system systems. A context switch is the mechanism to store and restore the state or context of a CPU in Process Control block so that a process execution can be resumed from the same point at a later time. Using this technique a context switcher enables multiple processes to share a single CPU.
Context switching is an essential part of a multitasking operating system features. When the scheduler switches the CPU from executing one process to execute another, the context switcher saves the content of all processor registers for the process being removed from the CPU, in its process descriptor.
The context of a process is represented in the process control block of a process. Context switch time is pure overhead. Context switching can significantly affect performance as modern computers have a lot of general and status registers to be saved. Content switching times are highly dependent on hardware support. Context switching Some hardware systems employ two or more sets of processor registers to reduce the amount of context switching time. When the process is switched, the following information is stored.
Process with highest priority is to be executed first and so on. Process is preempted and other process executes for given time period. Dining Philosophers Problem The scenario involves five philosophers sitting at a round table with a bowl of food and five chopsticks. Each chopstick sits between two adjacent philosophers.
The philosophers are allowed to think and eat. Since two chopsticks are required for each philosopher to eat, and only five chopsticks exist at the table, no two adjacent philosophers may be eating at the same time. A scheduling problem arises as to who gets to eat at what time.
This problem is similar to the problem of scheduling processes that require a limited number of resources Problems The problem was designed to illustrate the challenges of avoiding deadlock, a system state in which no progress is possible. This attempted solution fails because it allows the system to reach a deadlock state, in which no progress is possible. This is a state in which each philosopher has picked up the fork to the left, and is waiting for the fork to the right to become available.
What is Thread? A thread is a flow of execution through the process code, with its own program counter, system registers and stack. A thread is also called a light weight process. Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving performance of operating system by reducing the overhead thread is equivalent to a classical process. Each thread belongs to exactly one process and no thread can exist outside a process.
Each thread represents a separate flow of control. Threads have been successfully used in implementing network servers and web server. They also provide a suitable foundation for parallel execution of applications on shared memory multiprocessors. Following figure shows the working of the single and multithreaded processes.
Process Thread Process is heavy weight or Thread is light weight taking lesser 1 resource intensive. Process switching needs Thread switching does not need to 1 interaction with operating system. In multiple processing environments each process All threads can share same set of open 1 executes the same code but has its files, child processes. If one process is blocked then no While one thread is blocked and other process can execute until the waiting, second thread in the same task 1 first process is unblocked.
Multiple processes without using Multiple threaded processes use 1 threads use more resources. In multiple processes each process One thread can read, write or change 1 operates independently of the another thread's data.
The thread library contains code for creating and destroying threads, for passing message and data between threads, for scheduling thread execution and for saving and restoring thread contexts. The application begins with a single thread and begins running in that thread. Kernel Level Threads In this case, thread management done by the Kernel. There is no thread management code in the application area.
Kernel threads are supported directly by the operating system. Any application can be programmed to be multithreaded. All of the threads within an application are supported within a single process. Scheduling by the Kernel is done on a thread basis. The Kernel performs thread creation, scheduling and management in Kernel space. Kernel threads are generally slower to create and manage than the user threads. Some operating system provides a combined user level thread and Kernel level thread facility.
Solaris is a good example of this combined approach. Many to Many Model In this model, many user level threads multiplexes to the Kernel thread of smaller or equal numbers. The number of Kernel threads may be specific to either a particular application or a particular machine. Many to One Model Many to one model maps many user level threads to one Kernel level thread.
Thread management is done in user space. When thread makes a blocking system call, the entire process will be blocks. Only one thread can access the Kernel at a time, so multiple threads are unable to run in parallel on multiprocessors.
If the user level thread libraries are implemented in the operating system in such a way that system does not support them then Kernel threads use the many to one relationship modes. One to One Model There is one to one relationship of user level thread to the kernel level thread. This model provides more concurrency than the many to one model. It also another thread to run when a thread makes a blocking system call. It support multiple thread to execute in parallel on microprocessors.
Disadvantage of this model is that creating user thread requires the corresponding Kernel thread. Implementation is by a thread Operating system supports creation of 2 library at the user level. Kernel threads. User level thread is generic and Kernel level thread is specific to the 3 can run on any operating system.
Multi-threaded application cannot Kernel routines themselves can 4 take advantage of multiprocessing.
Race Condition? A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly. A race condition occurs when two threads access a shared variable at the same time.
The first thread reads the variable, and the second thread reads the same value from the variable. Then the first thread and second thread perform their operations on the value, and they race to see which thread can write the value last to the shared variable. The value of the thread that writes its value last is preserved, because the thread is writing over the value that the previous thread wrote. Memory management is the functionality of an operating system which handles or manages primary memory.
Memory management keeps track of each and every memory location either it is allocated to some process or it is free. It checks how much memory is to be allocated to processes. It decides which process will get memory at what time.
It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status. Memory management provides protection by using two registers, a base register and a limit register.
The base register holds the smallest legal physical memory address and the limit register specifies the size of the range. For example, if the base register holds and the limit register is , then the program can legally access all addresses from through All routines are kept on disk in a re-locatable load format. The main program is loaded into memory and is executed. Other routines methods or modules are loaded on request. Dynamic loading makes better memory space utilization and unused routines are never loaded.
Operating system can link system level libraries to a program. When it combines the libraries at load time, the linking is called static linking and when this linking is done at the time of execution, it is called as dynamic linking.
In static linking, libraries linked at compile time, so program code size becomes bigger whereas in dynamic linking libraries linked at execution time so program code size remains smaller. Swapping Swapping is a mechanism in which a process can be swapped temporarily out of main memory to a backing store, and then brought back into memory for continued execution. Backing store is a usually a hard disk drive or any other secondary storage which fast in access and large enough to accommodate copies of all memory images for all users.
It must be capable of providing direct access to these memory images. Operating system uses the following memory allocation mechanism. N Memory Description. Allocation In this type of allocation, relocation-register scheme is used to protect Single-partition user processes from each other, and from changing operating-system allocation code and data. Relocation register contains value of smallest physical 1 address whereas limit register contains range of logical addresses.
Each logical address must be less than the limit register. In this type of allocation, main memory is divided into a number of Multiple- fixed-sized partitions where each partition should contain only one partition process. When a partition is free, a process is selected from the input 2 allocation queue and is loaded into the free partition. When the process terminates, the partition becomes available for another process. Fragmentation As processes are loaded and removed from memory, the free memory space is broken into little pieces.
It happens after sometimes that processes cannot be allocated to memory blocks considering their small size and memory blocks remains unused. This problem is known as Fragmentation. Fragmentation is of two types S. Fragmentation Description External Total memory space is enough to satisfy a request or to reside a 1 fragmentation process in it, but it is not contiguous so it cannot be used.
Some portion of fragmentation memory is left unused as it cannot be used by another process. External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block.
External fragmentation is avoided by using paging technique. Paging is a technique in which physical memory is broken into blocks of the same size called pages size is power of 2, between bytes and bytes. When a process is to be executed, it's corresponding pages are loaded into any available memory frames.
Logical address space of a process can be non-contiguous and a process is allocated physical memory whenever the free memory frame is available. Operating system keeps track of all free frames. Operating system needs n free frames to run a program of size n pages.
Segmentation Segmentation is a technique to break memory into logical pieces where each piece represents a group of related information. For example, data segments or code segment for each process, data segment for operating system and so on. Segmentation can be implemented using or without using paging. Speed differences between two devices.
A slow device may write data into a buffer, and when the buffer is full, the entire buffer is sent to the fast device all at once. So that the slow device still has somewhere to write while this is going on, a second buffer is used, and the two buffers alternate as each becomes full. This is known asdouble buffering.
Double buffering is often used in animated graphics, so that one screen image can be generated in a buffer while the other completed buffer is displayed on the screen. This prevents the user from ever seeing any half-finished screen images. Data transfer size differences. Buffers are used in particular in networking systems to break messages up into smaller packets for transfer, and then for re-assembly at the receiving side. To support copy semantics. For example, when an application makes a request for a disk write, the data is copied from the user's memory area into a kernel buffer.
Now the application can change their copy of the data, but the data which eventually gets written out to disk is the version of the data at the time the write request was made. VirtualMemory This section describes concepts of virtual memory, demand paging and various page replacement algorithms. Virtual memory is a technique that allows the execution of processes which are not completely available in memory.
The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory is the separation of user logical memory from physical memory. This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Following are the situations, when entire program is not required to be loaded fully in main memory. Virtual memory is commonly implemented by demand paging. It can also be implemented in a segmentation system.
Demand segmentation can also be used to provide virtual memory. Virtual memory algorithms Page replacement algorithms Page replacement algorithms are the techniques using which Operating System decides which memory pages to swap out, write to disk when a page of memory needs to be allocated. Paging happens whenever a page fault occurs and a free page cannot be used for allocation purpose accounting to reason that pages are not available or the number of free pages is lower than required pages.
This process determines the quality of the page replacement algorithm: the lesser the time waiting for page-ins, the better is the algorithm. A page replacement algorithm looks at the limited information about accessing the pages provided by hardware, and tries to select which pages should be replaced to minimize the total number of page misses, while balancing it with the costs of primary storage and processor time of the algorithm itself.
There are many different page replacement algorithms. We evaluate an algorithm by running it on a particular string of memory reference and computing the number of page faults. Reference String The string of memory references is called reference string. Reference strings are generated artificially or by tracing a given system and recording the address of each memory reference.
The latter choice produces a large number of data, where we note two things. A translation look-aside buffer TLB : A translation lookaside buffer TLB is a memory cache that stores recent translations of virtual memory to physical addresses for faster retrieval. When a virtual memory address is referenced by a program, the search starts in the CPU.
First, instruction caches are checked. At this point, TLB is checked for a quick reference to the location in physical memory. When an address is searched in the TLB and not found, the physical memory must be searched with a memory page crawl operation. As virtual memory addresses are translated, values referenced are added to TLB.
TLBs also add the support required for multi-user computers to keep memory separate, by having a user and a supervisor mode as well as using permissions on read and write bits to enable sharing. TLBs can suffer performance issues from multitasking and code errors. This performance degradation is called a cache thrash. Cache thrash is caused by an ongoing computer activity that fails to progress due to excessive use of resources or conflicts in the caching system.
Use the time when a page is to be used. OperatingSystemSecurity This section describes various security related aspects like authentication, one time password, threats and security classifications.
So a computer system must be protected against unauthorized access, malicious access to system memory, viruses, worms etc. We're going to discuss following topics in this article. One time passwords provides additional security along with normal authentication.
In One- Time Password system, a unique password is required every time user tries to login into the system. Once a one-time password is used then it cannot be used again. One time password are implemented in various ways.
System asks for numbers corresponding to few alphabets randomly chosen. System asks for such secret id which is to be generated every time prior to login. Operating system's processes and kernel do the designated task as instructed. If a user program made these process do malicious tasks then it is known as Program Threats. One of the common examples of program threat is a program installed in a computer which can store and send user credentials via network to some hacker.
Following is the list of some well-known program threats. It is harder to detect. A virus is generally a small code embedded in a program. System threats refer to misuse of system services and network connections to put user in trouble. System threats can be used to launch program threats on a complete network called as program attack.
Following is the list of some well-known system threats. A Worm process generates its multiple copies where each copy uses system resources, prevents all other processes to get required resources. Worm processes can even shut down an entire network.
Definition motivates a generic model of language processing activities. We refer to the collection of language processor components engaged in analyzing a source program as the analysis phase of the language processor.
Components engaged in synthesizing a target program constitute the synthesis phase. Hardware is just a piece of mechanical device and its functions are being controlled by a compatible software.
Hardware understands instructions in the form of electronic charge, which is the counterpart of binary language in software programming. Binary language has only two alphabets, 0 and 1. To instruct, the hardware codes must be written in binary format, which is simply a series of 1s and 0s. It would be a difficult and cumbersome task for computer programmers to write such codes, which is why we have compilers to write such codes. Language Processing System We have learnt that any computer system is made of hardware and software.
The hardware understands a language, which humans cannot understand. So we write programs in high-level language, which is easier for us to understand and remember. These programs are then fed into a series of tools and OS components to get the desired code that can be used by the machine. This is known as Language Processing System.
They may perform the following functions. Macro processing: A preprocessor may allow a user to define macros that are short hands for longer constructs. File inclusion: A preprocessor may include header files into the program text. Rational preprocessor: these preprocessors augment older languages with more modern flow-of- control and data structuring facilities. Floppy diskettes, hard disk, tapes and optical disks come under the category of external storage devices or ancillary storage devices.
These devices are very sensitive to environmental conditions humidity and temperature as well as to external magnetic fields and need to be stored carefully. Floppy disks are primarily used on PCs. Information on a floppy disk is recorded in the magnetized states of particles of iron oxides evenly placed upon concentric circles known as tracks. It is a non-removable enclosed magnetic disk included in most PCs.
It contains a stack of metal platters, each coated with iron oxide, that spin on a spindle and the entire unit is encased in a sealed chamber. This is plastic tape, usually made of Mylar that is coated with iron oxide, thereby enabling the introduction writing ; retention memory and reading of magnetically recorded information. The best use of tape storage is for data that you do not use very often.
An optical disc drive ODD is a disk drive that uses laser light or electromagnetic waves for reading or writing data to or from optical discs normally CD-ROM.
It is a data storage device that includes flash memory with an integrated USB interface. USB flash drives are typically removable and rewritable, and physically much smaller than an optical disc. Peripheral devices are devices connected to the computer externally. If a peripheral device is disconnected, the computer will still be able to work; only functions performed by this peripheral device will not be available. Here are the most used types of peripheral devices:.
The most common and very popular input device which helps in inputting data to the computer. It consists of keys that are capable of inputting alphabets, numbers and special characters. You can also navigate using the keyboard and perform shortcut functions.
Mouse is the most popular pointing device and cursor-control device having a small palm size box with a round ball at its base which senses the movement of mouse and sends corresponding signals to CPU when the mouse buttons are pressed.
It forms images from tiny dots, called pixels that are arranged in a rectangular form. The sharpness of the image depends upon the number of pixels. It is a device used to move cursor position on a monitor screen. A scanner allows you to scan printed material and convert it into a file format that may be used within the PC. A plotter is used to create high-quality visuals on paper. Plotters were used in applications such as computer-aided design, though they have generally been replaced with wide-format conventional printers.
A plotter gives a hard copy of the output. It draws pictures on a paper using a pen. It can be used to create presentation-charts, graphics, tables and high quality technical drawings.
0コメント