Operating Systems
and Computer Structures G2
Tutorial Exercises, Week 13, 1996
-
Write a program in C
isdir
that takes one command line argument.
It should have an exit code of 0 if the argument is a directory, or other
values if it is not. Hint: use stat()
-
An existing file can have extra bytes appended to the end of it,
leaving the existing contents unaltered.
Discus how this can be done using
-
The MSDOS file system.
-
The Unix file system.
-
When a process attempts to delete a file, the Operating System must
ensure that the process has delete access to that file.
-
Using the Unix directory and inode structure, explain how Unix
can determine if the file
/student/os/file1
can be deleted by a process with a user id of 20 and a group id of 40.
-
Using the MSDOS FAT table structure, explain how MSDOS can determine
if the file
c:\windows\win386.swp
can be removed by
del
.
-
The memory of a system is 128 blocks and is organised using the
buddy system. Intitially all memory is free. Requests are
received of
obtain 6 blocks
obtain 10 blocks
obtain 16 blocks
obtain 8 blocks
Show the state of memory after each request.
-
In a virtual memory system, describe in less than one page
how a virtual address reference is translated into a physical
address.