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
what is a hard link
directory entry contains the inode number. | the file is the link
26
what is a file descriptor
created when a file is opened access permissions, current position, error status, control flags
27
what is a library
a collection of code for common functions
28
describe a static library
linked at compile time
29
describe a dynamic library and its advantages
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
what must a shared library be
re-entrant, relocatable, linked dynamically
31
what is a shell
a user interface program that allows the user to give commands to the computer
32
what is bash
allows us to launch programs with arguments and set up pipes
33
what do shells allow
scripting and aliases
34
what are environment variables
they belong to the environment of a process. maps names to values.
35
how do we access environment variables in a shell
$
36
what happens to environment variables when a process forks, what can we do to change this
the child does not inherit the environment variables. export
37
give some examples of environment variables
path home shell random manpath
38
what is man
manual page reader in unix
39
describe a file system
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
what do we find within each block group on a disk partition
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
what is a directory
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
where is the filing system in a monolithic vs microkernel
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.