0% found this document useful (0 votes)
74 views

Assignment 2

This document is Muhammad Hanis Haziq Bin Jolhani's assignment 2 for the class SSK2. It contains questions regarding file systems, including file types and extensions, file operations, directory structures, file allocation methods, file protection types and permissions, and access control matrices.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Assignment 2

This document is Muhammad Hanis Haziq Bin Jolhani's assignment 2 for the class SSK2. It contains questions regarding file systems, including file types and extensions, file operations, directory structures, file allocation methods, file protection types and permissions, and access control matrices.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

( SSK20193 )

Assignment 2

NAMA: MUHAMMAD HANIS HAZIQ BIN JOLHANI

NO. MATRIK: S01SSK21F501

KELAS: SSK2

NAMA PENSYARAH: MUHAMMAD IRSYAD FAHMI BIN FADHIL


QUESTION 1

a. Fill in the blanks with correct filename extension for below file type:

File Type Usual extension Function


Word Processor Xml, docx Various word processor
formats
Archive Rar, zip Related files grouped
into one file, sometimes
compressed
Multimedia Mp3, mp4 Binary file containing
audio or A/V information
Executable Exe, bin Ready to run the
machine language
program
Source Code Java, cc Source code in various
language

b. Give four file operations in file management system and define the definition on each
operations.
1. Read – Reading from a file.
2. Write – Writing or rewriting the file.
3. Execute – Loading the file and after loading the execution process starts.
4. Delete – Deleting the file which is of no use and using its space for other data.

c. Illustrate the following directory structure.


i. Single level.
ii. Two level.
d. Explain three file allocation.
i. Contiguous Allocation.
- One of the most used methods for allocation. In this scheme, the blocks of
data are placed adjacent to each other in the hard disk. As an example, if
a file requires ‘n’ blocks and is given a ‘b’ block as the starting location,
then the blocks assigned to the file will be: b, b+1, b+2 until b+n-1. This
means that given the starting block address and the length of the file (in
terms of blocks required), the user can determine the blocks occupied by
the file.
The directory entry for a file with contiguous allocation contains:
 Address of starting block.
 Length of the allocated portion.

The file ‘mail’ in the following figure starts from the block 19 with length =
6 blocks. Therefore, it occupies 19, 20, 21, 22, 23, 24 blocks.
ii. Linked List Allocation.
- In this scheme, each file is a linked list of disk blocks which don’t have to
be contiguous. The disk blocks can be scattered anywhere on the disk.
The directory entry contains a pointer to the starting and the ending file
block. Each block contains a pointer to the next block occupied by the file.

The file ‘jeep’ in the following image shows how the blocks are randomly
distributed. The last block (25) contains -1 indicating a null pointer and
does not point to any other block.

iii. Indexed Allocation.


- In this scheme, a special block known as the Index block contains the
pointers to all the blocks occupied by a file. Each file has its own index
block. The ith entry in the index block contains the disk address of the ith
file block. The directory entry contains the address of the index block as
shown:
e. Illustrate the file allocation onto disk using contiguous file allocation method for the
following details then do the after compaction file allocation table.
f. Give two comparison of file allocation method between contiguous file allocation and
linked list allocation.

Contiguous File Allocation Linked List Allocation


Simple to calculate random Cannot calculate random addresses
addresses without reading previous blocks
External fragmentation No external fragmentation

QUESTION 2
a. Explain what the objective of file protection?
- In computer systems, a lot of user’s information is stored, the objective of
the operating system is to keep safe the data of the user from the
improper access to the system. Such as hacking, and other cyber attacks
or even from physical damage to the storage device.

b. There are 6 types of access protection file in operating system. Explain the following
type of access protection file:
i. Read – Allows or denies viewing of the attributes of a file or folder, such as
read-only and hidden.
ii. Write – Allows or denies changing of the attributes of a file or folder, such as
read-only or hidden
iii. Execute – Allows or denies running program files. (applies to files only)
iv. Append – Allows or denies making changes to the end of the file but not
changing, deleting, or overwriting existing data. (applies to files only)
v. Delete – Allows or denies deleting subfolders and files, even if the Delete
permission has not been granted on the subfolder or file. (applies to folders
and files)
vi. Updating – Updates files so it always remains up to date.

c. Explain types of users below:


i. Owner – The user who has created the file.
ii. Group – A set of members who has similar needs and they are sharing the
same file.
iii. Universe – In the system, all other users are under the category called
universe.

d. Fill and complete file permission reference diagram below:

Type Description
- Cannot do anything to file
Rwx Can read, write and execute file
Rw- Can read and write file
r-- Can only read file
e. Do capture screen as below instruction in file properties on your computer:
i. Show permission (administrator and everyone) for operating system.

ii. Show to change permission for everyone.


f. Explain what is the purpose of access control matrix.
- Used to define the rights of each process executing in the domain with
respect to each object. The rows of matrix represent domains and
columns represent objects.

g. Classify the following table into correct capability list for the following details:

File 1 File 2 File 3 File 4


Ali Rwx r-- r-- ---
Bala r-- Rwx r-- Rwx
Carol r-- --- Rwx Rwx
David --- r-- r-- r--

1. File 1:
 Ali can read, write and execute File 1.
 Bala can only read File 1.
 Carol can only read File 1.
 David cannot do anything to File 1.
2. File 2:
 Ali can only read File 2.
 Bala can read, write and execute File 2.
 Carol cannot do anything to File 2.
 David can only read File 2.
3. File 3:
 Ali can only read File 3.
 Bala can only read File 3.
 Carol can read, write and execute File 3.
 David can only read File 3.
4. File 4:
 Ali cannot do anything to File 4.
 Bala can read, write and execute File 4.
 Carol can read, write and execute File 4.
 David can only read File 4.

You might also like