aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Aktiva kurser.wiki59
-rw-r--r--Bluetooth-keypad.wiki13
-rw-r--r--Bookmarks.wiki33
-rw-r--r--Gamejam.wiki6
-rw-r--r--Humans are Adorable.wiki24
-rw-r--r--Kalenderhantering.wiki16
-rw-r--r--Kläder.wiki4
-rw-r--r--LiuformulaStudent.wiki7
-rw-r--r--Media.wiki36
-rw-r--r--Movies.wiki19
-rw-r--r--Operativsystem.wiki15
-rw-r--r--Pintos.wiki238
-rw-r--r--Spel.wiki16
-rw-r--r--Västgöta/kassa.wiki6
-rw-r--r--index.wiki13
-rw-r--r--lisam.wiki1
-rw-r--r--phone.wiki18
17 files changed, 303 insertions, 221 deletions
diff --git a/Aktiva kurser.wiki b/Aktiva kurser.wiki
deleted file mode 100644
index e606814..0000000
--- a/Aktiva kurser.wiki
+++ /dev/null
@@ -1,59 +0,0 @@
-== 5Ht1 ==
-
-| Course | Name | Pe | O | ? | HP |
-|--------|--------------------------------------------|----|---|---|----|
-| TGTU63 | Industrikunskap | G1 | f | - | 1* |
-| TDDC93 | Programutvecklingsmetodik teori | G2 | o | 1 | 4 |
-| TDDD88 | Logik | G1 | o | 2 | 5 |
-| TDDD91 | Ingenjörsprofessionalism, del 5 | G1 | o | - | 1* |
-| TSDT84 | Signaler och system samt transformer | G2 | o | 4 | 8* |
-| TSEA29 | Konstruktion med mikrodatorer, projektkurs | G2 | o | 3 | 8* |
-
-
-
-| Kod | namn | när | p | b | länk | HP | REG | WR | L |
-|--------|--------------------|-------|---|---|------|----|-----|----|---|
-| TSEA22 | Digitalteknik | VT 19 | 1 | 2 | [1] | 6 | X | | 1 |
-| TDDB68 | Pintos | VT 19 | 1 | 3 | [2] | 3 | X | X | |
-| TATA41 | Envariabelanalys 1 | VT 19 | 1 | 4 | | 6 | X | | |
-| TATA41 | Envariabelanalys 2 | VT 19 | 2 | 2 | | 6 | X | | |
-| TSEA82 | Datorteknik | VT 19 | 2 | 4 | [3] | 4 | X | | |
-| TSTE24 | Elektronik | HT 19 | | | | 4 | X | | |
-| | Java | | | | | 3* | | | |
-| TDDD98 | Ingprof 6 | | | | | 1 | X | | |
-| TDDD60 | Interaktiva System | VT 19 | 1 | 4 | | 4 | | | |
-
-- p := period
-- b := block
-- L := Lisam
-
-- [1] := https://liu.se/studieinfo/kurs/tsea22/vt-2019
-- [2] := https://liu.se/studieinfo/kurs/tddb68/vt-2019
-- [3] := https://liu.se/studieinfo/kurs/tsea29/ht-2019
-
-Prata med Aseel Berglund angående Ing. prof.
-
-
-Fysik -- allt
-Mekanik -- tentan
-inkeinkenn
-Envarre
-lervarre
-Java
-
-Ing-prof
-
-== TT ==
-- TDDC78 Programmering av pralelldatorer - metoder och verktyg
-- TFYA19 Kvantdatorer
- - https://www.ifm.liu.se/courses/tfya19/f11.htm
-
-------------
-
-| Kod | namn | när | p | b | länk | HP | REG | WR | L |
-|--------|------------|--------|---|---|------|----|-----|----|---|
-| TAOP33 | Optimering | HT 19 | 1 | 2 | | 4 | | | |
-| TSTE24 | Eliktronik | HT 19 | 1 | 3 | | 5 | | | |
-| TSDT84 | Sigsyssen | HT 19* | 2 | 3 | | 8 | | | |
-| TATA79 | Inken | HT 19 | 2 | 2 | | 6 | | | |
-| | | | | | | | | | |
diff --git a/Bluetooth-keypad.wiki b/Bluetooth-keypad.wiki
deleted file mode 100644
index d8b2c67..0000000
--- a/Bluetooth-keypad.wiki
+++ /dev/null
@@ -1,13 +0,0 @@
-- https://www.kernel.org/doc/Documentation/input/input.txt
-- https://www.kernel.org/doc/Documentation/input/joystick.txt
-- https://stackoverflow.com/questions/15949163/read-from-dev-input#15949311
-
-`/proc/bus/input/devices`
-
-`/sys/class/input`
-
-----------
-
-{{{
-$ jstest /dev/input/js0
-}}}
diff --git a/Bookmarks.wiki b/Bookmarks.wiki
deleted file mode 100644
index 5d72041..0000000
--- a/Bookmarks.wiki
+++ /dev/null
@@ -1,33 +0,0 @@
-= Bookmarks =
-
-== Feature list ==
-- work offline
-- full CLI interface
-- full HTTP/HTML interface
-- accessible from mobile
- - [share] button
-- Data
- - Link
- - Title
- - Abstract
- - Notes
- - [possibly]
- - Tags
- - Images
- - Path?
- - Remote TOC
-- Built in RSS reader?
-
-http://ogp.me/
-
-Possible data format:
-
-{{{lisp
-(entry
- (name "Wolfenstein Fast Ray Tracing")
- (url "http://blog.hornquist.se/hugo/?filename=20190615Wolenometry.md")
- (page-title "Wolfenometry")
- (site-name "HugoNikanors blogg")
- (abstract "As is well known Wolfenstein 3D is a 2D game, which uses simple raycasting to figure out the distance from the player to the wall's in front of her. As a small hobby project I set out to recreate this. Since my levels (like the original) are bound to a strict grid we don't actually have to do a \"real\" ray-caster. But can instead just calculate the distance to next tile-border the ray will pass through, and immediately jump there.")
- )
-}}}
diff --git a/Gamejam.wiki b/Gamejam.wiki
deleted file mode 100644
index 5e5aba3..0000000
--- a/Gamejam.wiki
+++ /dev/null
@@ -1,6 +0,0 @@
-Inverse cube law, Godzilla istadör.
-
-Spel där man försöker lura folk att godzilla finns på rikgit. Men
-egentligen är det bara en stor balong.
-
-Pizza-cutter world
diff --git a/Humans are Adorable.wiki b/Humans are Adorable.wiki
new file mode 100644
index 0000000..9fb5898
--- /dev/null
+++ b/Humans are Adorable.wiki
@@ -0,0 +1,24 @@
+= Humans are adorable. =
+
+Supporting evidence:
+
+1. Humans say 'ow', even if they haven't actually been hurt. It's just a thing they say when they think they might have been hurt, but aren't sure yet.
+2. Humans collect shiny things and decorate their bodies and nests with them. The shinier the better, although each individual has a unique taste for style and colouring.
+3. Humans are not an aquatic or even amphibious species, but they flock to bodies of water simply to play in it. They can't even hold their breath all that long; they just love to splash!
+4. When night falls and the sky goes dark, humans become drowsy and begin to cocoon themselves in soft, fluffy bedding.
+5. Some humans spend time in each other's nests! Just for fun! It's not their nest; they're just visiting each other.
+6. Some humans use pigments and dyes to make their bodies flashy and colorful! They even attach shiny dangly bits to their cartilaginous membranes!
+7. Humans are very clever, and sometimes adopt creatures from other species into their family units. They don't seem to notice the obvious differences, and often raise them alongside their own young!
+8. If a human sees another creature in distress, they can commonly be observed trying to help! Even at their own risk, most humans are deeply compassionate creatures!
+9. If a human hears a particularly catchy sound or tune, it will often mimic it, even to the point of annoying themselves!
+10. Sneezes are entirely involuntary, and completely adorable. Especially when the human in question becomes frustrated
+11. Humans love treats!!! Some more than others. Many humans will save these treats specifically for a later date when they are in need of comfort or reassurance. IE, pickles, pop tarts, Popsicles, etc
+12. They're learning to travel in space!!! They can't get very far, but they're trying!!! So far, they've made it to the end of their yard, and have found rocks.
+
+----
+
+The above text is not mine, and the author is currently unknown
+(_e.g._ I'm lazy). I'm rehosting it here since I like texts which puts
+the normal close to how we describe the abnormal.
+
+-- hugo
diff --git a/Kalenderhantering.wiki b/Kalenderhantering.wiki
deleted file mode 100644
index 8d2267d..0000000
--- a/Kalenderhantering.wiki
+++ /dev/null
@@ -1,16 +0,0 @@
-= Kalenderhantering =
-
-== Web-Ics ==
-https://github.com/hugonikanor/web-ics
-
-== Programm ==
-
-~/.config/vdirsyncer/script/
-
-Inehåller ett aldelles för krångligt programm för att generera
-vdirsyncers configfile. För tillfället fungerar projektet skapligt,
-men generar inte riktigt rätt config.
-
-Lägger projektet på is tills vidare och satte upp några vim-macron
-istället för den vanliga filen.
-
diff --git a/Kläder.wiki b/Kläder.wiki
index a2af5d2..55dbf15 100644
--- a/Kläder.wiki
+++ b/Kläder.wiki
@@ -2,6 +2,7 @@
- [[#Kläder, klädstorlekar, m.m.|Kläder, klädstorlekar, m.m.]]
- [[#Kläder, klädstorlekar, m.m.#Mina Mått|Mina Mått]]
- [[#Kläder, klädstorlekar, m.m.#Dressmann "Slim Fit" measurements|Dressmann "Slim Fit" measurements]]
+ - [[#Mina Mått|Mina Mått]]
= Kläder, klädstorlekar, m.m. =
@@ -24,3 +25,6 @@ Dressman skortja 37/38, se [[#dressman|nedan]]
| XL | 43/44 | 126 | 118 | 85 | 94 |
| XXL | 45/46 | 134 | 126 | 88 | 95 |
| 3XL | 47/48 | 142 | 134 | 88 | 96 |
+
+= Mina Mått =
+- Skojrta :: S 37/38 Slim fit
diff --git a/LiuformulaStudent.wiki b/LiuformulaStudent.wiki
deleted file mode 100644
index aaa180b..0000000
--- a/LiuformulaStudent.wiki
+++ /dev/null
@@ -1,7 +0,0 @@
-joomla för frontend
-
-https://liuformulastudent.se/administrator
-
-== Rules ==
-
-=== DV Driverless Vehicles ===
diff --git a/Media.wiki b/Media.wiki
index 0af4ea2..c90dfeb 100644
--- a/Media.wiki
+++ b/Media.wiki
@@ -6,3 +6,39 @@ Teolog
- Player Piano
- https://pragprog.com/book/tpp20/the-pragmatic-programmer-20th-anniversary-edition
+== Movies ==
+Filmer jag vill eller har sätt, samt möjligen korta recensioner av
+dem.
+=== Wreck it Ralph 2 ===
+=== Incredibles 2 ===
+=== Juno ===
+Om gravid tonåring
+=== Liar, Liar ===
+
+=== The Act ===
+TV-Serie, HBO
+
+Åtminstånde ett avsnitt handlar om den där tjejen som psykologikst
+misshandlas av sin mor.
+
+=== American ultra ===
+=== The Princess Bride ===
+=== Last Action Hero ===
+=== Metropolis ===
+
+== Spel ==
+Olika (dator-) spel, troligen en lista på sånna jag vill köra men inte
+har kört.
+
+=== PS3 ===
+- [ ] Metal Gear Solid HD Collection
+- [ ] Metal Gear Solid IV
+- [ ] The Elder Scrolls IV Oblivion
+- [ ] Demon's Souls
+- [ ] Ni No Kuni
+- [ ] Little Big Planet
+- [X] ICO/Shadow of the Colossus HD Collection
+- [ ] The Last of Us
+
+=== Switch ===
+- [ ] Dead Cells
diff --git a/Movies.wiki b/Movies.wiki
deleted file mode 100644
index e00286c..0000000
--- a/Movies.wiki
+++ /dev/null
@@ -1,19 +0,0 @@
-= Movies =
-Filmer jag vill eller har sätt, samt möjligen korta recensioner av
-dem.
-== Wreck it Ralph 2 ==
-== Incredibles 2 ==
-== Juno ==
-Om gravid tonåring
-== Liar, Liar ==
-
-== The Act ==
-TV-Serie, HBO
-
-Åtminstånde ett avsnitt handlar om den där tjejen som psykologikst
-misshandlas av sin mor.
-
-== American ultra ==
-== The Princess Bride ==
-== Last Action Hero ==
-== Metropolis ==
diff --git a/Operativsystem.wiki b/Operativsystem.wiki
deleted file mode 100644
index 1e6b5a0..0000000
--- a/Operativsystem.wiki
+++ /dev/null
@@ -1,15 +0,0 @@
-= Operativsystem =
-== Multiplexing ==
-[[pdf:mos#37]]
-Sharing resources between processes.
-
-116
-
- The UNIX system has a command, _nice_, which allows a user to
- valuntarily reduce the priority of his process, in order to be
- nice to the other users. Nobody ever uses it.
-p160 [191]
-
-
-= References =
-1. mos :: Andrew S Tannenbaum - Modern Operating Systems (4th edition)
diff --git a/Pintos.wiki b/Pintos.wiki
index d47eb1c..05f6d26 100644
--- a/Pintos.wiki
+++ b/Pintos.wiki
@@ -46,3 +46,241 @@ ttps://www.ida.liu.se/~TDDB68/labs/Lab1.pdf
- `threads/interrupt.{h,c}` :: Important structures
- `lib/syscal-nr.h` :: Syscall numbers
- `filesys/filesys.{h,c}` :: Pintos file system
+
+
+
+
+----------------------------------------
+
+ A barrier synchronization is a function that does not return control to the
+ caller until all p threads of a multithreaded process have called it.
+
+ A possible implementation of the barrier function uses a shared counter
+ variable that is initialized to 0 at program start and incremented by each
+ barrier-invoking thread, and the barrier function returns if counter has
+ reached value p.
+
+ We assume here that p is fixed and can be obtained by calling a function
+ get_nthreads(), that load and store operations perform atomically, and that
+ each thread will only call the barrier function once.
+
+ The following code is given as a starting point:
+
+
+ {{{c
+ static volatile int counter = 0; // shared variable
+
+ void barrier( void )
+ {
+ counter = counter + 1;
+ while (counter != get_nthreads())
+ ; // busy waiting
+ return;
+ }
+ }}}
+
+1.
+
+{{{c
+static volatile int counter = 0; // shared variable
+static mutex lock; // shared mutex
+
+void barrier( void )
+{
+ lock(lock);
+ counter = counter + 1;
+ unlock(lock);
+ while (counter != get_nthreads())
+ ; // busy waiting
+ return;
+}
+}}}
+
+
+2.
+
+ Show by an example scenario with p=2 threads (i.e., some unfortunate
+ interleaving of thread execution over time) that this implementation of barrier
+ may cause a program calling it (such as the following) to hang.
+
+ {{{c
+ void main( void )
+ {
+ ... // create p threads in total
+ ...
+ barrier();
+ ...
+ }
+ }}}
+
+One simple case would be that thread 1 gets swapped out between reading and
+writing the counter, meaning that two threads write the same incremented value
+back, dropping one of the +1s. This mean that both threads are stuck waiting
+counter to hit 2, which it never will.
+
+| Thread 1 | Thread 2 | `counter` |
+|-------------------|-------------------|-----------|
+| load counter | | 0 |
+| | load counter | 0 |
+| | increment counter | 0 |
+| | store counter | 0 + 1 |
+| increment counter | | 0 + 1 |
+| store counter | | 0 + 1 |
+
+3.
+ Today, many processors offer some type of atomic operation(s). Can you use here
+ an atomic fetch_and_add operation instead of the mutex lock to guarantee
+ correct execution? If yes, show how to modify the code above and explain. If
+ not, explain why.
+
+
+{{{c
+static volatile int counter = 0; // shared variable
+
+void barrier( void )
+{
+ fetch_and_add(counter, 1);
+
+ while (counter != get_nthreads())
+ ; // busy waiting
+ return;
+}
+}}}
+
+A fetch and add intstruction should behave just as our above example with a
+lock around the modification.
+
+4.
+ Suggest a suitable way to extend the (properly synchronized) code from question
+ 2 to avoid busy waiting. Show the resulting pseudocode.
+
+{{{c
+static volatile int counter = 0; // shared variable
+static mutex lock; // shared mutex
+semaphore bar = 0;
+
+void barrier( void )
+{
+ lock(lock);
+ counter = counter + 1;
+ unlock(lock);
+ if (counter != get_nthreads()) {
+ // unlock all locked threads if we are the last thread.
+ for ( i ∈ [0, get_nthreads()) ) {
+ sema_up (bar);
+ }
+ } else {
+ // lock this thread
+ sema_down (bar);
+ }
+ return;
+}
+}}}
+
+5.
+ Consider the following (Unix) C program.
+
+ {{{c
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+ int main() {
+ pid_t pid1 = fork();
+ if (pid1 == 0) {
+ printf("A");
+ }
+ printf("A");
+ }
+ }}}
+
+ How many times will the letter A be printed to the standard output when
+ executing this program?
+
+3
+
+6.
+
+ Every process is associated with a number of areas in memory used to store the
+ program code, variables, etc. For each memory item below connect it with
+ correct allocation option. Note that that options can be used more than once
+ and not all options must be chosen.
+
+| The page table of a process | __allocated in kernel memory__ |
+| The memory used to store the content of a function parameter | stack |
+| Memory allocated using malloc | heap |
+| The compiled machine code of a program | text section |
+| A global (static) variable | data section |
+| The memory used to store a local variable declared in a function | stack |
+| | |
+
+7.
+
+ Give an example of a situation (table with jobs) where the SJF
+ algorithm provides better performance as measured by average
+ turnaround time compared to FCFS. There must be at least 4 jobs in the
+ table and your example must not be copied from anywhere. Motivate by
+ showing the average turnaround time for both algorithms.
+
+Please view answer with a monospaced font.
+
+| P | time | arrival |
+|---|------|---------|
+| 1 | 1000 | 0 |
+| 2 | 1 | 1 |
+| 3 | 1 | 2 |
+| 4 | 1 | 3 |
+
+*First come first serve* would use the first 1000 time units for
+process 1, and then do process 2, 3 & 4 thereafter. Giving waiting
+times
+
+| P | wait time |
+|---|-----------|
+| 1 | 1000 |
+| 2 | 1000 |
+| 3 | 1000 |
+| 4 | 1000 |
+(Forgive possible of by one errors from staggered start times)
+
+or an average of 1000 time units.
+
+*Shortest Job first* (with preemption) would instead force the first process to
+wait for all the shorter processes. Giving the following wait times.
+| P | wait time |
+|---|-----------|
+| 1 | 1003 |
+| 2 | 1 |
+| 3 | 1 |
+| 4 | 1 |
+Which is an average of ≈ 250 time units. Which is significantly lower than 1000.
+
+8.
+
+Banker's algorithm is a deadlock [detecting] algorithm. Freedom from deadlocks
+is a [necessary] condition for ensuring progress. The algorithm guarantees that
+only so-called [safe] states will be reached by checking every resource
+allocation request. If a resource allocation leads to an undesired state, the
+request is [rejected].
+
+
+
+== 9. Explain how paging supports sharing of memory between processes. ==
+
+Common code (such as libraries) are can be loaded once into a set of pages, and
+then simply mapped into all the processes that need them. Since they should be
+mapped read only it should be indistinguishable from having the library copied
+into memory for each process (except the smaller memory usage).
+
+Memory pages can also manually be mapped into multiple processes (e.g. mmap),
+and then be used as a shared data area.
+
+10.
+ Explain why page faults occur, under what circumstances and what happens
+ after. Describe the set of events step by step, considering also the
+ possibility of there being no free frames. For each step describe where the
+ logic that executes this step is located (e.g., OS kernel, MMU, program
+ code).
+
+A page fault occurs when a process attempts to access memory in a currently
+unmapped page.
+
diff --git a/Spel.wiki b/Spel.wiki
deleted file mode 100644
index d356eaf..0000000
--- a/Spel.wiki
+++ /dev/null
@@ -1,16 +0,0 @@
-= Spel =
-Olika (dator-) spel, troligen en lista på sånna jag vill köra men inte
-har kört.
-
-== PS3 ==
-- [ ] Metal Gear Solid HD Collection
-- [ ] Metal Gear Solid IV
-- [ ] The Elder Scrolls IV Oblivion
-- [ ] Demon's Souls
-- [ ] Ni No Kuni
-- [ ] Little Big Planet
-- [X] ICO/Shadow of the Colossus HD Collection
-- [ ] The Last of Us
-
-== Switch ==
-- [ ] Dead Cells
diff --git a/Västgöta/kassa.wiki b/Västgöta/kassa.wiki
deleted file mode 100644
index ff65b50..0000000
--- a/Västgöta/kassa.wiki
+++ /dev/null
@@ -1,6 +0,0 @@
-= Västgöta kassasystem =
-
-== Admin ==
-- [ ] Produktlista bör visa lagerstatus
-- [ ] Ta bort lager-fliken
-- [ ] Synka mot skuldlista
diff --git a/index.wiki b/index.wiki
index 56fbc6e..6082dfe 100644
--- a/index.wiki
+++ b/index.wiki
@@ -2,14 +2,10 @@
- [[Vimwiki]] (my user guide)
- [[GitServer]]
-- [[Aktiva kurser]]
-- [[Kalenderhantering]]
- [[Västgöta/webbsida]]
-- [[Västgöta/kassa]]
- [[Västgöta/veckomail]]
- [[KMM]]
- [[Media]]
-- [[Movies]]
- [[Tobbez]]
- [[TeliaNet]]
- [[TempSMS]] (burner)
@@ -19,9 +15,7 @@
- [[Dator/Hornquist]]
- [[Dator/Hjalmar]]
- [[luacrypto]]
-- [[Bluetooth-keypad]]
- [[Terminal Driver]]
-- [[phone]]
- [[switch]]
- [[televäxel]]
- [[Lysator]]
@@ -31,27 +25,22 @@
- [[Scripts]]
- [[VHDL]]
- [[Colors]]
-- [[Operativsystem]]
- [[Matlab]]
- [[TexServer]]
- [[Nginx]]
- [[MediawikiFS]]
-- [[Spel]]
-- [[Gamejam]]
- [[LiTHeKod]]
-- [[Bookmarks]]
- [[Kläder]]
- [[TaskApp]]
-- [[LiuformulaStudent]]
- [[C++]]
- [[Pintos]]
- [[IMAP-notifications]]
- [[Runor]]
- [[adrift.space]]
-- [[lisam]]
- [[Svenkst Arkiv]]
- [[picase]]
- [[Adafruit]]
+- [[Humans are Adorable]]
* [[diary/diary|Dagbok]]
diff --git a/lisam.wiki b/lisam.wiki
deleted file mode 100644
index 9c6f306..0000000
--- a/lisam.wiki
+++ /dev/null
@@ -1 +0,0 @@
-> Du kan inte ladda ner filer, eftersom popup-fönster är blockerat i din webbläsare.
diff --git a/phone.wiki b/phone.wiki
deleted file mode 100644
index e6e2a08..0000000
--- a/phone.wiki
+++ /dev/null
@@ -1,18 +0,0 @@
-= Krav =
-https://www.prisjakt.nu/produkt.php?j=1074844,3679808,4700449,4907807,4756011,4917603,
-== Måste ==
-- Bra batteritid
-- Bra appstöd
-- Stabil
-
-== Gärna ==
-- NFC
-- snabbladdning
-
-= Alternativ =
-- Nokia 1
- - Verkar ha bra appstöd
- - Bra batteritid
- - - ingen NFC
- - - ingen snabbladdning
-- Motorola E5 Play