Questions & explanations
1. Give an example where RMS might fail to schedule tasks even though total CPU use is less than 100%.
Consider two tasks: Task A runs every 3 seconds and takes 2 seconds. Task B runs every 5 seconds and takes 2 seconds. Total CPU use is 2/3 + 2/5 = 1.07, over 100% so it fails. But even if under 100%, RMS can fail. For example, Task A: period 2, execution 1. Task B: period 3, execution 1.8. CPU use = 0.5 + 0.6 = 1.1 > 100%? Actually 0.5+0.6=1.1 >1, so fails. A working example: Task A: period 2, execution 1. Task B: period 3, execution 1. Total use = 0.5+0.333=0.833 < 0.828? Actually below 0.828 bound for 2 tasks? For 2 tasks bound ln2≈0.69? Wait, RMS bound for n tasks is n(2^(1/n)-1) which for n=2 is 2*(sqrt2-1)≈0.828. So 0.833 > 0.828, so RMS may fail. Example: Task A: period 2, exec 1; Task B: period 3, exec 1. Schedule: at time 0, A runs, finishes at 1. B runs from 1 to 2. At time 2, A must run again (deadline), B finishes at 2? Actually B runs from 1 to 2, finishes at 2. At time 2, A is ready, runs from 2 to 3, meets deadline. At time 3, B ready, runs from 3 to 4, meets deadline (period 3, deadline at 3? Actually period 3 means deadline at 3? If implicit deadline equal to period,
2. Give an example where EDF can schedule tasks that RMS cannot.
Consider two tasks: Task A: period 2, execution 1. Task B: period 3, execution 1.8. Total CPU use = 0.5+0.6=1.1 >100% so neither can schedule? Wait need under 100%. Let's change: Task A: period 2, exec 1; Task B: period 5, exec 3. Total use = 0.5+0.6=1.1? Actually 1/2=0.5, 3/5=0.6, total 1.1 >1, fails. Need example where RMS fails but EDF works. Classic: Task A: period 2, exec 1; Task B: period 3, exec 1. Total use 0.833. RMS fails because at time t, schedule: A at 0-1, B 1-2, A at 2-3 (deadline at 2? Actually deadline at 2, A finishes at 3 misses. So RMS fails. EDF can schedule: at time 0, A deadline 2, B deadline 3, so A runs 0-1. At time 1, A done, B runs 1-2. At time 2, A new job deadline 4, B still has deadline 3? Actually B ran from 1-2, finished at 2, so B done. A new job at time 2, deadline 4. So A runs 2-3. At time 3, A done, B new job deadline 6. No conflict. So EDF works. So answer: For two tasks with periods 2 and 3, both execution 1, EDF meets deadlines while RMS does not.
3. Compare embedded systems on a surface ship versus an underwater drone.
A surface ship has larger embedded systems with more processing power because space and cooling are easier. They can use standard parts and are not affected by pressure. Underwater drones need compact, power-efficient embedded computers that can withstand high pressure. They also must be very reliable because sending a repair robot is hard. Surface ships can use antennas for communication, while underwater drones rely on acoustic signals or cables. Both use GPS on the surface, but underwater they use inertial navigation or sonar beacons. Heat management is easier for ships because they have air cooling; underwater drones rely on conduction to the water.
4. How can hypervisor-based rootkits be detected?
Detection can be done by looking for signs of virtualization from inside the VM. For example, the rootkit's hypervisor may leave slight timing delays or CPU instruction differences. Security tools can measure these anomalies. Another method is to compare the system's behavior against known patterns. Some antimalware tools run a small hypervisor themselves to catch the rootkit. Hardware-assisted detection uses features in the CPU that the rootkit cannot hide. However, detection is difficult because the rootkit controls the OS's view. A more reliable method is to boot from a trusted external device and scan for the malicious hypervisor.
5. Compare embedded systems in a satellite versus a rover.
Satellites orbit in space with no gravity and face constant radiation, so their embedded systems must be radiation-hardened and carefully manage heat. Rovers are on a planet surface, dealing with dust, gravity, and temperature changes. Satellites have solar panels and batteries, and their embedded computer controls attitude, orbit, and communication. Rovers have similar needs but also must drive, avoid obstacles, and use robotic arms. Satellites can communicate with Earth more often because they are in line of sight; rovers have limited windows due to planetary rotation. Both use redundant systems to survive failures.
6. Explain one trade-off between performance and fault tolerance in consensus.
A common trade-off is between latency and resilience. For stronger fault tolerance, more messages must be exchanged and more nodes must respond. For example, in Byzantine fault tolerance, several rounds of communication are needed to verify messages, causing higher delay. Crash-tolerant algorithms need only a majority, so they can be faster. But to survive more failures, you might need a larger majority, which slows things down. Also, some algorithms use synchronous assumptions for faster agreement, but if the network is actually asynchronous, they may fail. So designers must choose the right balance for their system.
7. Compare embedded systems in a commercial aircraft versus a military fighter jet.
Commercial aircraft embedded systems prioritize safety and redundancy to protect passengers. They have strict certification and often use multiple backup computers. Military fighter jets require high performance, agility, and stealth. Their embedded systems must handle combat, electronic warfare, and secure communication. Fighter jets have systems to jam enemy radar and to fire weapons. Both use fly-by-wire where computers control the flight surfaces, but military versions are more agile. Commercial systems are designed for long, efficient flights; military systems prioritize quick response and survival in battle.
8. Compare the cost of running a startup's IT on-premises versus in the cloud.
On-premises IT requires upfront purchase of servers, networking, and storage, plus ongoing electricity, cooling, and maintenance staff. Cloud eliminates these capital expenses and turns them into variable operating costs. For a startup, the total cost of ownership (TCO) is often lower with cloud because they avoid over-provisioning for peak load. They also don't need to hire system administrators early on. However, as usage grows, cloud costs can become higher than on-premises if not managed well. The key is that cloud provides flexibility, which is typically more valuable for startups than long-term cost savings.
9. Compare using one central controller versus many distributed embedded nodes for temperature control in a building.
A central controller manages all heating and cooling from one point, which is simple but can fail entirely if the controller breaks. Distributed nodes have small embedded computers in each room that decide locally. Distributed systems are more reliable because if one node fails, other rooms still work. They also respond faster because decisions are made nearby. However, distributed nodes need more wiring or wireless communication and can be harder to program. Central controllers are cheaper to install but less flexible. Many modern buildings use a mix: zones with local controllers that report to a central system.
10. What is the role of a failure detector in fault-tolerant total order broadcast?
A failure detector tells a node whether another node has crashed. In total order broadcast, the leader (if used) needs to be replaced when it fails. The failure detector provides suspicion about crashes. However, failure detectors can be wrong (suspect a correct node). The algorithm must be designed to handle false suspicions. For example, in the Paxos algorithm, a node can start a new leader election if it suspects the current leader failed. If the old leader is still alive, it will be ignored once the new leader establishes authority. The accuracy of the failure detector affects performance but not correctness.
11. What is the FLP impossibility result and what does it imply for consensus?
The FLP impossibility result states that in a fully asynchronous system where messages can be delayed arbitrarily, no deterministic consensus algorithm can guarantee to reach agreement if even one node might crash. This means that consensus is impossible to guarantee in such a system. To work around this, practical algorithms use timeouts or other mechanisms to assume some synchrony. For example, Raft uses a leader election timeout to detect failures and proceed. The result does not mean consensus is impossible in practice; it just sets a theoretical limit that algorithms must use some form of timing assumptions.
12. Compare SubVirt and Blue Pill rootkits.
Both SubVirt and Blue Pill are hypervisor-based rootkits that insert a malicious hypervisor under the OS. SubVirt was a proof-of-concept from Microsoft research. Blue Pill was created by Joanna Rutkowska and uses AMD's virtualization technology. Blue Pill can be installed while the OS is running, without a reboot, by using a technique called a 'blue pill' injection. SubVirt generally required a reboot. Both are extremely stealthy. Detection is similar: look for signs of virtualization from inside the guest, like timing differences. Neither is common in the wild, but they demonstrate a powerful attack vector.