vault backup: 2023-12-22 12:45:16

Affected files:
.obsidian/graph.json
.obsidian/workspace-mobile.json
.obsidian/workspace.json
Christmas Movies.md
Politcs/Fascism.md
Politcs/Neoliberalism/Neoliberalism.md
STEM/AI/Neural Networks/CNN/Interpretation.md
STEM/CS/Languages/Python.md
STEM/IOT/OS/Composition.md
STEM/IOT/OS/Contiki.md
STEM/IOT/OS/OS.md
STEM/IOT/OS/README.md
STEM/img/iot-event-based.png
STEM/img/iot-os-stack.png
STEM/img/iot-thread-based.png
This commit is contained in:
andy 2023-12-22 12:45:16 +00:00
parent 6b86705317
commit 3fc7fa863e
9 changed files with 218 additions and 2 deletions

View File

@ -12,7 +12,7 @@
- Update image - Update image
![am-process](../../../img/am-process.png) ![am-process](../../../img/am-process.png)
## R3egulariser ## Regulariser
- Fit to natural image statistics - Fit to natural image statistics
- Prone to high frequency noise - Prone to high frequency noise
- Minimise - Minimise

View File

@ -16,7 +16,7 @@ Compiler
Publication-quality Graphs Publication-quality Graphs
[NLTK](https://www.nltk.org) [NLTK](https://www.nltk.org)
NLP [NLP](../../Speech/NLP/NLP.md)
If you are not getting good results, you should first check that you are using the right [classification](../../AI/Classification/Classification.md) algorithm (is your data well fit to be classified by a linear SVM?) and that you have enough training data. Practically, that means you might consider visualizing your dataset through PCA or t-SNE to see how "clustered" your classes are, and checking how your classification metrics evolve with the amount of data your classifier is given. If you are not getting good results, you should first check that you are using the right [classification](../../AI/Classification/Classification.md) algorithm (is your data well fit to be classified by a linear SVM?) and that you have enough training data. Practically, that means you might consider visualizing your dataset through PCA or t-SNE to see how "clustered" your classes are, and checking how your classification metrics evolve with the amount of data your classifier is given.

50
IOT/OS/Composition.md Normal file
View File

@ -0,0 +1,50 @@
# Threading
*Smallest sequence of programmed instructions that can be managed independently by a [scheduler](https://en.wikipedia.org/wiki/Scheduling_(computing))*
From <[https://en.wikipedia.org/wiki/Thread_(computing)](https://en.wikipedia.org/wiki/Thread_(computing))>
- Instructions run independently by scheduler
- Single address space
- One thread blocked for I/O
- Tasks run in other threads
- Need locks and mutexes
- Coordination between threads
- Complicated
- Deadlocks
# Protothreads
- Lightweight
- Stack-less
- Interruptible tasks for event-based
- Conditional blocking statement
- Blocks until given statement is true
- Use timer to manage
- Invoked whenever process receives message from another process or timer
# Events
*Action or occurrence recognized by software, often originating asynchronously from the external environment, that may be [handled](https://en.wikipedia.org/wiki/Event_handler) by the software*
From <[https://en.wikipedia.org/wiki/Event_(computing)](https://en.wikipedia.org/wiki/Event_(computing))>
- Event loop
- Waits for events
- Inputs
- On event
- Collects info
- Dispatches to call-back
- Register handlers with OS scheduler
- Kernel usually runs loop to poll for events
- Blocking operation
- Register call-back
- Return control to scheduler
# Radio Sleep
- Energy efficiency
- Congestion
## Event-based
![](../../img/iot-event-based.png)
## Thread-based
![](../../img/iot-thread-based.png)
- Less complex
- Faster
- Pointer-based

78
IOT/OS/Contiki.md Normal file
View File

@ -0,0 +1,78 @@
- Linux-based
- Small memory (~20 kB)
- Wide network stacks
- TCP/IP
- IPv6
- 6LoWPAN
- IPv6-based
- Header compression
- CoAP
- Application layer protocol
- RPL
- Routing for low power
- Lossy networks
- SSL/TLS
- RIME
- Own communication solution
- Instant Contiki
- Dev environment
- Whole VM
# Functional
- Separates basic system from dynamically loadable and programmable services
- Processes
- Event-driven kernel
- Multi-threading supported by library
- Hybrid OS
- No hardware abstractions
- Services communicate by posting kernel events
- Refer to stack with pointer to process state
- Each service has state in private memory space
![](../../img/iot-os-stack.png)
# Process
- Cooperative
- Code running sequentially with respect to other coop code
- Pre-emptive
- Temporarily stops cooperative code
- Normal processes run cooperatively
- Interrupts and real-time timers run pre-emptively
- Higher priority
- Programs are processes
- Started on boot
- When module containing process loaded
- Processes run on timer firing or external events
# Timers
- Libraries
- Used by applications and system
- Check for timer completion
- Waking system from low power
- Real-time task scheduling
- Allows cooperation when threads sleep
- Low power mode
- timer and stimer
- Simplest
- See if time period passed
- Need querying
- etimer
- Event timers
- Scheduling
- Uses clock time from clock module
- struct etimer
## Clock
- System time starts from zero when the Contiki system starts
- clock_time()
- In ticks
- clock_seconds()
- In seconds
- CLOCK_SECOND
- Ticks per second
# Power Saving Mode
- Kernel does not provide any power saving abstractions
- Need to implement in application
- To help an application decide when to power down the system
- The event scheduler exposes the size of event queue
- If there were not events scheduled, this information can be used to power down the processor

87
IOT/OS/OS.md Normal file
View File

@ -0,0 +1,87 @@
- Thin software layer
- Basic programming abstractions
- Interact with hardware
- Schedule and prioritise tasks
- Mediate between applications and services requiring resources
[Comparison of Operating Systems TinyOS and Contiki](https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.636.3680&rep=rep1&type=pdf)
# Environment
- Energy efficiency
- Restricted code
- Compared to full OS
# Features
- Memory management
- Power management
- File management
- Networking
- Dev environment and tools
- Commands
- Interpreters
- Compilers
- Entry points for sensitive resources
- Input components
- Functional aspects
- Scheduling
- Multi-threading
- Interrupts
- Memory allocation
# Dynamic Programming
- Program parts of application after deployment
- Settings and requirements not known prior to deployment
- Can change over time
- Bug fixes or update requirements wile in operation
- Manual updates maybe not possible
- Needs boundaries between application and OS
- OS receive software updates and store in active memory
- Check this is an updated version
- Install and configure new version
# Paradigm
- Node-centric
- Focuses on software for each node
- Operating individually
- Application-centric
- Treat nodes as one application
- Requires collaboration between nodes
- Collection
- Dissemination
- Analysis and/or processing of generated and collected data
# Deploy to Mote
- Compile
- make TARGET=xm1000 _____
- Deploy
- make TARGET=xm1000 _____.upload
- As root
- Terminal
- make TARGET=xm1000 login
# TinyOS
*Embedded, component-based operating system and platform for low-power wireless devices, such as those used in [wireless sensor networks](https://en.wikipedia.org/wiki/Wireless_sensor_network) (WSNs), [smartdust](https://en.wikipedia.org/wiki/Smartdust), [ubiquitous computing](https://en.wikipedia.org/wiki/Ubiquitous_computing), [personal area networks](https://en.wikipedia.org/wiki/Personal_area_network), [building automation](https://en.wikipedia.org/wiki/Building_automation), and [smart meters](https://en.wikipedia.org/wiki/Smart_meter)*
From <[https://en.wikipedia.org/wiki/TinyOS](https://en.wikipedia.org/wiki/TinyOS)>
- Written in nesC
- Network Embedded Systems C
- Component-based
- Wired together to run applications
- Event-driven
- Extension to C
- Non-blocking
- One stack
- No abstraction between OS and application
- No dynamic programming
- I/O ops longer than hundreds of milliseconds are async
- Mainly event-based
# FreeRTOS
- Minimal ROM, RAM, processing overhead
- Bin image 6K - 12K
- 3 C files
- Smaller & easier real-time processing alternative
- Port layer
- Architecture specific part of port
- Officially supported or contributed
- Good for AWS

1
IOT/OS/README.md Symbolic link
View File

@ -0,0 +1 @@
OS.md

BIN
img/iot-event-based.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
img/iot-os-stack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
img/iot-thread-based.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB