Lektion 1 Flashcards

1
Q

In X Windowing system, the application is a

A

client

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

In X Windowing system, the GUI machine is a

A

server

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

GNU means

A

GNU is Not Unix

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

GNU’s father was

A

Richard Stallman

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

GNU’s vision

A

Open and free OS

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

Unix was originally in internal project at

A

AT&T

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

Unix was originally written in

A

assembly

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

Unix was later ported to

A

C

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

Unix in C portability

A

10% had to be rewritten in assembly

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

Main variants of Unix

A

BSD-Unix and System V

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

AT&T’s Unix variant

A

System V

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

System V was developed by

A

AT&T

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

BSD was developed by

A

Berkley University

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

Sun Microsystems’ Unix variant

A

SunOS and Solaris

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

SunOS developed by

A

Sun

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

Solaris developed by

A

Sun

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

HPUX developed by

A

HP

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

AIX developed by

A

IBM

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

GPL

A

General Public License

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

copyleft

A

opposite of copyright

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

FSF

A

Free Software Foundation

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

Linus Torvald presented a Unix compatible kernel in

A

1991

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

What we call Linux, is really named

A

GNU/Linux

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

Linux is not really an OS, but

A

a kernel

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

XNU

A

kernel of iOS

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

Kernel of iOS is

A

XNU

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

XNU is based on

A

Mach, BSD

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

a “terminal” is a

A

command window

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

A terminal runs

A

a separate shell program

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

Default Linux shell program

A

bash

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

bash

A

gnu Bourne Again SHell

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

Executed at login

A

~/.bash_profile

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

executed at terminal start

A

~/.bashrc

34
Q

~

A

my home library

35
Q

my home library

A

~

36
Q

~/.bash_profile

A

at login

37
Q

~/.bashrc

A

at terminal start

38
Q

apropos

A

find man page of subject

39
Q

bash file extension

A

.sh

40
Q

file header to indicate bash script

A

!/bin/bash

41
Q

how to type ~

A

AltGr+ð SPACE

42
Q

see kernel version

A

uname -r

43
Q

see operating system

A

hostnamectl

44
Q

Tell bash to wait for the application it started to end

A

no & at the end of the command

45
Q

Tell bash to start a background application, and go on

A

& at the end of the command

46
Q

show the path

A

echo $PATH

47
Q

show path on separate lines

A

echo “${PATH//:/$’\n’}”

48
Q

run a make file to build a program

A

make

49
Q

stdio.h : no such file or directory

A

sudo apt-get install build-essential

50
Q

stderr

A

default: terminal

51
Q

stdout

A

default: terminal

52
Q

fprintf(stderr,”…”)

A

print to both stdout and stderr, but only once if they are the same.

53
Q

Asynchronous operation

A

events happen at

unpredictable times and in an unpredictable order

54
Q

Concurrency

A

sharing of resources in the same time frame

55
Q

quantum

A

CPU time allocated to a process before it has to let

another process run

56
Q

context-switch time

A

the time it takes to switch from executing one process to another

57
Q

Timesharing

A

the illusion that several processes execute simultaneously

58
Q

interruption

A

hardware flag, checked at each instruction cycle

59
Q

An event is asynchronous to an entity

A

if the time at which it occurs is not determined by that

entity

60
Q

timer

A

generates an interrupt after a specified interval of time (or cycles?)

61
Q

signal

A

software notification of an event

62
Q

stack canary

A

Known random value that must be overwritten to overwrite the return address

63
Q

A program whose execution has started but

has not yet terminated

A

is a process

64
Q

Each source file is compiled into

A

an object file

65
Q

Object files are

A

linked with libraries to produce an executable module

66
Q

At ececution, the executable module

A

is copied into a program image in main memory

67
Q

static storage

A

exists for the life of the process

68
Q

automatic storage

A

allocated when execution enters a block and deallocated when it leaves

69
Q

Interactions between processes

A
  • files
  • pipes
  • shared memory
  • network
70
Q

context switch

A

execution switches from one process to the next

71
Q

Threads

A
  • execute within the same process
  • avoid context switches
  • share code and data
72
Q

execution stack

A

a.k.a. call stack

73
Q

activation record

A

element on the call stack.

return address, parameters, register values to be reset on return

74
Q

void perror(const char *s);

A

Output to standard error gt he string and the message for the current errno

75
Q

char *strerror(int errnum)

A
  • returns a pointer to the system error message corresponding to the error code
  • produce informative messages
  • use it with functions that return error codes
    directly without setting errno
  • may change the static errno! (Not its parameter.) You should save and restore errno if you need to use it again!
  • the returned string may be overwritten by later calls.
76
Q

restarting library

A
  • restart.h

- r_*, eg restartng close is r_close

77
Q

a function that allocates memory should

A

either free the memory

or make a pointer available to the calling program

78
Q

Standard approaches to handling errors in UNIX

A
  • Print out an error message and exit the program (only in main).
  • Return –1 or NULL, and set an error indicator such as errno.
  • Return an error code.
79
Q

conditional compilation for error messages in functions

A
#define DEBUG /* comment this line out for no error messages */
int myfun(int x) {
   x++;
#ifdef DEBUG
   fprintf(stderr, "The current value of x is %d\n", x);
#endif
}

Alternative:
cc -DDEBUG …
om the compiler line

80
Q

restrict

A

require that ‘restricted’ parameters not occupy the same memory (typically because parameters are changed by the function)