Memory Segment Block: Designed and Developed by - VIVEK BURUGALE (1964114)
Memory Segment Block: Designed and Developed by - VIVEK BURUGALE (1964114)
Allocate
Memory Process Text
Open the File
Segmentation File
1.0
read each character
from the file
readData = getc(fp);
getProcessData
1.1
loop True Insert each character
value to Link List
readData != EOF
(char list)
TRUE IF TRUE
IF
Total Size +
P->SIZE <= M LEGENDS
P->size <=MM
P = PROCINTNODE
FALSE M = MAX_SEGMENT_SIZE (256KB)
MM = MAX_MEM_SIZE (1024 * 1024)
Total Size = 0
IF FALSE FALSE
Total Size 0; start_address =
Total Size + M
Break sbrk(0) + 1
<=MM
*end_address =
sbrk(0); total_size += P->size;
print
total_size += M; Process, start_address,
end_address,
segmentnumber
print
Process, start_address,
end_address, P->size =0;
segmentnumber P = P->next;
segmentnumber++;
P->size = P-size - M;
segmentnumber++;