CS 452/652 Fall 2019 - Lecture 8
September 20, 2019
prev next
RedBoot
- power cycle: all memory reset, devices reset
- soft reset (red button, reset command, watchdog: low (RedBoot) memory reset, devices reset
- program/kernel memory state from previous crash still available
- return from program/kernel: nothing reset
Task Creation
- allocate task descriptor
- determine unique task id
- set parent id → current task
- set priority
- set state (probably 'Ready')
- set up execution state (stack and/or task descriptor)
- SVC registers: spsr, lr
- user registers: as necessary
- prepare stack: address in user sp (remember stack is top-down)
- effectively simulate return from system call at the beginning of task's start routine
- task configuration: use single-argument short-cut (see kernel spec) or message passing
Communication
- only uses message passing, no shared memory!
- send-receive-reply (SRR) pattern
Message Passing
- send blocks until receiver has replied
- receiver waiting?
- yes: sender → reply-blocked; unblock receiver
- no: sender → send-blocked
- receive blocks until sender has sent
- sender waiting?
- yes: sender → reply-blocked; continue receiver
- no: receiver → receiver-blocked
- receiver can be decoupled from reply, i.e., receiver can effectively park sender
- reply never blocks
- sender must be waiting!
- unblock sender; continue receiver
- kernel provides this functionality
- provide mechanisms for blocking senders and/or receivers
- message copying for safe asynchronous operation of sender & receiver
- direct copy from sender to receiver and vice versa
- no message buffering in kernel
- kernel must also set return codes appropriately
- messages: structured data
- no conversion marshalling) needed as in heterogeneous distributed systems
- copied as byte (char) array
- type-checking: verify type of message for type of task?
⇒ need at least a global type field per message
Memory Isolation
- visibility: routine, file, global → limited protection
- hardware protection via MMU
- software protection
- programming languages (compiler & runtime): Java, Go
- other restrictions
Synchronization
- no shared memory; no memory synchronization
- no lock, semaphore, condition variable
- task synchronization via SRR
- resource synchronization via task patterns
- example: track server mediates access to track
- device synchronization via AwaitEvent() system call
Name Resolution
- pervasive topic in computer science
- examples:
- systems: memory address - name for circuit, name for device register
- programming: variable - name for memory location or register
- operating system: file - name for data on disk
- Internet: DNS - name for IP address
- Internet: URL - name for remote file/service and access protocol
- name resolution always starts in a default context with a default starting point!
- file system: / (slash) & kernel
- Internet domain names: . (dot) & local resolver
- this is called closure mechanism
- here: default name server
- implicit/default starting point: tid of name server
- use hack: global, hard-coded, other?
- tid-based communication facilitated by kernel (see 'Communication' above)