CS 452/652 Winter 2023 - Lecture 1
Jan 10, 2023
next
Course Overview
tackle a difficult and sizeable implementation project!
key characteristics
full-stack, including low-level communication
timely interaction with real-world system: latency bottleneck
robustness against defects (train, switch, sensor)
Software Development
small kernel
no memory translation/protection, no file system
micro-kernel with send-receive-reply (SRR) communication
multi-threading, no locking → concurrency & non-determinism
interrupt handling
train control
model and control real-world system in software
multi-faceted problem space, inherent timing constraints
System Overview
train set, Märklin controller, RPi computer, Track PC, TFTP server, development computer (see
sketch
)
two-box model: development vs. execution
example code:
freestanding
(vs.
hosted
)
no kernel, no libc, no heap
explicit linking rules including linker script
standard library (newlib) is part of compiler
C++ can be used with additional libraries and linking rules
Assignment 0
assignment is out and due soon → start now
generic polling loop
for (;;) { if (c1) a1(); if (c2) a2(); ... }
Memory Layout
at runtime: code, data, no heap, stack
ELF file format - sections: text, data, bss
text and data are placed by boot process
entry point is learned by is well-defined
bss section must be zeroed by program itself
Build Environment
linking with libc
without MMU and/or other magic: SIMD/FP instructions require strict alignmen
not a problem, since kernels typically don't do FP
but: precompiled libc routines don't care
options:
do not use libc!
do not use those routines (see test in Makefile)
recompile libc?
linking and loading for C++: might need constructors, etc.