<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Principles Of Operating System by Raihana</title>
      <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1</link>
      <description>All things I understood for this course</description>
      <language>en-us</language>
      <pubDate>2021-12-27 08:57:39 UTC</pubDate>
      <lastBuildDate>2024-10-13 11:54:33 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f916.png</url>
      </image>
      <item>
         <title>Chapter 1 - Introduction to OS</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1965176843</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1480451299/1c4b9b49f177d6b2c9af50ed4de07918/chap_1_part_2.PNG" />
         <pubDate>2021-12-27 09:06:47 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1965176843</guid>
      </item>
      <item>
         <title>Chapter 1 OS Structures Part 3</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966220057</link>
         <description><![CDATA[<div><strong>Personal Reflection: </strong><br>Actually i felt comfortable to write all of the notes in Onenote, cause i like my note with my hand writing. But OneNote doesn't provide link to share with my lecture. So i've decide to use padlet instead<br><br><br>important notes for Part 2 (OS Structures)<br>•system call is also an interrupt (A type of interrupt too)<br><br>Direct memory access structure:&nbsp;<br>let say typing a paragraph, event:<br>•Instead of transferring each character they lump up let say 20 characters, then only it moves into the memory&nbsp;<br>•By using this structure, less interrupt occurs, and lessen the time for CPU to do the transition<br>The situation explain the Direct Access Structure, which is:<br>-Interrupt-driven I/O can move small amount of data but can produce high overhead when used for bulk data. Therefore this structure combine all of the data into big chunk of data, and moves them into the memory(therefore minimizing the interrupt occurs &amp; minimize CPU idle time)<br><br>MultiCore System:&nbsp;<br>what does it mean by having multicore processor?<br>=on one single CPU design, it has multiple processor, so the number of processor is what we call today quadcore, dualcore, tripelcore and so on..&nbsp;<br>= in other word, on on unit processor, it has multiple processor chips, therefore if a CPU has four processors, a single job will divide the job among this four processors. It is OS job to divide the task(a job) among these four processors&nbsp;<br><br><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-28 05:33:03 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966220057</guid>
      </item>
      <item>
         <title>Chapter 1 OS Structures Part 2</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966225171</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1480451299/b41e341d003c5c5cbb3cd7b574d02266/OS_Stucture_Part_2.docx" />
         <pubDate>2021-12-28 05:40:58 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966225171</guid>
      </item>
      <item>
         <title>Chapter 2: OS Structure </title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966304722</link>
         <description><![CDATA[<div><strong>Personal Reflection:</strong><br>I'm gonna used this note to prepare for examination anyway. So my note may contain a lot of content, but i write all of the things that i need to remember rather that make it short. I'll dump everything so that i don't need to go through the lect slide next time.<br><br>objectives:<br>•Identify services provided by an OS<br>•Illustrate how system calls are used to provide OS services <br><br>There are 2 types of OS services: <br>•For User <br>•For System Programs(e.i power point etc)<br> <br>OS it provides services for both User and System Programs<br><br><mark>for the user side, the services that being provided is:&nbsp; </mark><br><strong>1. User Interface(UI)-</strong> providing GUI, CLI, touch screen, Batch<br><br><strong>2. Program Execution-&nbsp; </strong>Helps program to load into the memory and run the program, end the execution , either normally or abnormally (indicate error)<br><br><strong>3. I/O operations-</strong> A running program may require I/O, which may involve a file or an I/O device&nbsp; <br><br><strong>4.File-system manipulation-</strong> The file that user may want to work with, the OS helps to read, write, create, delete, search, list file information and permission management <br><br><strong>5. Communications-</strong> Processes may exchange information, on the same computer or between computer over a network<br><br><strong>6. Error Detection- </strong>possible errors may occur and OS must be constantly aware if this happened <br>This event may occur on the CPU or memory hardware or I/O devices. The OS must know appropriate action needs to be taken <br><br><mark>other than that OS helps to ensure efficient operation within the system itself via resource sharing<br><br></mark><strong>1. Resource allocation-</strong> If there are multiple users or jobs running at the same time, OS must allocate resources for each one of them <br><br><strong>2. Logging-</strong> Keep track of which user and how much and what kinds of computer resources <br><br><strong>3. Protection security- </strong>The owner's information may stored in multi users or networked computer system may want to control use of that information, concurrent process should not interfere with each other<br>• <strong>Protection </strong>ensure all access to system resource is controlled <br>•<strong> Security</strong> of the system from the outsiders requires user authentication,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extends to defending external I/O devices from invalid access attempts<br><br><strong><mark>System Calls <br></mark></strong>•Programming interface to the services that provided by the OS. And typically written in high-level language. And mostly accessed by programs via a high-level <mark>Application Program Interface(API)<br><br></mark>•This means, we have multiple platforms and API acts as an intermediary between system calls and OS <br><br>•Its basically a piece of software that gives instruction on how to provide a service <br><br><strong><mark>Types System Calls </mark></strong><br>•Process control <br>•File management <br>•Device management <br>•Information maintenance <br>•Communications <br>•Protection <mark><br><br></mark><strong><mark>System Services</mark></strong><br>Providing a convenient environment for program development and execution&nbsp;<br><br>• File Management<br>• Status Information&nbsp;<br>• File modification&nbsp;<br>•Programming-language support&nbsp;<br>•Programming loading and execution&nbsp;<br>•Communication&nbsp;<br>•Background Services&nbsp;<br>•Application Programs</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-28 07:35:51 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966304722</guid>
      </item>
      <item>
         <title>Chapter 3 - Processes Part 1</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966533476</link>
         <description><![CDATA[<div><strong>Personal refelction:</strong><br>A lot of things to remember, felt like studying history for SPM<br><br><strong>Objectives in this chapter:</strong><br>Process concept <br>Process Scheduling <br>Operations on Processes <br>Interprocess Communication <br>IPC in Shared-Memory Systems<br>IPC in Message-Passing System <br>Examples Of IPC System <br><br><strong><mark>Process concept:</mark></strong><strong><br></strong>•Program that need execution in the OS is known as process <br>or in other word, OS execute variety of programs that run as a process <br><br>which mean it's READY for execution or IN execution its known as process <br><strong>•Process- </strong>a program in execution; a process must go through several steps&nbsp; from the beginning of its creation until its termination (sequential fashion)<strong><br><br>*Other word, PROCESS IS ANY PROGRAM THAT IS IN EXECUTION*<br><br></strong><strong><mark>and this this process consists of multiple parts:<br></mark></strong>•Program code(code that we write) aka<mark> text section <br></mark>•Current activity; <mark>program counter </mark>(for every line code that has created generate a program counter - just like a marking line ), process registers <br>•<mark>Stack;</mark> Temporary data store Function parameters, return addresses, local variables <br>•<strong>Data Section</strong>; contain global variable<strong> <br></strong>•<strong>Heap</strong> containing memory dynamically allocated during run time (where the address of where our process resides in the memory, during the run time)<br><br>when we write a program, and save it <strong>- PROGRAM</strong> <br>but when we execute, compile and run the program <strong>- PROCESS <br><br></strong>on top of the code that we write previously will have all of the<strong> Multiple Parts (Program Counter, Stack &amp; Heap) <br><br></strong>• Process in <strong>active entity, </strong>while Program is a<strong> passive entity </strong>which stored in a disk <br>•Program becomes process when executable file loaded into memory <br>•Execution may start via GUI mouse click, command line entry of its name, etc<br>•A program can be several Processes (May have different function, called another function, another program, another object, etc..)<br>&nbsp; &nbsp; &nbsp; &nbsp;• Or consider multiple users executing the same program<br><br><strong><mark>Process State<br></mark></strong>A process when its in an execution, it changes state<strong><mark><br></mark></strong>•<strong>New:</strong> The process is being created <br>•<strong>Running: </strong>Instructions are being executed <br>•<strong>Waiting:</strong> The process is waiting for some event to occur <br>•<strong>Ready: </strong>The process is waiting to be assigned to a processor <br>•<strong>Terminated:</strong> The process has finished execution <br><br>Why OS keep changes from one state to another is because<br>Admitted = send to the memory <br><br><strong><mark>Flow Summary :</mark></strong><br>New&gt;Ready&gt;Running (Then 3 Possibilities might occur)<br>•Running&gt;Ready <br>•Running&gt;Terminated <br>•Running&gt;Waiting&gt;Ready<br><br>*Only processes in the ready state will be executed <br><br><strong><mark>Process Block Control<br></mark></strong>For each of the process the OS will keep the information about the process and will be kept in the register that is known as register Process Control Block(aka Task Control Block)<br><br><strong><mark>What are the information that the register kept?:<br></mark></strong>•Process State - running,waiting, etc <br>•Program counter - location of instruction to next execution <br>•CPU registers - contents of all process-centric registers <br>•CPU scheduling information - priorities, scheduling queue pointers <br>•Memory-management information - memory allocated to process <br>•Accounting information - CPU used, clock time elapsed since start, time limits<br>•I/0 status information - I/O devices allocated to process, list of open files <br><br><strong><mark>Threads:<br></mark></strong>•Within a process it may create threads<br>•When we have a process, that process may create many other small processes which known as threads <br><br><strong><mark>Process Scheduling <br></mark></strong>•The process will in many state. But in one time it can be only,ONLY in one state<br>•Processes can be either in one of the state(New, Ready, Running, Waiting, Terminated)<br>•To move kan all of this state to one and another we will use Process Scheduler/Scheduling<br>•Process Scheduler will select among available processes for the next execution on CPU core <br>•Its actually another instruction in OS which select the process from ready state into running (<strong>Ready&gt;Running</strong>)<br><br><strong><mark>For this scheduling purposes it maintains 2 queues:</mark></strong><br>•Ready Queues - set all of the processes residing in main memory, ready and waiting to execute(many processes)<br>•Waiting Queues - set of processes waiting for an event(exp: I/O) (many processes)<br><br><strong>*State running, is residing in the CPU and only had one process <br>*Time sliced expired= Interrupt (Let say the process only has 1 sec to finished its task, it will go back to ready queue)<br>*Interrupt waiting queue = An interrupt cause by I/O, It will go to waiting state <br><br></strong><strong><mark>Context Switch:<br></mark></strong>•Let say a process in running state, suddenly its being interrupted, the state will go back to ready, or waiting, or being terminated. The CPU will stop what ever its doing and must look after the interrupt. While the CPU entertain the interrupt, it must <mark>save the State of existing process and load the new saved state of process<br></mark>•When CPU switches to another process, the system must <mark>save the state</mark> of the old process and load the <mark>saved state</mark> for the new process via <mark>context switching</mark> <br><br>•Context switching become time overhead- during context switching CPU does not do execution therefore the state is idle <br>*The CPU does not do any useful work <br>=In conclusion Context Switching is a waste of CPU time (Time consuming)<br><br>Some system comes comes with the hardware that help to reduce context switching by having multiple set CPU registers<br><br><strong><mark>Operation of the processes:<br></mark></strong><strong>what the OS can do to the process?<br></strong>= Process Creation<strong> <br></strong>= Process Termination <br><br><strong><mark>Process Creation<br><br></mark></strong>It has a process, from that process it can be divided to other processes and the processes can be divided to many more processes(Tree of processes)<br><br>Sometimes the sub processes create Threads, and the threads will be considered a a children processes.(The child can be a thread)<br><br>•<strong>Parent</strong> process create <strong>children</strong> processes, which in turn create another process, forming a<strong> tree</strong> of processes <br>•<strong>Process Identifier (pid)</strong> managed and identified process<br>•Process can perform Resource Sharing &amp; Execution Option:<br>*Parent and child can share all of the resources. Children only share the sub set of parent resources . Or parent and child does not share any resource <br>*Parent and child can execute concurrently. And parent will wait until child terminated then only the main process is being terminated as well <br><br>For address space:<br>•Child may duplicate of parent (Child stay within the parents space)<br>•Child has a program loaded into it (we can just load program into child) <br><br><strong><mark>Process Termination:<br></mark></strong>Os also in charge in the termination of a process<br>•Process execute the last statement and asks the OS to delete it using the exit() system call <br><br>if parent wants to terminate but child still not terminate parent will wait (via <strong>wait()</strong>) until the child finished execution then only the main process considered as finished execution and being terminated and remove from the memory<br><br>Process' resources are deallocated by OS (memory,space, any i/o, that a process hold will be released by an OS by being terminate) <br><br>Parent may terminate the execution of child processes using <strong>abort()</strong> system call when:<br>•The child has exceeded allocated resources (lama sangat dalam execution, so parents boleh terminate) <br>•Task assigned is no longer required <br>•The parent is existing and the OS does not allow&nbsp; a child to continues if its parent terminates <br>•Some situations required both parents and child to be terminated. If a process terminates, then all its children must also be terminated.(The termination is being initiated by the OS)- <strong>Cascading Termination <br></strong><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-28 12:58:32 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1966533476</guid>
      </item>
      <item>
         <title>Chapter 3 - Processes Part 2</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1969321135</link>
         <description><![CDATA[<div><strong><mark>Interprocess Communication </mark></strong><br>As we know there are many processes in OS, therefore these processes can be <strong>independent</strong> or <strong>cooperating <br><br>the reason for cooperation is:<br></strong>•Information sharing <br>•Computation speedup<br>•Modularity <br>•Convenience <br>&nbsp;*mostly because of data, sometimes other resources. These reasons is why they need to cooperate, which known <strong>interprocess communication(IPC)</strong><br><br><strong>interprocess communication(IPC) only occurs for cooperating process </strong><br><br>There are 2 models of IPC(which depends on OS what type of model they use):<br>•Shared memory <br>•Message passing (both processes that are cooperating will pass the message using link trace?)&nbsp; <br><br>Independent process will not be affected by other process execution <br>Cooperating process they can affect or be effected by other processes<br><br>In Cooperating Process there is a problem known as <strong><mark>Producer-Consumer Problem:</mark></strong><strong><br><br></strong>In this case producer process in an entity who 'give' information , while consumer process is 'receiving' the information <br>So for OS to maintain this environment, it implement 2 phase:<br>•<strong>Unbounded-buffer : </strong>the OS provide a 'place' (a buffer) which have no limit, the shared area has no limit of size ( The shared memory may expand )<br>•<strong>Bounded-buffer : </strong>the OS provide a shared area (buffer) which have certain amount of size, which has limit of size&nbsp; (Cause producer-consumer problem cause of the shared space size)<br><strong><mark><br>IPC of Shared memory :<br></mark></strong>•An area of memory, shared among the processes that wish to communicate&nbsp; <br>•The OS will provide the shared memory space only but the communication is controlled by the user process<br>•The problem, is when many user wants to communicate it must have synchronization of their actions in those shared space <br><br><strong><mark>IPC of Message passing - 3 parts (direct.. synchronous..., buffer):<br></mark></strong>•Mechanism for processes to communicate and to synchronize their actions<br>•Message system - processes communication with each other without resorting&nbsp; to shared variables (There is no shared space of memory)<br><br>The facility provide 2 operations:<br>•send(message)<br>•receive(message)<br>&nbsp;The message size is either fixed or variable( depends nak hantar message tu besar mana pun)<br><br>Let say processes P &amp; Q wants to communicate they must:<br>•Establish a <strong>communication link</strong> between them<br>•Exchange messages via send/link&nbsp; &nbsp;<br><br><mark>How this communication is being done? Its either </mark><strong><mark>physical </mark></strong><mark>or </mark><strong><mark>logical</mark></strong><mark>:</mark><br><br><strong>Physical, using:</strong><br>•Shared memory <br>•Hardware bus <br>•Network <br><br><strong>Logical (Logical link), using:<br></strong>•Direct or indirect <br>•Synchronous or asynchronous <br>•Automatic or explicit buffering <br><br><strong><mark>Direct Communication:<br></mark></strong>Both process must know each other name explicitly<br>•<strong>send</strong>(P, message) - send a message to process P <br>•<strong>receive</strong>(Q, message) - receive a message from process Q<br><br>Properties of communication link<br>•Links are established automatically (this will be done OS) <br>•A link is associated with exactly one pair of communicating processes <br>•Between each pair there exits exactly one link <br>•The link may be unidirectional(P can sent to Q only), but mostly bi-directional (P sent link to Q, Q sent link to P)<br><br><strong><mark>Indirect Communication:<br></mark></strong>Messages are directed and received from mailboxes (aka ports)<br>•Each mailbox has a unique id&nbsp; <br>•Processes can communicate only if they share a mailbox <br><br>Properties of communication link<br>•Link must be established only if processes share a common mailbox <br>•A link may be associated with many processes <br>•Each pair of processes may share several communication links<br>•The link may be unidirectional or bi-directional <strong><mark><br><br>Operations:<br></mark></strong>•create new mailbox(port)<br>•send and receive messages through mailbox <br>•destroy a mailbox (when no processes use the mailbox anymore)<br><br><strong><mark>How it works? It will have a command:</mark></strong><br><strong>send</strong>(A, message) - send a message to mailbox A <br><strong>receive</strong>(A, message) - receive a message from mailbox A<br>*It will go to the mailbox only and not to the process. Not like direct communication, it will go directly to the process&nbsp; <br><br><strong><mark>Mailbox may need to share</mark></strong><br>•p1, p2 &amp; p3 share mailbox A <br>•p1 sends; p2 &amp; p3 receive <br>•Who gets the message? <br>=logically p2 &amp; p3 <br><br><strong><mark>For the solution from this situations <br></mark></strong>•Allow a link to be associated with at most two processes <br>•Allow only one processes at a time to execute a receive operation (maybe p2 copy the data first then p3 follows)<br>•Allow the system to select arbitrarily the receiver. Sender is notified who the receiver was<br><br><strong><mark>Synchronization<br></mark></strong>This scheme did message passing too,but either blocking &amp; non-blocking <br><br><strong>Blocking</strong> is considered as <strong>synchronous</strong> <br>•<strong>Blocking send -</strong> the sender is blocked until the message is received <br>•<strong>Blocking receive </strong>- the receiver is blocked until a message is received <br><br><strong>Non-blockin</strong>g is considered as <strong>asynchronous <br></strong>•<strong>Non-Blocking send -</strong> the send the message and continue, don't have to make sure <br>•<strong>Non-Blocking receive - </strong>the receiver receives: a valid message or null message<br><br>If both send and receive are blocking, we have a <strong>rendezvous(unblock the processes)<br><br></strong><strong><mark>Buffering<br></mark></strong>almost similar to shared message, but it use a queue of messages that attached to the link <br><br><strong>3 ways are being implemented:</strong><br>•Zero capacity - no messages are queued on a link.<br>Sender must wait for receiver(rendezvous), sender send, receiver received, terminate process<br><br>•Bounded capacity - finite length of n messages<br>Sender must wait if link full, sender send, leave, do other process, but has limit for buffering&nbsp;<br><br>•Unbounded capacity - infinite length&nbsp;<br>Sender never waits, size can keep on growing&nbsp;<br><br><br><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 02:13:34 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1969321135</guid>
      </item>
      <item>
         <title>Chapter 5 - CPU Scheduling</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1969871265</link>
         <description><![CDATA[<div><strong>Personal reflection:<br></strong>after all this chapter, i think i don't want to be an OS developer. Tooooo many components that is tooooo complex to understand<br><br><strong>must understand CPU algorithm to understand this chapter</strong> <br><br><strong><mark>Basic concepts:</mark></strong><br>•to run the various process in the CPU, OS use multi-programming scheme (To have maximum utilization of CPU)<br>•The basic of execution is a cycle- cycle of CPU &amp; I/O Burst(<strong>CPU Burst</strong>- Doing CPU execution, <strong>I/O Burst</strong> - doing I/O execution,the process is waiting for the I/O )<br>*The basic is that it will do CPU Burst or I/O Burst or it will go back to the ready state <br><br>•The main concern in this chapter is <strong>CPU Burst, </strong>cause we want to schedule the CPU so that it fully utilized the CPU <br><br>*CPU Burst and I/O Burst relates closely to process state diagram, espacially the read to running state <br>ready queue have many process, on one in running state, so CPU can execute one process at one time <br><br>CPU Scheduling is done by scheduler and the task is:<br><strong>CPU Scheduling is about how the OS instruct or select processes from the ready queue to running and be done by scheduler&nbsp; (ready queue is in the ram)<br><br>Ready&gt;Running = CPU Burst <br>Running&gt;Waiting(waiting I/O Event) = I/O Burst <br>&nbsp;<br></strong><strong><mark>When was the CPU scheduler needed?<br></mark></strong>•running&gt;waiting <br>•running&gt;ready (interrupt)<br>•waiting&gt;ready(complete I/O burst)<br>•terminates(required another process to be dispatch to the CPU)<br><br><strong><mark>In CPU Scheduling there is 2 terms need to be remember:</mark></strong><br>•<strong>nonpreemptive<br></strong>•<strong>preemptive</strong>(A job is being executed, it will complete its execution then only it will terminate)<br>In preemptive it must consider:<br>•access shared data <br>•preemptive while in kernel mode <br>•interrupts accurring during crucial OS activities<br><br><strong><mark>Dispatcher:<br></mark></strong>Its a module gives control of the CPU to the process selected by the short term scheduler, which involve:<br>•Switching context <br>•Switching to user mode <br>•jumping to the proper location in the user program to restart that program<br>&nbsp;<br><strong>Dispatch latency -</strong> time it takes for the dispatcher to stop one process and start another running <br><br><strong><mark>Scheduling Criteria (The goal of CPU Scheduling)<br></mark></strong>It must be certain criteria while selecting the processes:<br>•<strong>CPU Utilization</strong> (max)-&nbsp; keep the CPU as busy as possible<br>•<strong>Throughput</strong> (max)- So that the number of processes that complete their execution per time is high<br>•<strong>Turnaround time </strong>(min)- amount of time to execute a particular process is short <br>•<strong>Waiting time</strong> (min) amount of time a process has been waiting in ready queue minimum as possible <br>•<strong>Response time</strong> (min)-&nbsp; amount of time it takes from when a request was submitted until the first response is produced, not output (when it first created until the time it being pick up for execution)<br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-01 00:58:37 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1969871265</guid>
      </item>
      <item>
         <title>Chapter 6 - Synchronization</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1970425137</link>
         <description><![CDATA[<div><strong>Personal reflection</strong> <br>Every OS chapter is soooooo harrrrddd for me. Sometimes i understand the chapter and then the next thing i will be confused with a lot of terms to remember. But i will try hard to absorb all of important concept.<br><br><strong><mark>The concept:</mark></strong><br>•There are many processes(threads) running concurrently or parallel and these threads share the same resource, data,file, etc. <br>Therefore its OS task to synchronize the sharing of these processes by many process or threads<br><br>•The OS continuously update various data structures to support multiple threads <br><br>•If there's no synchronization there is tendency -&nbsp; A <strong>race condition</strong> exits when access to shared data in not controlled resulting in corrupt data value <br>•To avoid this thing happens, <strong>process synchronization</strong> is needed <br>•The mechanism it that the OS task to <strong>coordinate</strong> among cooperating processes(The processes that sharing the same data,file,resources). <br>•This can be done by locking and <strong>critical section problem</strong>&nbsp; &nbsp;<br><br><strong>What is process synchronization actually??:</strong><br>•to synchronize OS user the synchronization tools<br>•it is involves using tools that control access to shared data to avoid <strong>race conditions</strong>. These tools must be used carefully, s their incorrect use can result n poor system performance or <strong>deadlock.<br><br>What are the tools?:<br></strong>•Peterson's solution<br>•Mutex <br>•Semaphore <br><br><strong><mark>Critical section problem<br></mark></strong>in Process there is a segment code called critical section problem(a segment to share resources like data, file &amp; database)<br><strong>This section consist of:<br></strong>•<strong>Entry section</strong> : requesting entry into the critical section <br>•<strong>Critical section</strong> : a section where one process executed at one of the time <br>•<strong>Exit section</strong> : releasing shared resources <br>•<strong>Remainder section</strong> : the rest off code execution - for the process to complete its execution(the process is actually not finished execution yet, but need to released shared data)<br><br>Every process must have request&nbsp; to enter its critical section<br><br><strong><mark>Solution to the critical section:<br></mark></strong>In order to achieve the good use of shard data or the critical section&nbsp; it must fulfil all of these criteria:<br>•<strong>Mutual Exclusion-</strong>&nbsp; If one process in executing, so other processes can't be in the critical section, only one process can be in the critical section <br>•<strong>Progress-</strong> if the shared data are no being used, then it(process in the critical section) must allow another process to enter critical section <br>•<strong>Bounded waiting-</strong> there is a limited time set for processes to enter the critical section&nbsp; <br><br><strong><mark>The Handling: <br></mark></strong><strong>There are two approaches for handling critical section:<br></strong>•<strong>Preemptive</strong> - allows preemption of process when running in the kernel mode <br>•<strong>Non-preemptiv</strong>e -&nbsp; runs until exits kernel mode, blocks or voluntarily yields CPU (esp free race condition)<br><mark><br></mark><strong><mark>Peterson's solutions &amp; Mutex lock <br></mark></strong>Its a synchronization tools to synchronize the process the processes to enter critical section(CS) and solve CS problem<br>This tools are variations of software algorithms <br><br><strong><mark>Peterson's solutions</mark></strong><strong><br></strong>Its a two-process solution- this algorithm applicable at two process at a time:<br>•<strong>int turn</strong> : indicates whose turn it is to enter critical section <br>•<strong>boolean flag</strong>: indicate if a process is ready to enter critical section. flag[i]= true, means that the process is ready <br><br><strong><mark>Mutex Lock </mark></strong><br>a process must acquire lock before entering critical section; the lock will be release once it enters the critical area. This implements:<br>•acquire() function to acquire the lock and&nbsp;<br>•release() function to release the lock&nbsp;<br><br>this Mutex lock has a boolean variable - which the value indicates if the lock is available or not.&nbsp; Lock available - call to acquire() succeeds<br><br>&nbsp;A process will be blocked if its try to acquires unavailable lock until&nbsp;the lock is released <br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-02 03:06:11 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1970425137</guid>
      </item>
      <item>
         <title>Chapter 7 - Deadlock </title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1975344306</link>
         <description><![CDATA[<div>&nbsp;A state when every process in a set is waiting for an event that can be caused only by another process in the set. This can be describe using a graph aka Resource Allocation Graph <br><br>System model: just to represent how deadlock works in computer system.<br><mark><br></mark><strong><mark>The Characteristic</mark></strong><strong> <br>if all of this characteristic occurs then deadlock consider happen(mesti empat2 ni berlaku)<br></strong>•Mutual Exclusion:<br>•Hold and wait <br>•No preemption <br>•Circular wait <br><strong><mark><br>how to handle deadlocks?<br></mark></strong>firstly we have to make sure that deadlock will happen by:<br>•prevention: make sure none of 4 characteristic occurs<br>•avoidance: more infos required by the OS so that it can determine whether the current request will cause deadlock or not <br><br><strong>Deadlock Prevention: Mutual Exclusion</strong><br>•Some process only hold sharable resources like read only file and cannot hold any other type of resources <br><strong><br>Deadlock Prevention: Hold and wait </strong><br>•The process can't hold some resources and then requesting for more resources <br>•Therefore the process must:<br>-acquire all resources before its runs <br>-when a process request for another resources. it must hold none of them <br><br><strong>Deadlock Prevention: No preemption</strong><br>A preempted state occurs when a process is holding some resources and requesting some others that are being held by other processes.<br>for this situation not to happen it must:<br>• the requesting processes must wait until the resource is being released. While its waiting, its resources may be preempted <br><br><strong>Deadlock Prevention: Circular wait <br></strong>We can interrupt the cycle of waiting by doing the following: We can order all resource categories to break the circle of waiting (e.g., tapes, printers).<br>•A process can only request resources of higher types than the ones it already has.<br><br><strong>Deadlock Avoidance: Mutual Exclusion</strong><br>•Each process delivers the maximum amount of each type of resource it requires.<br>•To avoid a system deadlock, algorithms relying on this data are available. This is how a state operates. Deadlock avoidance is the goal here.<br><br><br><strong>Deadlock Avoidance: Hold and wait <br></strong>•A state is safe if the system can allocate resources to each process (up to its maximum, of course) and prevent a deadlock (safe state).<br>•In other words, a condition is safe if it has a safe sequence. Otherwise, the current state of the system is dangerous<br><br><br><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-05 00:34:34 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/1975344306</guid>
      </item>
      <item>
         <title>Chapter 8 - Memory management </title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/2006905169</link>
         <description><![CDATA[<div>main memory is actually one of the resource. This chapter focus on how CPU manage main memory <br><br>In this case Memory management keeps track of every single memory location, regardless of whether it is assigned to a process or not. It determines how much RAM each process is entitled to. Decisions about the allocation of memory are made here. It keeps track of when memory is released or unallocated and changes the state accordingly.<br><mark><br></mark><strong><mark>Why we need memory management?</mark></strong><strong><br></strong>•This method aids in optimising the use of memory by putting programmes in memory in the most efficient manner possible.<br>•These processes are protected from one other by this method, thus they do not interfere with each other.<br>•It improves in the distribution of &nbsp;space among several programme routines.<br><br><strong><mark>How the OS do so?</mark></strong><strong><br></strong>There are methods use by OS to perform this memory management:<br>•Paging<br>•Segmentation <br>•Partitioning allocation <br>•Fragmentation <br>•Swapping <br><br><strong><mark>Swapping</mark></strong><strong><br></strong>Swapping is the process of bringing in each process in the main memory, running it for a while, and then putting it back to the disk.<br><br><strong><mark>Contiguous Memory Allocation</mark></strong><strong><br></strong>in this type of memory allocation, there is single contiguous block of memory in each processes. Memory is partitioned into a number of fixed-size blocks. And exactly one process contain in each partition. When partition is free, from the input queue, a process is chosen and fed into it. This free block of memory also known as holes. To identify which hole is the best to assign, the set of holes is searched.<br><mark><br></mark><strong><mark>Memory Protection</mark></strong><br>Memory protection refers to the process of controlling memory access privileges on a computer. Its major goal is to prevent processes from accessing memory that has not been assigned to them. <br><br><strong><mark>Memory Allocation in OS</mark></strong><strong><br></strong>•<strong>First Fit Allocation: </strong>The first hole that is big enough is allocated to the program.<br>•<strong>Best Fit Allocation: </strong>The smallest hole that is big enough is allocated to the program.<br>•<strong>Worst Fit Allocation: </strong>The largest hole that is big enough is allocated to the program.<br><br><strong><mark>Fragmentation</mark></strong><strong> </strong><br>When the majority of the free blocks in a dynamic memory allocation system are too small to satisfy any request, fragmentation develops. The inability to utilise the available memory is a common description.<br><br>Processes are loaded and unloaded from memory in this context. As a result, free holes exist to fulfil requests, but they are non-contiguous, i.e. memory is split into large numbers of small holes. This is known as <strong>External Fragmentation.<br><br></strong>In addition, physical memory is sometimes divided into fixed-size blocks, and memory is allocated in block sizes. It's possible that the memory assigned to space is somewhat larger than the amount requested. <strong>Internal fragmentation </strong>is the discrepancy between allocated and necessary memory.<strong><br></strong><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-23 06:56:45 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/2006905169</guid>
      </item>
      <item>
         <title>Chapter 9 - Virtual memory</title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/2007009305</link>
         <description><![CDATA[<div>Large programmes can store themselves in the form of pages in virtual memory while they are being executed, and only the needed pages or sections of processes are loaded into main memory. This approach is beneficial because it provides a big virtual memory for user programmes when the physical memory is limited.<br><br><strong><mark>Virtual memory can be implement by using:</mark></strong><br>•Demand paging<br>•Demand Segmentation</div><div><br><strong><mark>Demand Paging</mark></strong><strong><br></strong>Demand paging works on the idea that when a process is switched in, its pages are not swapped in all at once. Alternatively, they are only used when the process requires them (On-demand).Only those pages are loaded at first that will be required by the procedure right away. <br><br>The page table marks pages that haven't been moved into memory as invalid. The rest of the table is empty when an entry is invalid.<br><br><strong><mark>Page Replacement</mark></strong><br>What happens, though, when a process wants additional pages and there isn't enough free RAM to accommodate them?<br><br>This step will be taken by the OS:<br>•Place the process in the wait queue until any other process has completed its execution, freeing up frames.<br>•However, to release frames, eliminate some other process entirely from the memory.<br>•or, find any pages that aren't being utilised at the moment and transfer them to the disc to free up frames. This is known as Page replacement, and it is the most often used strategy.<br><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-23 10:09:41 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/2007009305</guid>
      </item>
      <item>
         <title>Chapter 10 - File Management </title>
         <author>rhana1602</author>
         <link>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/2007297731</link>
         <description><![CDATA[<div><strong><mark>Appreciation post:<br></mark></strong><strong><br>Dear Madam,<br></strong>Thank you so much for everything you've taught me. Despite the fact that I am not one of the best students or most active in the class, I really appreciated the time that you spent teaching every chapter. Even for me, this subject is hard. 😢<br><br>With all respect, thank you for all the knowledge. May Madam always be in Allah's protection! Thank you very much!&nbsp; ✨<br><br>Thank you very much!<br><br><strong>Sincerely, <br>your student😇</strong><br><br><strong>File Structure:</strong></div><ul><li><strong>Simple Record Structure</strong> with lines of fixed or variable lengths.</li><li><strong>Complex Structures</strong> like formatted document or reloadable load files.</li><li><strong>No Definite Structure</strong> like sequence of words and bytes etc.</li></ul><div><strong><br>Attributes of a File:</strong></div><ul><li><strong>Name </strong>. It is the only information which is in human-readable form.</li><li><strong>Identifier</strong>. The file is identified by a unique tag(number) within file system.</li><li><strong>Type</strong>. It is needed for systems that support different types of files.</li><li><strong>Location</strong>. Pointer to file location on device.</li><li><strong>Size</strong>. The current size of the file.</li><li><strong>Protection</strong>. This controls and assigns the power of reading, writing, executing.</li><li><strong>Time, date, and user identification</strong>. This is the data for protection, security, and usage monitoring.</li></ul><div><br><strong>File Access Methods</strong><br>•Sequential Access<br>•Direct Access<br>•Indexed Sequential Access<br><br><br><strong>What is a Directory?</strong></div><ul><li><strong>Name</strong> : The name visible to user.</li><li><strong>Type</strong> : Type of the directory.</li><li><strong>Location</strong> : Device and location on the device where the file header is located.</li><li><strong>Size</strong> : Number of bytes/words/blocks in the file.</li><li><strong>Position</strong> : Current next-read/next-write pointers.</li><li><strong>Protection</strong> : Access control on read/write/execute/delete.</li><li><strong>Usage</strong> : Time of creation, access, modification etc.</li><li><strong>Mounting</strong> : When the root of one file system is "grafted" into the existing tree of another file system its called Mounting.</li></ul><div><br><br><br><br></div><div><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-23 16:14:31 UTC</pubDate>
         <guid>https://padlet.com/rhana1602/rl18uebo6w70lvp1/wish/2007297731</guid>
      </item>
   </channel>
</rss>
