systems architecture Flashcards

1
Q

why was web assembly developed

A

web browsers displayed html pages which were static but people wanted more dynamic pages

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

what is the purpose of web assembly

A

an environment to run any program in a browser without having to use a specific programming language
like a virtual machine within a web page
separate form the web page

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

what does DOM stand for and what is it

A

document object module; the data structure you’d interact with to change the webpage (essentially the webpage)

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

what do you do instead of interacting with the webpage directly

A

you have to load in external modules that allow you to interface with the webpage (usually through the javascript runtime in the browser)

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

what is memory like in web assembly

A

a linear sequence of bytes
memory is for data not code/instructions
Harvard architecture; data and instructions separate
no self modifying code

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

what types of instructions does wasm have

A

all assembly instructions
structured instructions; loops if statements etc
data has types

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

.wat

A

textual format for wasm

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

.wasm

A

binary format for wasm
most common representation

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

wasi

A

web assembly system interface; developed so people could use wasm outside of web pages
enables wasm to be used as a systems language or running on servers as an embedded scripting language

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

what are some problems with imbedded system languages and how could you get around them

A

security; can filter your inputs but people can get around this
the embedded program can access everything the program can; can use a virtual machine as they’re secure and nothing can escape them unless you do it purposefully

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

containers

A

a delivery mechanism that freezes os libraries utility tools etc so you can ship them to someone else and everything needed to run the program is in it but its still accessible to you

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

interactive programs

A

pauses and waits for the user inputs

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

batch programs

A

dont need a user input as they just continuously running

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

what type of connections does a tv have

A

all analogue

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

how does interlaced video work

A

breaks the image up into two fields (odd and even rows) showing half the image at a time

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

what are some positive and negatives of interlacing video

A
  • refreshing double the rows
    + refreshing each row half as often
  • each phosphor has to maintain its glow for half as long causing the image to flicker
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what are monitors

A

display equipment without a built in rf receiver for tv signals

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

what are some benefits fo the lcd/flatscreen

A

fixed resolution
scaling
efficient
light

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

crt

A

cathode ray tube; heavy
variable resolution and refresh rate
built in smoothing

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

what is the dominant digital connector

A

hdmi

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

why do graphics card need to have high speed

A

graphics involve huge amounts of data just in the image and will also need recources to make the images uploaded to them

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

what is the purpose of direct memory access (dma)

A

allow a controller within the computer to give commands for the memory access instead of the cpu doing everything

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

what is a negative of dma

A

because only one thing can use a bus at a time the dma and cpu signals may over lap or shock itself out

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

what is bus mastering and what can it be used for

A

the cpu disconnects from buses and gives control to something else
I/o devices

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

rendering

A

the process of drawing 3d graphics

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

in which two ways can data be stored for 2d graphics

A

store all the 1 bits then all the 2 bits etc then the image is represented by all these bit planes being combined (none of the pixels ars actually stored together)
store all the bits of colour information for a pixel together then repeat for all pixels in the image

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

how do colour modes work

A

uses the pallete approach:
pallete numbers (basically an id number) are stored which maps to rgb values therefore the image data is smaller and to change one colour you only have to change one value

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

what is a negative of using colour modes

A

the more colours you have the longer the id number will be so it gets to a certain point where you may aswekk just use rgb values

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

what are 2 2d graphics operations

A

‘blit’ing
sprites

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

‘blit’ing

A

used when you want to move a rectangle of image data to another location using a blitter

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

why dont we use memcopy() instead of blitting

A

time consuming and awkward
wouldn’t work for overlapping as you would just lose data

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

why do we use sprites

A

when you want to move a character you would’ve had to draw it then repaint the background which would be time consuming and twice as long

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

what are sprites

A

hardware support for small graphics region that could be drawn on top of the main image without overwriting the data so you can move them without redrawing the background
the hardware is told the screen location of the sprite and automatically drawn it there when rendering
eg cursor and mouse

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

how was 3d rendering initially done and what was the solution to this method

A

perspective projection; convert the 3d coordinated into 2d in a way that shows depth using a 4 x 4 matrix
created 3d accelerators as 3d rendering requires a lot of math

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

what are some examples of accelerated features that have been added to graphics cards

A

texture acceleration
texture compression
cube mapping; quickly render reflections and skyboxes
video acceleration

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

hardware transformations and lighting

A

accelerated lighting
different cards supported different features

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

graphical apis

A

