SlideShare a Scribd company logo

Deliverables To complete this assignment you must submit your OSManag.pdf

This document provides instructions for a project simulating operating system behaviors. It details assignments on memory management using algorithms like first fit, best fit and worst fit. It also covers file management and multi-threaded programming. Functions are defined to implement the memory allocation algorithms and display the results. The project aims to simulate core operating system functions through a series of C programming assignments.

1 of 4
Download to read offline
Deliverables To complete this assignment you must submit your OSManagement.c to
Webcourses. Project description This project will require students to simulate the behaviors of an
operating system with a series of assignments. 1. Simulate process allocation to memory blocks
based on memory management algorithms First Fit, Best Fit, Next Fit, and Worst Fit. 2. Simulate
file management of directories and files stored in a directory. 3. Simulate multi-threaded
programming with the POSIX (Portable Operating System Interface) threads (a.k.a. pthreads). C
programming language integrated development environment (IDE) 1. Code::Blocks NOT Mac
compatible 2. Visual Studio Code 3. Atom 4. https://replit.com/ 5. XCode Assignment Scope:
Memory Management 1. First Fit Implementation: a. Input memory blocks with size and
processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and
check if it can be assigned to current block. d. If size-of-process <= size-of-block if yes then
assign and check for next process. c. If not then keep checking the further blocks. 2. Best Fit
Implementation: a. Input memory blocks with size and processes with size. b. Initialize all
memory blocks as free. c. Start by picking each process and find the minimum block size that
can be assigned to current process i.e., find min(blockSize[1], blockSize[2],....blockSize[n]) >
processSize[current], if found then assign it to the current process. d. If not, then leave that
process and keep checking the further processes.
3. Worst Fit Implementation: a. Input memory blocks with size and processes with size. b.
Initialize all memory blocks as free. c. Start by picking each process and find the maximum
block size that can be assigned to current process i.e., find max(blockSize[1],
blockSize[2],.....blockSize[n]) > processSize[current], if found then assign it to the current
process. d. If not, then leave that process and keep checking the further processes. 4. Next Fit
Implementation: a. Input memory blocks with size and processes with size. b. Initialize all
memory blocks as free. c. Start by picking each process and check if it ean be assigned to the
current block, if yes, allocate it the required memory and check for next process but from the
block where we Icft not from starting. d. If the current block size is smaller, keep checking the
further blocks.
v. Write decision making logic based on the value of the looping variable (i.e. algorithm) 1.
When algorithm is equal to FIRST, call function firstFit, passing arguments blockSize, blocks,
processSize, and processes 2. When algorithm is equal to BEST, call function bestFit, passing
arguments blockSize, blocks, processSize, and processes 3. When algorithm is equal to WORST,
call function worstFit, passing arguments blockSize, blocks, processSize, and processes 4. When
algorithm is equal to NEXT, call function nextFit, passing arguments blockSire. blocks,
processSize, and processes Write function nextFit to do the following a. Return type void b.
Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e.
blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-
dimensional array, data type integer, contains the process sizes (i.e. processSize) iv. Parameter
contains the number of processes, data type integer (i.c. processes) c. Declare a one-dimensional
array, data type integer, to store the block id that a process is allocated to (i.e. allocation), size is
parameter processes d. Declare a variable, data type integer, to store the block allocation for a
process, initialize to 0 (i.c. id) c. Call function memset, passing arguments i. Array allocation ii. -
I (i.e. INVALID) iii. sizeof(allocation) f. Using a looping construct, loop through the number of
processes i. Using a looping construct, loop while id is less than the number of blocks 1. If the
current block size (i.e, index id) is greater than or equal to the current process size (i.e. index of
outer looping variable) a. Update the allocation array to set the clement at index of the outer
looping variable equal to variable id b. Reduce available memory of the current
size (i.e. index of the outer looping variable) c. break out of the inner loop ii. Update the value of
variable id to set the next index in array blockSize by adding I to variable id then modulus the
total by the number of blocks g. Call function displayProcess passing arguments allocation.
processes, and processize Write function firstFit to do the following a. Return type void b.
Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.c.
blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-
dimensional array, data type integer, contains the process sizes (i.c. processSize) iv. Parameter
contains the number of processes, data type integer (i.e. processes) c. Declare a one-dimensional
array, data type integer, to store the block id that a process is allocated to (i.e. allocation), sire is
parumeter processes d. Call function memset, passing arguments i. Array allocation ii. -1 (i.e.
INVAI.ID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of
processes i. Using a looping construct, loop the number of blocks 1. If the current block size (i.e,
index of the inner looping variable) is greater than or equal to the current process size (i.e, index
of outer looping variable) a. Update the allocation array to set the element at index of the outer
looping variable equal to the inner looping variable b. Reduce available memory of the current
block size (i.e. index of the inner looping variable) by the process size (i.e. index of the outer
looping variable) c. break out of the inner loop f. Call function displayProcess passing arguments
allocation, processes, and processize
Write function bestFit to do the following a. Return type void b. Parameter list includes i. One-
dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter
contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data
type integer, contains the process sizes (i.e. processhize) iv. Parameter contains the number of
processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer,
to store the block id that a process is allocated to (ice. allocation), size is parameter processes d.
Call function memset, passing arguments i. Array allocation ii. - I (ie. INVALID) iii.
sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Declare a
variable, data type integer, to store the current best fit value (i.e. bestldx) initialized to -1 (i.e.
INVALID) ii. Using a looping construct, loop the number of blocks 1. If the current block size
(i.e. index of the inner looping variable ) is greater than or equal to the current process size (ie.
index of outer looping variable) a. If the value of bestIdx is equal to -1 (i.e. INVAI.ID) i. Set
variable bestldx equal to the current block (i.e, the inner looping variable) b. Else if the value of
the block size at index bestldx is greater than the value of the block size at index of the inner
looping variable i. Set variable bestldx equal to the current block (i.e, the inner looping variable)
iii. If the value of variable bestldx is not equal to - 1 (i.e. INVAL.ID) 1. Update the allocation
array to set the element at index of the outer looping variable equal to variable bestldx
size (i.e. index bestIdx) by the process size (i.e. index of the outer looping variable) f. Call
function displayProcess passing arguments allocation, processes, and processize Write function
worstFit to do the following a. Return type void b. Parameter list includes i. One-dimensional
array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the
number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer,
contains the process sizes (i.e. processSize) iv. Parameter contains the number of processes, data
type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the
block id that a process is allocated to (i.c. allocation), size is parameter processes d. Call function
memset, passing arguments i. Array allocation ii. -1 (i.c. INVALID) iii. sizeof(allocation) e.
Using a looping construct, loop through the number of processes i. Declare a variable, data type
integer, to store the current worst fit value (i.e. wstIdx) initialized to -1 (i.e. INVALID) ii. Using
a looping construct, loop the number of blocks 1. If the current block size (i.e. index of the inner
looping variable ) is greater than or equal to the current process size (i.e. index of outer looping
variable) a. If the value of wstldx is equal to - I (i.e. INVALID) i. Set variable wstldx equal to the
current block (i.e. the inner looping variable) b. Else if the value of the block size at index wstIdx
is less than the value of the block size at index of the inner looping variable i. Set variable wstldx
equal to the current block (i.e. the inner looping variable)
iii. If the value of variable wstldx is not equal to -1 (i.e. INVALID) 1. Update the allocation array
to set the element at index of the outer looping variable equal to variable wstldx 2. Reduce
available memory of the current block size (i.e. index wstldx) by the process size (i.e. index of
the outer looping variable) f. Call function displayProcess passing arguments allocation,
processes, and processSize displayProcess 9. Write function displayProcess to do the following
a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, that
stores the block number allocations (i.e. allocation) ii. Parameter that contains the number of
processes, data type integer (i.e. processes) iii. One-dimensional array, data type integer, that
stores the processes (i.e. processSize) c. Write a looping construct to loop through the processes
(i.e. processize) i. Display to the console the process number (i.e use the looping variable plus 1)
ii. Display to the console the process size (i.e. processSize array at the current looping index) iii.
Display to the console the memory block assigned based on the following logic 1. If the value
stored at the current index of array processSize if -1 (i.e. INVALID), output Not Allocated 2.
Else, output the current allocation (i.e. allocation) OSManagement executable
begin{tabular}{|l|l|} hline Test Case 1 & Test Case 1 passes  hline Test Case 2 & Test Case 2
passes  hline Test Case 3 & Test Case 3 passes  hline Test Case 4 & Test Case 4 passes 
hline Test Case 5 & Test Case 5 passes  hline Test Case 6 & Test Case 6 passes  hline Test
Case 7 & Test Case 7 passes  hline Test Case 8 & Test Case 8 passes  hline & Source
compiles with no errors  hline & Source compiles with no warnings  hline & Source runs
with no errors  hline end{tabular}
#include h> Hinclude Hinc lude #define EXIT #define INVALID - 1 #define MEMORY 1
Hdefine FILES 2 #define THREAD 3 #define FIRST #define BEST 1 Hdefine WORST 2
void clearscreen() {system( "clear"); int displaymenu() { int choice = INVALID; printf("Select
an option: n"); printf ("1. Memory Management n=); printf ("2. File Management 1n); printf("3.
Mutti-Thread n ); printf(". Exitln"); printf("Enter your choice: "); scanf("%d", &choice); return
choice; 3 int main() { int choice =1; while (choice 1= EXIT) { choice = displayMenu(); switch
(choice) { case MEMORY: clearscreen(): printf("Memory Management selectedn"); break;
case FILES: clearscreen(): printf( "File Management selected n"); break; case THREAD:
clearscreen(): printf("Multi-Thread selected n ): break; case EXIT: clearscreen(); printf("Exiting
the program... In"); exit(EXIT_SUCCESS); default: clearscreen(): printf("Invalid choice, please
try againun"); break; } 3 return ; )

Recommended

c programing.Please help me with the write code libr.pdf
c programing.Please help me with the write code libr.pdfc programing.Please help me with the write code libr.pdf
c programing.Please help me with the write code libr.pdfinfo189835
 
Clustering_Algorithm_DR
Clustering_Algorithm_DRClustering_Algorithm_DR
Clustering_Algorithm_DRNguyen Tran
 
Concurrency at the Database Layer
Concurrency at the Database Layer Concurrency at the Database Layer
Concurrency at the Database Layer mcwilson1
 
Major Elements Of Memory Management
Major Elements Of Memory ManagementMajor Elements Of Memory Management
Major Elements Of Memory ManagementApril Bell
 
Design patterns - How much we understand and know ??
Design patterns - How much we understand and know ??Design patterns - How much we understand and know ??
Design patterns - How much we understand and know ??Vinay Raj
 
Mathemetics module
Mathemetics moduleMathemetics module
Mathemetics modulemanikanta361
 
Parallel Computing - Lec 4
Parallel Computing - Lec 4Parallel Computing - Lec 4
Parallel Computing - Lec 4Shah Zaib
 

More Related Content

Similar to Deliverables To complete this assignment you must submit your OSManag.pdf

Tower of Hanoi.docx
Tower of Hanoi.docxTower of Hanoi.docx
Tower of Hanoi.docxscottharry3
 
Data Structures_Introduction
Data Structures_IntroductionData Structures_Introduction
Data Structures_IntroductionThenmozhiK5
 
DS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptxDS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptxprakashvs7
 
C basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaManoj Kumar kothagulla
 
Java multi threading and synchronization
Java multi threading and synchronizationJava multi threading and synchronization
Java multi threading and synchronizationrithustutorials
 
Stacks
StacksStacks
StacksAcad
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template LibraryGauravPatil318
 
Project 3- BitVector & Application Implementing BitVector of undetermi.docx
Project 3- BitVector & Application Implementing BitVector of undetermi.docxProject 3- BitVector & Application Implementing BitVector of undetermi.docx
Project 3- BitVector & Application Implementing BitVector of undetermi.docxsharold2
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog Pushpa Yakkala
 
The design and implementation of modern column oriented databases
The design and implementation of modern column oriented databasesThe design and implementation of modern column oriented databases
The design and implementation of modern column oriented databasesTilak Patidar
 
JAVA CONCEPTS AND PRACTICES
JAVA CONCEPTS AND PRACTICESJAVA CONCEPTS AND PRACTICES
JAVA CONCEPTS AND PRACTICESNikunj Parekh
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercisesNico Ludwig
 

Similar to Deliverables To complete this assignment you must submit your OSManag.pdf (20)

2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
Tower of Hanoi.docx
Tower of Hanoi.docxTower of Hanoi.docx
Tower of Hanoi.docx
 
Data Structures_Introduction
Data Structures_IntroductionData Structures_Introduction
Data Structures_Introduction
 
DS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptxDS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptx
 
VB Dot net
VB Dot net VB Dot net
VB Dot net
 
C basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kella
 
Java14
Java14Java14
Java14
 
Java multi threading and synchronization
Java multi threading and synchronizationJava multi threading and synchronization
Java multi threading and synchronization
 
Stacks
StacksStacks
Stacks
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
Blockchain - a simple implementation
Blockchain - a simple implementationBlockchain - a simple implementation
Blockchain - a simple implementation
 
Project 3- BitVector & Application Implementing BitVector of undetermi.docx
Project 3- BitVector & Application Implementing BitVector of undetermi.docxProject 3- BitVector & Application Implementing BitVector of undetermi.docx
Project 3- BitVector & Application Implementing BitVector of undetermi.docx
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
 
Java unit i
Java unit iJava unit i
Java unit i
 
The design and implementation of modern column oriented databases
The design and implementation of modern column oriented databasesThe design and implementation of modern column oriented databases
The design and implementation of modern column oriented databases
 
Database Sizing
Database SizingDatabase Sizing
Database Sizing
 
JAVA CONCEPTS AND PRACTICES
JAVA CONCEPTS AND PRACTICESJAVA CONCEPTS AND PRACTICES
JAVA CONCEPTS AND PRACTICES
 
Jist of Java
Jist of JavaJist of Java
Jist of Java
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises
 

More from allurafashions98

Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf
 Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf
Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdfallurafashions98
 
Customers experlencing technical dlfficulty with their Internet cable.pdf
 Customers experlencing technical dlfficulty with their Internet cable.pdf Customers experlencing technical dlfficulty with their Internet cable.pdf
Customers experlencing technical dlfficulty with their Internet cable.pdfallurafashions98
 
CX Enterprises has the following expected dividends $1.03 in one yea.pdf
 CX Enterprises has the following expected dividends $1.03 in one yea.pdf CX Enterprises has the following expected dividends $1.03 in one yea.pdf
CX Enterprises has the following expected dividends $1.03 in one yea.pdfallurafashions98
 
Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf
 Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf
Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdfallurafashions98
 
Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf
 Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf
Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdfallurafashions98
 
Current Attempt in Prozress The following information ralates to Sher.pdf
 Current Attempt in Prozress The following information ralates to Sher.pdf Current Attempt in Prozress The following information ralates to Sher.pdf
Current Attempt in Prozress The following information ralates to Sher.pdfallurafashions98
 
Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf
 Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf
Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdfallurafashions98
 
Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf
 Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf
Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdfallurafashions98
 
Current Attempt in Progress The comparative balance.pdf
 Current Attempt in Progress The comparative balance.pdf Current Attempt in Progress The comparative balance.pdf
Current Attempt in Progress The comparative balance.pdfallurafashions98
 
Current Attempt in Progress Tamarisk Company has been operating for s.pdf
 Current Attempt in Progress Tamarisk Company has been operating for s.pdf Current Attempt in Progress Tamarisk Company has been operating for s.pdf
Current Attempt in Progress Tamarisk Company has been operating for s.pdfallurafashions98
 
Current Attempt in Progress Sunland Corporation sells three different.pdf
 Current Attempt in Progress Sunland Corporation sells three different.pdf Current Attempt in Progress Sunland Corporation sells three different.pdf
Current Attempt in Progress Sunland Corporation sells three different.pdfallurafashions98
 
Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf
 Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf
Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdfallurafashions98
 
Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf
 Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf
Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdfallurafashions98
 
Current Attempt in Progress Record journal entries for the following .pdf
 Current Attempt in Progress Record journal entries for the following .pdf Current Attempt in Progress Record journal entries for the following .pdf
Current Attempt in Progress Record journal entries for the following .pdfallurafashions98
 
Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf
 Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf
Current Attempt in Progress Pharoah Constructions manufacturing cost.pdfallurafashions98
 
Denton Company manufactures and sells a single product. Cost da.pdf
 Denton Company manufactures and sells a single product. Cost da.pdf Denton Company manufactures and sells a single product. Cost da.pdf
Denton Company manufactures and sells a single product. Cost da.pdfallurafashions98
 
Denver Post reported that, on average, a large shopping center had an.pdf
 Denver Post reported that, on average, a large shopping center had an.pdf Denver Post reported that, on average, a large shopping center had an.pdf
Denver Post reported that, on average, a large shopping center had an.pdfallurafashions98
 
Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf
 Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf
Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdfallurafashions98
 
Denton Company manufactures and sells a single product. Cost data for.pdf
 Denton Company manufactures and sells a single product. Cost data for.pdf Denton Company manufactures and sells a single product. Cost data for.pdf
Denton Company manufactures and sells a single product. Cost data for.pdfallurafashions98
 
Delta Company produces a single product. The cost of producing and se.pdf
 Delta Company produces a single product. The cost of producing and se.pdf Delta Company produces a single product. The cost of producing and se.pdf
Delta Company produces a single product. The cost of producing and se.pdfallurafashions98
 

More from allurafashions98 (20)

Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf
 Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf
Cycle Wholesaling sold merchandise on account, with terms n60, to Sa.pdf
 
Customers experlencing technical dlfficulty with their Internet cable.pdf
 Customers experlencing technical dlfficulty with their Internet cable.pdf Customers experlencing technical dlfficulty with their Internet cable.pdf
Customers experlencing technical dlfficulty with their Internet cable.pdf
 
CX Enterprises has the following expected dividends $1.03 in one yea.pdf
 CX Enterprises has the following expected dividends $1.03 in one yea.pdf CX Enterprises has the following expected dividends $1.03 in one yea.pdf
CX Enterprises has the following expected dividends $1.03 in one yea.pdf
 
Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf
 Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf
Customers arrive at a hotel at 26.2 per hour (Poisson distributed). T.pdf
 
Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf
 Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf
Custom Cabinetry has one job in process (Job 120) as of June 30 ; at .pdf
 
Current Attempt in Prozress The following information ralates to Sher.pdf
 Current Attempt in Prozress The following information ralates to Sher.pdf Current Attempt in Prozress The following information ralates to Sher.pdf
Current Attempt in Prozress The following information ralates to Sher.pdf
 
Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf
 Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf
Current Attempt in Prowressfoe rakh abgrnative, oetarmine the impa.pdf
 
Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf
 Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf
Current Attempt in Progress The Sanding Department of Oriole Furnitur.pdf
 
Current Attempt in Progress The comparative balance.pdf
 Current Attempt in Progress The comparative balance.pdf Current Attempt in Progress The comparative balance.pdf
Current Attempt in Progress The comparative balance.pdf
 
Current Attempt in Progress Tamarisk Company has been operating for s.pdf
 Current Attempt in Progress Tamarisk Company has been operating for s.pdf Current Attempt in Progress Tamarisk Company has been operating for s.pdf
Current Attempt in Progress Tamarisk Company has been operating for s.pdf
 
Current Attempt in Progress Sunland Corporation sells three different.pdf
 Current Attempt in Progress Sunland Corporation sells three different.pdf Current Attempt in Progress Sunland Corporation sells three different.pdf
Current Attempt in Progress Sunland Corporation sells three different.pdf
 
Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf
 Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf
Current Attempt in Progress Shown helow are romnarativa etatamente nf.pdf
 
Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf
 Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf
Current Attempt in Progress Selected information from Ivanhoe Ltd.s s.pdf
 
Current Attempt in Progress Record journal entries for the following .pdf
 Current Attempt in Progress Record journal entries for the following .pdf Current Attempt in Progress Record journal entries for the following .pdf
Current Attempt in Progress Record journal entries for the following .pdf
 
Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf
 Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf
Current Attempt in Progress Pharoah Constructions manufacturing cost.pdf
 
Denton Company manufactures and sells a single product. Cost da.pdf
 Denton Company manufactures and sells a single product. Cost da.pdf Denton Company manufactures and sells a single product. Cost da.pdf
Denton Company manufactures and sells a single product. Cost da.pdf
 
Denver Post reported that, on average, a large shopping center had an.pdf
 Denver Post reported that, on average, a large shopping center had an.pdf Denver Post reported that, on average, a large shopping center had an.pdf
Denver Post reported that, on average, a large shopping center had an.pdf
 
Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf
 Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf
Denen Hadroed Coevamy i. Al of thrie debin {a,b & te2. What is.pdf
 
Denton Company manufactures and sells a single product. Cost data for.pdf
 Denton Company manufactures and sells a single product. Cost data for.pdf Denton Company manufactures and sells a single product. Cost data for.pdf
Denton Company manufactures and sells a single product. Cost data for.pdf
 
Delta Company produces a single product. The cost of producing and se.pdf
 Delta Company produces a single product. The cost of producing and se.pdf Delta Company produces a single product. The cost of producing and se.pdf
Delta Company produces a single product. The cost of producing and se.pdf
 

Recently uploaded

Permeation enhancer of Transdermal drug delivery system
Permeation enhancer of Transdermal drug delivery systemPermeation enhancer of Transdermal drug delivery system
Permeation enhancer of Transdermal drug delivery systemchetanpatil2572000
 
CATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docxCATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docxAizaPolinarCruz
 
Capitol Doctoral Presentation -Feb 2024.pptx
Capitol Doctoral Presentation -Feb 2024.pptxCapitol Doctoral Presentation -Feb 2024.pptx
Capitol Doctoral Presentation -Feb 2024.pptxCapitolTechU
 
Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...Association for Project Management
 
Candace-Stone project& portfolio 1 class
Candace-Stone project& portfolio 1 classCandace-Stone project& portfolio 1 class
Candace-Stone project& portfolio 1 classccstone
 
Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...
Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...
Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...EduSkills OECD
 
BIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptx
BIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptxBIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptx
BIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptxRAVEESHAD
 
A Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdf
A Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdfA Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdf
A Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdfOH TEIK BIN
 
天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx
天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx
天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptxMasami YASUDA
 
2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptx2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptxMaryPotorti1
 
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.Florence Dayana
 
2024-02-24_Session 1 - PMLE_UPDATED.pptx
2024-02-24_Session 1 - PMLE_UPDATED.pptx2024-02-24_Session 1 - PMLE_UPDATED.pptx
2024-02-24_Session 1 - PMLE_UPDATED.pptxgdgsurrey
 
Peninsula Channel Commanders Rules Handbook
Peninsula Channel Commanders Rules HandbookPeninsula Channel Commanders Rules Handbook
Peninsula Channel Commanders Rules Handbookpccwebmasterhmb
 
Andreas Schleicher_ Strengthening Upper Secondary Education in Lithuania
Andreas Schleicher_ Strengthening Upper Secondary  Education in LithuaniaAndreas Schleicher_ Strengthening Upper Secondary  Education in Lithuania
Andreas Schleicher_ Strengthening Upper Secondary Education in LithuaniaEduSkills OECD
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDr-Dipali Meher
 
Mycobacteriology update 2024 Margie Morgan.ppt
Mycobacteriology update 2024 Margie Morgan.pptMycobacteriology update 2024 Margie Morgan.ppt
Mycobacteriology update 2024 Margie Morgan.pptMargie Morgan
 
EVALUATION POWERPOINT - STRANGER THINGS.pptx
EVALUATION POWERPOINT - STRANGER THINGS.pptxEVALUATION POWERPOINT - STRANGER THINGS.pptx
EVALUATION POWERPOINT - STRANGER THINGS.pptxiammrhaywood
 
Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)CaraSkikne1
 
How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17Celine George
 
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Aggregage
 

Recently uploaded (20)

Permeation enhancer of Transdermal drug delivery system
Permeation enhancer of Transdermal drug delivery systemPermeation enhancer of Transdermal drug delivery system
Permeation enhancer of Transdermal drug delivery system
 
CATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docxCATCH UP FRIDAY LESSON PLAN GRADE 6.docx
CATCH UP FRIDAY LESSON PLAN GRADE 6.docx
 
Capitol Doctoral Presentation -Feb 2024.pptx
Capitol Doctoral Presentation -Feb 2024.pptxCapitol Doctoral Presentation -Feb 2024.pptx
Capitol Doctoral Presentation -Feb 2024.pptx
 
Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...Successful projects and failed programmes – the cost of not designing the who...
Successful projects and failed programmes – the cost of not designing the who...
 
Candace-Stone project& portfolio 1 class
Candace-Stone project& portfolio 1 classCandace-Stone project& portfolio 1 class
Candace-Stone project& portfolio 1 class
 
Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...
Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...
Managing Choice, Coherence and Specialisation in Upper Secondary Education - ...
 
BIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptx
BIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptxBIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptx
BIOCHEMICAL PROPERTIES OF WATER .Raveesh.pptx
 
A Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdf
A Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdfA Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdf
A Free eBook ~ Mental Exercise ...Puzzles to Analyze.pdf
 
天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx
天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx
天橋立 観光メモ 2024-30-302-2-Amanohashidate Sightseeing Memo.pptx
 
2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptx2.27.24 Malcolm X and the Black Freedom Struggle.pptx
2.27.24 Malcolm X and the Black Freedom Struggle.pptx
 
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
 
2024-02-24_Session 1 - PMLE_UPDATED.pptx
2024-02-24_Session 1 - PMLE_UPDATED.pptx2024-02-24_Session 1 - PMLE_UPDATED.pptx
2024-02-24_Session 1 - PMLE_UPDATED.pptx
 
Peninsula Channel Commanders Rules Handbook
Peninsula Channel Commanders Rules HandbookPeninsula Channel Commanders Rules Handbook
Peninsula Channel Commanders Rules Handbook
 
Andreas Schleicher_ Strengthening Upper Secondary Education in Lithuania
Andreas Schleicher_ Strengthening Upper Secondary  Education in LithuaniaAndreas Schleicher_ Strengthening Upper Secondary  Education in Lithuania
Andreas Schleicher_ Strengthening Upper Secondary Education in Lithuania
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,View
 
Mycobacteriology update 2024 Margie Morgan.ppt
Mycobacteriology update 2024 Margie Morgan.pptMycobacteriology update 2024 Margie Morgan.ppt
Mycobacteriology update 2024 Margie Morgan.ppt
 
EVALUATION POWERPOINT - STRANGER THINGS.pptx
EVALUATION POWERPOINT - STRANGER THINGS.pptxEVALUATION POWERPOINT - STRANGER THINGS.pptx
EVALUATION POWERPOINT - STRANGER THINGS.pptx
 
Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)
 
How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17How To Create Record Rules in the Odoo 17
How To Create Record Rules in the Odoo 17
 
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
 

Deliverables To complete this assignment you must submit your OSManag.pdf

  • 1. Deliverables To complete this assignment you must submit your OSManagement.c to Webcourses. Project description This project will require students to simulate the behaviors of an operating system with a series of assignments. 1. Simulate process allocation to memory blocks based on memory management algorithms First Fit, Best Fit, Next Fit, and Worst Fit. 2. Simulate file management of directories and files stored in a directory. 3. Simulate multi-threaded programming with the POSIX (Portable Operating System Interface) threads (a.k.a. pthreads). C programming language integrated development environment (IDE) 1. Code::Blocks NOT Mac compatible 2. Visual Studio Code 3. Atom 4. https://replit.com/ 5. XCode Assignment Scope: Memory Management 1. First Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and check if it can be assigned to current block. d. If size-of-process <= size-of-block if yes then assign and check for next process. c. If not then keep checking the further blocks. 2. Best Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and find the minimum block size that can be assigned to current process i.e., find min(blockSize[1], blockSize[2],....blockSize[n]) > processSize[current], if found then assign it to the current process. d. If not, then leave that process and keep checking the further processes. 3. Worst Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and find the maximum block size that can be assigned to current process i.e., find max(blockSize[1], blockSize[2],.....blockSize[n]) > processSize[current], if found then assign it to the current process. d. If not, then leave that process and keep checking the further processes. 4. Next Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and check if it ean be assigned to the current block, if yes, allocate it the required memory and check for next process but from the block where we Icft not from starting. d. If the current block size is smaller, keep checking the further blocks. v. Write decision making logic based on the value of the looping variable (i.e. algorithm) 1. When algorithm is equal to FIRST, call function firstFit, passing arguments blockSize, blocks, processSize, and processes 2. When algorithm is equal to BEST, call function bestFit, passing arguments blockSize, blocks, processSize, and processes 3. When algorithm is equal to WORST, call function worstFit, passing arguments blockSize, blocks, processSize, and processes 4. When algorithm is equal to NEXT, call function nextFit, passing arguments blockSire. blocks, processSize, and processes Write function nextFit to do the following a. Return type void b.
  • 2. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One- dimensional array, data type integer, contains the process sizes (i.e. processSize) iv. Parameter contains the number of processes, data type integer (i.c. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.e. allocation), size is parameter processes d. Declare a variable, data type integer, to store the block allocation for a process, initialize to 0 (i.c. id) c. Call function memset, passing arguments i. Array allocation ii. - I (i.e. INVALID) iii. sizeof(allocation) f. Using a looping construct, loop through the number of processes i. Using a looping construct, loop while id is less than the number of blocks 1. If the current block size (i.e, index id) is greater than or equal to the current process size (i.e. index of outer looping variable) a. Update the allocation array to set the clement at index of the outer looping variable equal to variable id b. Reduce available memory of the current size (i.e. index of the outer looping variable) c. break out of the inner loop ii. Update the value of variable id to set the next index in array blockSize by adding I to variable id then modulus the total by the number of blocks g. Call function displayProcess passing arguments allocation. processes, and processize Write function firstFit to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.c. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One- dimensional array, data type integer, contains the process sizes (i.c. processSize) iv. Parameter contains the number of processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.e. allocation), sire is parumeter processes d. Call function memset, passing arguments i. Array allocation ii. -1 (i.e. INVAI.ID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Using a looping construct, loop the number of blocks 1. If the current block size (i.e, index of the inner looping variable) is greater than or equal to the current process size (i.e, index of outer looping variable) a. Update the allocation array to set the element at index of the outer looping variable equal to the inner looping variable b. Reduce available memory of the current block size (i.e. index of the inner looping variable) by the process size (i.e. index of the outer looping variable) c. break out of the inner loop f. Call function displayProcess passing arguments allocation, processes, and processize Write function bestFit to do the following a. Return type void b. Parameter list includes i. One- dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer, contains the process sizes (i.e. processhize) iv. Parameter contains the number of
  • 3. processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (ice. allocation), size is parameter processes d. Call function memset, passing arguments i. Array allocation ii. - I (ie. INVALID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Declare a variable, data type integer, to store the current best fit value (i.e. bestldx) initialized to -1 (i.e. INVALID) ii. Using a looping construct, loop the number of blocks 1. If the current block size (i.e. index of the inner looping variable ) is greater than or equal to the current process size (ie. index of outer looping variable) a. If the value of bestIdx is equal to -1 (i.e. INVAI.ID) i. Set variable bestldx equal to the current block (i.e, the inner looping variable) b. Else if the value of the block size at index bestldx is greater than the value of the block size at index of the inner looping variable i. Set variable bestldx equal to the current block (i.e, the inner looping variable) iii. If the value of variable bestldx is not equal to - 1 (i.e. INVAL.ID) 1. Update the allocation array to set the element at index of the outer looping variable equal to variable bestldx size (i.e. index bestIdx) by the process size (i.e. index of the outer looping variable) f. Call function displayProcess passing arguments allocation, processes, and processize Write function worstFit to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer, contains the process sizes (i.e. processSize) iv. Parameter contains the number of processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.c. allocation), size is parameter processes d. Call function memset, passing arguments i. Array allocation ii. -1 (i.c. INVALID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Declare a variable, data type integer, to store the current worst fit value (i.e. wstIdx) initialized to -1 (i.e. INVALID) ii. Using a looping construct, loop the number of blocks 1. If the current block size (i.e. index of the inner looping variable ) is greater than or equal to the current process size (i.e. index of outer looping variable) a. If the value of wstldx is equal to - I (i.e. INVALID) i. Set variable wstldx equal to the current block (i.e. the inner looping variable) b. Else if the value of the block size at index wstIdx is less than the value of the block size at index of the inner looping variable i. Set variable wstldx equal to the current block (i.e. the inner looping variable) iii. If the value of variable wstldx is not equal to -1 (i.e. INVALID) 1. Update the allocation array to set the element at index of the outer looping variable equal to variable wstldx 2. Reduce available memory of the current block size (i.e. index wstldx) by the process size (i.e. index of the outer looping variable) f. Call function displayProcess passing arguments allocation,
  • 4. processes, and processSize displayProcess 9. Write function displayProcess to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, that stores the block number allocations (i.e. allocation) ii. Parameter that contains the number of processes, data type integer (i.e. processes) iii. One-dimensional array, data type integer, that stores the processes (i.e. processSize) c. Write a looping construct to loop through the processes (i.e. processize) i. Display to the console the process number (i.e use the looping variable plus 1) ii. Display to the console the process size (i.e. processSize array at the current looping index) iii. Display to the console the memory block assigned based on the following logic 1. If the value stored at the current index of array processSize if -1 (i.e. INVALID), output Not Allocated 2. Else, output the current allocation (i.e. allocation) OSManagement executable begin{tabular}{|l|l|} hline Test Case 1 & Test Case 1 passes hline Test Case 2 & Test Case 2 passes hline Test Case 3 & Test Case 3 passes hline Test Case 4 & Test Case 4 passes hline Test Case 5 & Test Case 5 passes hline Test Case 6 & Test Case 6 passes hline Test Case 7 & Test Case 7 passes hline Test Case 8 & Test Case 8 passes hline & Source compiles with no errors hline & Source compiles with no warnings hline & Source runs with no errors hline end{tabular} #include h> Hinclude Hinc lude #define EXIT #define INVALID - 1 #define MEMORY 1 Hdefine FILES 2 #define THREAD 3 #define FIRST #define BEST 1 Hdefine WORST 2 void clearscreen() {system( "clear"); int displaymenu() { int choice = INVALID; printf("Select an option: n"); printf ("1. Memory Management n=); printf ("2. File Management 1n); printf("3. Mutti-Thread n ); printf(". Exitln"); printf("Enter your choice: "); scanf("%d", &choice); return choice; 3 int main() { int choice =1; while (choice 1= EXIT) { choice = displayMenu(); switch (choice) { case MEMORY: clearscreen(): printf("Memory Management selectedn"); break; case FILES: clearscreen(): printf( "File Management selected n"); break; case THREAD: clearscreen(): printf("Multi-Thread selected n ): break; case EXIT: clearscreen(); printf("Exiting the program... In"); exit(EXIT_SUCCESS); default: clearscreen(): printf("Invalid choice, please try againun"); break; } 3 return ; )