Beruflich Dokumente
Kultur Dokumente
4a:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 4a.c
4a.c:2:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
^
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
Enter no.of files:2
Enter no. of blocks occupied by file1 6
Enter the starting block of file1 8
Enter no. of blocks occupied by file2 7
Enter the starting block of file2 4
Filename Start block length
1 8 6
2 4 7
blocks occupied are:fileno1 8 9 10 11 12 13
fileno2 4 5 6 7 8 9 10
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$
4b:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 4b.c
4b.c:7:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
^
4b.c:15:12: warning: format specifies type 'char *' but the argument has
type 'char (*)[10]' [-Wformat]
scanf("%s",&f[i].fname);
~~ ^~~~~~~~~~~
2 warnings generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
Enter no. of files: 2
Enter file name: mohammed
Enter starting block: 7
Enter no.of blocks: 8
Enter block numbers: 6
4
5
9
3
1
7
2
Enter file name: thawfeeq
Enter starting block: 4
Enter no.of blocks: 2
Enter block numbers: 8
7
File start size block
mohammed 7 8 7--->6--->4--->5--->9--->3--->1--->7--->2
thawfeeq 4 2 4--->8--->7
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$
4c:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 4c.c
4c.c:2:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
^
4c.c:8:32: warning: data argument not used by format string [-Wformat-
extra-args]
{ printf("Enter index block :",i+1);
~~~~~~~~~~~~~~~~~~~~~ ^
2 warnings generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
Enter no. of files: 2
Enter index block : 4
Enter blocks occupied by file1: 6
enter blocks of file1: 1
3
5
7
9
0
Enter index block : 6
Enter blocks occupied by file2: 2
enter blocks of file2: 2
6
fileno2 6--->2
6--->6
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$
5:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 5.c
5.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
^
5.c:30:1: warning: implicitly declaring library function 'exit' with type 'void
(int) __attribute__((noreturn))'
exit(0);
^
5.c:30:1: note: include the header <stdlib.h> or explicitly provide a declaration for
'exit'
2 warnings generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
1.PRODUCER
2.CONSUMER
3.EXIT
7:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 7.c
7.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main(){
^
7.c:2:1: note: change return type to 'int'
void main(){
^~~~
int
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
enter the number of processes in a system 5
enter the number of resources in a system 6
7
8
8
8
4
3
3
5
3
8
4
9
8
7
8
6
5
5
7
5
7
4
3
3
9
0
2
2
2
2
9
0
2
4
3
3
5
9
5
4
3
3
6
8
6
7
5
5
pocess P1
allocated 12 maximum 7 need -5
allocated 3 maximum 4 need 1
allocated 5 maximum 3 need -2
allocated 8 maximum 3 need -5
allocated 8 maximum 2 need -6
allocated 6 maximum 2 need -4
_________________________
pocess P2
allocated 7 maximum 9 need 2
allocated 8 maximum 0 need -8
allocated 8 maximum 2 need -6
allocated 8 maximum 2 need -6
allocated 4 maximum 2 need -2
allocated 3 maximum 2 need -1
_________________________
pocess P3
allocated 3 maximum 9 need 6
allocated 5 maximum 0 need -5
allocated 3 maximum 2 need -1
allocated 8 maximum 4 need -4
allocated 4 maximum 3 need -1
allocated 9 maximum 3 need -6
_________________________
pocess P4
allocated 8 maximum 5 need -3
allocated 7 maximum 9 need 2
allocated 8 maximum 5 need -3
allocated 6 maximum 4 need -2
allocated 5 maximum 3 need -2
allocated 5 maximum 3 need -2
_________________________
pocess P5
allocated 7 maximum 6 need -1
allocated 5 maximum 8 need 3
allocated 7 maximum 6 need -1
allocated 4 maximum 7 need 3
allocated 3 maximum 5 need 2
allocated 3 maximum 5 need 2
_________________________
8a:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 8a.c
8a.c:3:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main()
^
8a.c:3:1: note: change return type to 'int'
void main()
^~~~
int
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
Invalid page
PageNo. BaseAdd. PhysicalAdd.
1 1400 2700
Invalid pageMohammeds-MacBook-Pro:Desktop mohammedthawfeeq$
8b:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 8b.c
8b.c:3:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main()
^
8b.c:3:1: note: change return type to 'int'
void main()
^~~~
int
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
9a:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 9a.c
9a.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main()
^
9a.c:2:1: note: change return type to 'int'
void main()
^~~~
int
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
Enter length of ref. string : 5
Enter reference string :
4
7
8
9
0
Enter number of frames : 6
9b:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 9b.c
9b.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main()
^
9b.c:2:1: note: change return type to 'int'
void main()
^~~~
int
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
Enter no of pages: 4
Enter the reference string: 36
37
38
32
Enter no of frames: 4
36
36 37
36 37 38
36 37 38 32
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$
9c:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 9c.c
9c.c:5:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main()
^
9c.c:5:1: note: change return type to 'int'
void main()
^~~~
int
1 warning generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
ref no 32 -> 32 -1 -1 -1 -1
ref no 34 -> 32 34 -1 -1 -1
Number of page faults: 2
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$
10:
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ cc 10.c
10.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
^
10.c:10:1: warning: implicitly declaring library function 'printf' with type
'int (const char *, ...)'
printf("\nfirst SHMID failed\n");
^
10.c:10:1: note: include the header <stdio.h> or explicitly provide a declaration
for 'printf'
2 warnings generated.
Mohammeds-MacBook-Pro:Desktop mohammedthawfeeq$ ./a.out
11:
MEMORY MANAGEMENT USING PAGING
PAGE TABLE
0 2 1
1 7 1
2 6 1
3 5 1
FRAME TABLE
FrameAddress PageNo
0 32555
1 32555
2 0
3 32555
4 32555
5 3
6 2
7 1
8 32555