eg. open gl
means you dont have to rewrite code to support a new card
acta s a middleware between user application and hardware

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

why is important for graphics card physics to be good

A

when things done look right the human eye notices v easily as we know how things should behave

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

how do graphics card work with physics

A

game middleware libraries eg physX implement real time physics simulations to help accelerate physics calculations

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

what are some different aspects of physics that should be covered

A

motion gravity destrcution
water flames cloths
rigid and soft body physics skeleton joints etc

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

gpgpu

A

general purpose gpu; accelerate non graphics programs using a graphics card if they use the same calculations using tricks e.g. encoding values into textures uploading them calculating your answer into a new texture and downloading and decoding that into your data

42
Q

what are shaders and what are the kind of things they do

A

programs that run on a graphics card/gpu
pixel shaders; run for everypixel on the screen eg change colour
vertex shader; run for every vertex to transform 3d coordinates to 2d coordinates
geometry shader; run for every primitive eg triangle
computers shaders; run programs not meant to generate images

43
Q

how do you get shaders onto the graphics card

A

upload them onto the cpu and they will run at the appropriate time

44
Q

shader languages

A

match the concepts that the gpu hardware is based on
it is compiled into native code to run on the gpu; either ahead of time and distributed with the software or at runtime

45
Q

what are some examples of shader languages

A

glsl; open gl shading language; high level based on c
cg/hlsl; designed for cg and directX window shaders

46
Q

what is a negative of compiling the shader language ahead of time

A

others can see the source code

47
Q

what are some negatives of using tricks with gpgpu

A

lots go overhead
could be faster

48
Q

cuda

A

Nvidias framework for general purpose computation on their gpus

49
Q

what is the purpose of an os

A

abstract hardware from user space program
allows each program to pretend its getting sole use of the hardware
prevent programs from interfering with each other
make efficient use fo system recourses

50
Q

what is the kernel

A

the core system maintaining the system
essentially the os

51
Q

what does the kernel do when the machine boots the cpu

A

sets up the most minimal things about the hardware

52
Q

what are the 2 types of kernels

A

monolithic
microkernels

53
Q

monolithic kernels

A

written as one big program

54
Q

micro kernels

A

splits functionality into different programs
if a program (anything that needs to talk with the kernel) wants to talk to the hardware it will send a message to the kernel which will then send a message to the hardware
reduces system crashes as you can just restart the program in the user space instead of the entire system going down and other programs being able to access memory

55
Q

kernel-mode code

A

code in the kernel has access to everything in the machine
needs to prevent/do things for user space programs

56
Q

how does the kernel restrict what each program can do

A

through protection rings

57
Q

protection rings

A

levels that specify which cpu operations are allowed at each level

58
Q

user-mode code

A

restricted; only does what the kernel permits
may not be able to call some opcodes

59
Q

process

A

the concept of a user space program running under a kernel | a program running on the machine managed by the os

60
Q

what does the os keep track of for each process/thread/task

A

the code being executed
memory it belongs to
recourses it has
security permissions
hardware infrastructure

61
Q

threads

A

allows you to have multiple programs running at the same time (either literally on multiple cores or figuratively by switching between each program)

62
Q

what are some positives of threads

A

good for speed (parallelly faster not linearly)
able to do something whilst theres a delay; eg reading a file
have access to everything within a process

63
Q

what does the os have to do in order to manage the thread + some examples of what it does

A

stores and restores things unique to the thread when switching between them
eg pointer and call stack
registers

64
Q

what is scheduling

A

one of the functions of the os for threads and processes

65
Q

what is time slicing

A

quickly switching between each process that’s running making it look like they’re all running at the same time

66
Q

what are the two types of timeslicing

A

cooperative
pre-emptive

67
Q

cooperative timeslicing + one negative

A

the process indicates when its ok to stop for a moment
under control of the program so if there’s no code to stop then it wont

68
Q

pre-emptive timeslicing

A

the os uses interrupts and timers to decide when to switch

69
Q

what are system calls and why do we need them

A

for communication with the kernel as processes and kernels are both protected
the boundary between user space and kernel space

70
Q

how do system calls work

A

indicate what you want the kernel to do
switch to kernel state
kernel does the request
switch back to user space

71
Q

why can’t system calls just be a function call

A

because that means that any user space code would be able to access the kernel

72
Q

how does a system call work if its a longer call

A

