Skip to main content

Posts

Showing posts from 2019

Segmentation in OS

Segmentation in OS:- In Operating Systems, Segmentation is a memory management technique in which, the memory is divided into the variable size parts. Each part is known as segment which can be allocated to a process. The details about each segment are stored in a table called as segment table. Segment table is stored in one (or many) of the segments. Segment table contains mainly two information about segment: Base: It is the base address of the segment Limit: It is the length of the segment. Why Segmentation is required? Till now, we were using Paging as our main memory management technique. Paging is more close to Operating system rather than the User. It divides all the process into the form of pages regardless of the fact that a process can have some relative parts of functions which needs to be loaded in the same page. Operating system doesn't care about the User's view of the process. It may divide the same function into different pages and those page

Process Control Block(PCB)

Process Control Block:- Process Control Block is a data structure that contains information of the process related to it. It is very important for process management as the data structuring for processes is done in terms of the PCB. It also defines the current state of the operating system. Structure of the Process Control Block The process control stores many data items that are needed for efficient process management. Some of these data items are explained with the help of the given diagram: The following are the data items: Process State This specifies the process state i.e. new, ready, running, waiting or terminated. Process Number This shows the number of the particular process. Program Counter This contains the address of the next instruction that needs to be executed in the process. Registers This specifies the registers that are used by the process. They may include accumulators, index registers, stack pointers, general purpose registers etc. List

TCP/IP MODEL

TCP/IP MODEL:- TCP/IP model The TCP/IP model was developed prior to the OSI model. The TCP/IP model is not exactly similar to the OSI model. The TCP/IP model consists of five layers: the application layer, transport layer, network layer, data link layer and physical layer. The first four layers provide physical standards, network interface, internetworking, and transport functions that correspond to the first four layers of the OSI model and these four layers are represented in TCP/IP model by a single layer called the application layer. TCP/IP is a hierarchical protocol made up of interactive modules, and each of them provides specific functionality. Here, hierarchical means that each upper-layer protocol is supported by two or more lower-level protocols. Functions of TCP/IP layers: Network Access Layer A network layer is the lowest layer of the TCP/IP model. A network layer is the combination of the Physical layer and Data Link layer defined in the OSI reference

OSI Model

OSI Model:- OSI Model OSI stands for  Open System Interconnection  is a reference model that describes how information from a software application in one computer moves through a physical medium to the software application in another computer. OSI consists of seven layers, and each layer performs a particular network function. OSI model was developed by the International Organization for Standardization (ISO) in 1984, and it is now considered as an architectural model for the inter-computer communications. OSI model divides the whole task into seven smaller and manageable tasks. Each layer is assigned a particular task. Each layer is self-contained, so that task assigned to each layer can be performed independently. Characteristics of OSI Model: The OSI model is divided into two layers: upper layers and lower layers. The upper layer of the OSI model mainly deals with the application related issues, and they are implemented only in the software. The application layer is

Cookies in php

Cookies A cookie is often used to identify a user.  A cookie is a small file that the server embeds on the user's computer.  Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values. Create Cookies With PHP A cookie is created with the  setcookie()  function. Syntax setcookie( name, value, expire, path, domain, secure, httponly ); Only the  name  parameter is required. All other parameters are optional. PHP Create/Retrieve a Cookie The following example creates a cookie named "user" with the value "John Doe". The cookie will expire after 30 days (86400 * 30). We then retrieve the value of the cookie "user" (using the global variable $_COOKIE). We also use the  isset()  function to find out if the cookie is set: Example <?php $cookie_name =  "user" ; $cookie_value =  "John Doe" ; setcookie($cookie_name, $cookie_

PHP.ini file

1) Php.ini file. The PHP configuration file, php.ini, is the final and most immediate way to affect PHP's functionality. The php.ini file is read each time PHP is initialized.in other words, whenever httpd is restarted for the module version or with each script execution for the CGI version. use phpinfo() to check the path to php.ini. The configuration file is well commented and thorough(complete) Keys are case sensitive, keyword values are not. whitespace, and lines beginning with semicolons are ignored. Booleans can be represented by 1/0, Yes/No, On/Off, or True/False. Here we are explaining the important settings in php.ini which you may need for your PHP Parser:- short_open_tag = Off Short open tags look like this: <? ?>. This option must be set to Off if you want to use XML functions. safe_mode = Off If this is set to On, you probably compiled PHP with the --enable-safe-mode flag. Safe mode is most relevant to CGI use.  disable_functions = [fun

TLB Short Note

TLB( Tranlation Look Aside Buffer   ) TLB , that is,  Tranlation Look Aside Buffer  is hardware which is used to  decrease the average access time  in non-contiguous memory allocation scheme. Every time a CPU generates a  logical address  it has to search for the frame corresponding to a  page . And now as there are many displacements within a single page, the accession to main memory for finding the  frame  for the same page will be multiple times which increases the access time. So the first time we found the frame corresponding to a page, we store this “page-frame” entry in the TLB, so that if we need it again we could simply get it just by looking in the TLB. The accession time of TLB, being a hardware is less than that of Main memory. for more info :-  visit

Deadlock Prevention Short Note

Deadlock Prevention Deadlock Characteristics:- As discussed in the  previous post , deadlock has following characteristics. Mutual Exclusion Hold and Wait No preemption Circular wait Deadlock Prevention We can prevent Deadlock by eliminating any of the above four conditions. Eliminate Mutual Exclusion:-  It is not possible to dis-satisfy the mutual exclusion because some resources, such as the tape drive and printer, are inherently non-shareable. Eliminate Hold and wait:-  Allocate all required resources to the process before the start of its execution, this way hold and wait condition is eliminated but it will lead to low device utilization. for example, if a process requires printer at a later time and we have allocated printer before the start of its execution printer will remain blocked till it has completed its execution. The process will make a new request for resources after releasing the current set of resources. This solution may lead to starvation