User Flashcards

1
Q

what are two ways a user can interact with the OS

A

command line
- shell, unix, errors, paths, pipes, links, setuid
programming interface
- dynamic memory allocation, locks, errors, shared memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a filing system

A

The filing system lives between the user applications – which want to handle files and the device drivers which move blocks of data to and fro

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does the file store (filing system) provide and allow for

A

it provides a large, persistent storage mechanism that allows for

  • IPC
  • access rights
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

describe how virtual devices are represented in windows vs unix

A

windows: each device has own tree
unix: branches off one tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a file

A

basic unit of storage in a filing system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

files are….

A

large
slow to access
permanent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what makes up a file

A

attributes and blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does a filing system access a file from a file name

A

each file has a filename that is abstracted to a handle which leads to a descriptor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how do we open a file

A

system call to fetch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how do we close a file

A

push any buffered data to the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how do we perform read/write, why

A

in blocks

to limit the number of system calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how do we perform seek on a file

A

it is costly, we treat the file as an array to allow for random access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is a memory mapped file

A

makes the file appear in a process’ virtual memory space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is file locking

A

placing a lock on a file prevents against race hazards. only one process can access it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a volume

A

a logical drive

corresponds to a disk partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

when is moving a file easy, when is it complicated

A

moving files within a volume is simple

moving files between volumes is difficult

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what are two file system implementation schemes

A

FAT and Inodes

18
Q

describe a file allocation table

A

have an array of cluster pointers.

the FAT table is a linked list

a directory gives a pointer to the start of a file

fragmentation is common

19
Q

what is a cluster

A

set of data blocks

20
Q

where is FAT most common, what about inodes?

A

fat in windows

inodes in unix

21
Q

describe inodes

A

a structure that contains file attributes and an array of pointers to blocks.

small and kept in memory only when file is in use

files are identified by inode number

22
Q

how many blocks of an inode point to other blocks

A

blocks 1-9 for small files
then a pointer that points to 10-17
next pointer, then pointer 18-81
finally, 82-593

23
Q

describe links

A

used to copy a file without duplicating data

24
Q

what is a symbolic link

A

a soft link, a pointer to the file

25
Q

what is a hard link

A

directory entry contains the inode number.

the file is the link

26
Q

what is a file descriptor

A

created when a file is opened

access permissions, current position, error status, control flags

27
Q

what is a library

A

a collection of code for common functions

28
Q

describe a static library

A

linked at compile time

29
Q

describe a dynamic library and its advantages

A

library code is not linked or included in the application

this saves space, is easier to maintain, and doesn’t need to be recompiled when it is changed

30
Q

what must a shared library be

A

re-entrant, relocatable, linked dynamically

31
Q

what is a shell

A

a user interface program that allows the user to give commands to the computer

32
Q

what is bash

A

allows us to launch programs with arguments and set up pipes

33
Q

what do shells allow

A

scripting and aliases

34
Q

what are environment variables

A

they belong to the environment of a process. maps names to values.

35
Q

how do we access environment variables in a shell

A

$

36
Q

what happens to environment variables when a process forks, what can we do to change this

A

the child does not inherit the environment variables.

export

37
Q

give some examples of environment variables

A

path

home

shell

random

manpath

38
Q

what is man

A

manual page reader in unix

39
Q

describe a file system

A

a usb will have its own file system, this will be different to that of the hard disk

they appear as separate devices

but files can easily be transferred back and forth

40
Q

what do we find within each block group on a disk partition

A

The superblock and group descriptor: specify details like the size of the group, the number of i-node entries, the start of the free-block list.

bitmaps- indicate whether a data block/i-node is used or not.

i-node table- array of records which defines both the file (data blocks) and its attributes.

41
Q

what is a directory

A

A file which contains a linked list of entries. File-names vary in length so space is allocated (and deallocated) in much the same way as RAM

42
Q

where is the filing system in a monolithic vs microkernel

A

In a ‘layered’ model the filing system is quite a high-level O.S. layer.

In a microkernel it may well be run (by the O.S.) in user mode.