indicate that a system call needs to be run
switch from user space to kernel space
verify security
start system call
if it takes too long the process is marked as unrunnable
switch to other processes one or more times
when the call is over mark the process s runnable
witch back to user space

73
Q

how do we get into kernel space during system calls

A

there is a function for each system call (interrupt)
when its called the cpu stops what its doing and looks up the interrupt number
it transfers to kernel space inside the function where the interrupt handler is called
system call handler does what it needs to

74
Q

when are interrupts set up and by what

A

by the kernel at boot time

75
Q

what is an advantage of system calls

A

allow you to verify security; if they didnt need a kernel space switch then security checks could be bypassed by jumping to the instruction after the check

76
Q

wht are the two other approaches to system calls

A

message passing in micro kernels
pre-process virtualised devices

77
Q

message passing in microkernels

A

you pass messages into the kernel instead of passing control

78
Q

pre-process virtualised devices

A

virtualising parts of your computer
there is virtual memory for each program
the program kernel drivers and libraries are all compiled into one executable just for the program
essentially the program has its own kernel that only accesses parts of the machine

79
Q

how does the mmu (memory management unit) helps hardware support memory protection

A

controllers allows the os to mark different parts go memory as accessible to different processes which ensures that programs dont interfere with eachothers memory

80
Q

want does virtual memory do

A

allows each process to think its the only program using memory
prevents programs from accessing parts of memory that aren’t allowed
lets process use more memory than the machine physically has

81
Q

how does the os support virtual memory

A

the os has page tables that maps v/m to physical memory
its not done per address as there are so many so it would just waste space

82
Q

what is the role of the translation lookaside buffer

A

hardware automatic page table
when the cpu tries to access an address it is automatically mapped by the tlb into a different address
allows programs to be written with virtual memory bit access physical ones

83
Q

what is a tlb hit and miss

A

hit; the mapping exists and a value is found
miss; the tlb didn’t fiind a matching value in the table

84
Q

what can cause a tlb miss

A

you are trying to access a memory address that you dont have access to or doesn’t exist if this happens the os looks it up manually to check if it was and if it doesn’t then the individual process shuts down ( a form of memory protection )

the virtual address does exist but it doesn’t currently have a mapping in the page table

85
Q

what is page swapping

A

pages ares swapped in and out as needed
data in memory could be saved to a disk and restored when needed and files can be loaded back into memory when needed

86
Q

what controls how much virtual memory you can have

A

the number of bits in the address

87
Q

what are two types of scheduling

A

round robing; abc abc abc - if the process isn’t ready to run then its marked as un-runnable and wont be added to the round-robing until its runnable again
priority based; tasks with the highest priority are scheduled first

88
Q

what is a positive of round robing scheduling

A

fair; each process has the opportunity to make progress
if it wasn’t then programs would experience starvation as they wouldn’t get access to cpu recourses

89
Q

disk scheduling

A

the os wont necessarily read form a disk immediately as there a re probably a lot of r/w requests therefore there are scheduling algorithms for which jobs should be done in what order

90
Q

what is a negative of priority based scheduling and how is this solved

A

if its the same process with the highest priority then all the low priority processes become starved
every time a scheduling decision is made an increment is added to each process that wasn’t scheduled so priority is now based on the go priority plus the amount of time its been waiting
waiting longer = higher priority

91
Q

what does it mean for a network to offload

A

accelerating aspects of common network protocols
eg calculating/verifying check sums

92
Q

in which ways can you connect to a network

A

via network card
cables; card have a socket t plug in and send signals
wireless; cards have a radio and antenna to transmit signals

93
Q

osi model

A

7 layer model for standards

94
Q

internet protocol

A

4 layer model for standards

95
Q

host

A

computer on the network

96
Q

ip address

A

host have one or more
either ipv4 or ipv6
address names get converted into the ip using the dns (domain name system)

97
Q

port

A

a number that allows multiple networks to be running at one time
eg you know where to send to if the host is running multiple servers at once

98
Q

what are the two types of connections we can have on the internet

A

tcp/ip
udp

99
Q

connection based tcp/Ip

A

persistent connection
all data arrives in order
automatically resends data is lost or congested

100
Q

non-connection based udp

A

not persistent
not inorder
not reliable

101
Q

what can go wrong when sending data on networks

A

security
dns may fail
host may not be reachable
connection may drop part way through

102
Q

what are the 2 main network architectures

A

client server; central server
peer to peer; connecting to each host without server