Professional Documents
Culture Documents
Bts WS1920 Exercise Sheet 05 Solution
Bts WS1920 Exercise Sheet 05 Solution
Static partitioning
f Dynamic partitioning
Buddy memory allocation
f Static partitioning
Dynamic partitioning
Buddy memory allocation
4. Which memory management method searches for the block, which fits best?
5. Which memory management concept searches for a free block, starting from
the beginning of the address space?
6. Which memory management concept fragments quickly the large area of free
space at the end of the address space?
8. Which memory management concept searches for a free block, starting from
the latest allocation?
The Buddy method for allocating memory to processes shall be used for a memory
with a capacity of 1024 kB. Perform the provided operations and give the occupancy
state of the memory after each operation.
Each process can access the entire memory, which can be addressed.
Each process can only access its own virtual memory. Virtual memory addres-
ses translates the CPU with the MMU into physical memory addresses.
Each process has a separate address space. This address space is an abstracti-
on of the physical memory. It implements virtual memory. It consists of logical
memory addresses, which are numbered from address 0 upwards and it is inde-
pendent from the storage technology used and the existing expansion options.
5. Explain, why virtual memory helps to better utilize the main memory.
Processes do not need to be located in one piece inside the main memory.
Therefore, the external fragmentation of the main memory is not a problem.
6. What is mapping?
7. What is swapping?
The process of relocating data from the main memory to the SDD/HDD and
back.
Paging.
11. What sort of fragmentation does occur with the concept of subtask 10?
Internal fragmentation. It can only occur in the last page of each process.
A process tries to access a page, which is not located in the physical main
memory.
13. What is the reaction of the operating system, when a page fault exception
occurs?
The operating system handles the page fault exception by executing these
steps:
• Allocate the page by using the controller and the device driver on the
swap memory (SSD/HDD).
• Copy the page into a free page of the main memory.
• Update the page table.
• Return control to the process. The process next tries to execute again the
instruction that caused the page fault.
14. What causes an access violation exception or general protection fault exception
to occur?
The currently running process, which is extended with swap memory (Win-
dows: page file).
Please mark for each one of the following statements, whether the statement is true
or false.
f True False
2. In protected mode, each process is executed in its own copy of the physical
address space, which is protected from other processes.
True f False
True f False
f True False
True f False
f True False
True f False
8. When paging is used, the MMU translates the logical memory addresses into
physical memory addresses.
True f False
9. Modern operating systems (for x86) operate in protected mode and use only
paging.
True f False
Because it is not possible to predict the future and therefore the future request
sequence is unknown.
2. Perform the access sequence with the replacement strategies Optimal, LRU,
LFU and FIFO once with a cache with a capacity of 4 pages and once with 5
pages. Also calculate the hit rate and the miss rate for all scenarios.
FIFO result in worse results for certain access sequences with a bigger memory.
4. Show Belady’s anomaly by performing the access sequence with the replace-
ment strategy FIFO once with a cache with a capacity of 3 pages and once
with 4 pages. Also calculate the hit rate and the miss rate for both scenarios.
Show Belady’s anomaly by performing the access sequence with the replace-
ment strategy FIFO once with a cache with a capacity of 3 pages and once
with 4 pages. Also calculate for both scenarios the hit rate and miss rate.
1. Create in your home directory a directory NotImportant and write a cron job,
which erases the content of the directory NotImportant every Tuesday at 1:25
clock am.
$ mkdir ~/NotImportant
$ crontab -e
2. Write a cron job, which appends a line at a file Datum.txt with the following
format (but with the current values) every 3 minutes between 14:00 to 15:00
clock on every Tuesday in the month of November:
$ crontab -e
3. Write an at-job, which outputs at 17:23 today a list of the running processes.
$ at 1725 today
ps -r
4. Write an at-job, which outputs at December 24th at 8:15 am the text „It’s
christmas!“
$ at 0815 DEZ 25
5. Create in your home directory a file Kanzler.txt with the following content:
$ sort ~/Kanzler.txt
7. Print out the file Kanzler.txt sorted by the third letter of the last names.
8. Print out the file Kanzler.txt sorted by the year of the inauguration.
9. Print out the file Kanzler.txt backward reverse sorted by the year of the
inauguration and redirect the output into a file Kanzlerdaten.txt.
10. Create with the command export an environment variable VAR1 and assign it
the value Testvariable.
$ export VAR01=Testvariable
$ printenv VAR01
$ unset VAR01