diff --git a/20220928/es-20220928.tex b/20220928/es-20220928.tex index 2c077746ecd01b687c5710718850c15938883f77..2df14e951fc70e3e1cc5ef80c3451ff49e07baca 100644 --- a/20220928/es-20220928.tex +++ b/20220928/es-20220928.tex @@ -20,7 +20,7 @@ % Attribution-ShareAlike 3.0 Unported License along with this % document. If not, see <http://creativecommons.org/licenses/>. -% README: Einführung: eingebettete Systeme, Unix-Kommandozeile +% README: Einführung: eingebettete Systeme, Unix \documentclass[10pt,t]{beamer} diff --git a/20221005/csa2.jpg b/20221005/csa2.jpg new file mode 120000 index 0000000000000000000000000000000000000000..b5bd4b2df223c36917de442b4e198aa46787f05b --- /dev/null +++ b/20221005/csa2.jpg @@ -0,0 +1 @@ +../common/csa2.jpg \ No newline at end of file diff --git a/20221005/es-20221005.pdf b/20221005/es-20221005.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c51b1353565cf26538d2e45bcf42f442f2eb223e Binary files /dev/null and b/20221005/es-20221005.pdf differ diff --git a/20221005/es-20221005.tex b/20221005/es-20221005.tex new file mode 100644 index 0000000000000000000000000000000000000000..89faabb2ed87d965c542c95b78f78e69a3b5a71a --- /dev/null +++ b/20221005/es-20221005.tex @@ -0,0 +1,1036 @@ +% es-20221005.pdf - Lecture Slides on Embedded Systems +% Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +% README: Unix-Kommandozeile, Shell-Skripte + +\documentclass[10pt,t]{beamer} + +\usepackage{pgslides} +\usepackage{rotating} +\usepackage{tikz} + +\newcommand{\underconstruction}{% + \begin{picture}(0,0) + \put(9,0.9){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}} + \put(9,0.6){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}} + \end{picture}} + +\title{Eingebettete Systeme} +\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski} +\date{5.\ Oktober 2022} + +\newcommand{\greyurl}[1]{\href{#1}{\color{gray}\nolinkurl{#1}}} +\newcommand{\ItwoC}{I\raisebox{0.5ex}{\footnotesize 2}C} + +\begin{document} + +\iftrue + +\maketitleframe + +\else + +\begin{frame}[plain,fragile] + + \vspace*{8cm} + \begin{picture}(0,0) +% \put(12.3,8.0){\makebox(0,0)[tr]{\LARGE\bf\color{gray}\shortstack[r]{% +% {\normalsize Software-Entwicklung für}\\[0.5ex] + \put(12.3,8.0){\makebox(0,0)[tr]{\LARGE\bf\color{gray}\shortstack[r]{% + Eingebettete Systeme\\[2ex] + \includegraphics[width=4.3cm]{logo-hochschule-bochum.pdf}}}} + %\put(9.5,6.677) % zum Vergleich + \put(0.0,8.0){\makebox(0,0)[tl]{\includegraphics[width=2.87cm]{logo-hochschule-bochum-cvh-text-v2.pdf}}} + \end{picture}% + \begin{picture}(-0.3,-0.5) +% \put(0,0.5){\includegraphics[width=5.6cm]{floppys.jpg}} + \put(0,-0.3){\includegraphics[width=5.6cm]{wetterstation.jpg}} + \end{picture}% + \begin{picture}(0,0) + \put(1.0,4.1){\includegraphics[width=5.6cm]{floppys.jpg}} +% \put(1.7,3.1){\includegraphics[width=6.3cm]{hexapode.png}} + \end{picture}% + \begin{picture}(0,0) + \put(6.1,-0.7){\includegraphics[width=6cm]{csa2.jpg}} + \end{picture} + \begin{picture}(0,0) + \put(0.2,-1.1){\makebox(0,0)[bl]{\bf\color{gray}\shortstack[l]{\insertauthor\\[\smallskipamount]\insertdate}}} + \put(12.4,-1.1){\makebox(0,0)[r]{\greyurl{https://www.peter.gerwinski.de/}}} + \put(4.35,-0.9){\only<2->{\makebox(0,0)[br]{\tikz{\draw[-latex,red](0,0)--(-1.55,0.3);}}}} + \put(4.0,-0.8){\only<2->{\makebox(0,0)[tl]{\footnotesize\color{red}\shortstack{% + \emph{rerum naturalium}\\der Naturwissenschaften}}}} + \end{picture} + +\end{frame} + +\fi + +\sectionnonumber{Vorab: Online-Werkzeuge} + +\begin{frame} + + \showsectionnonumber + \begin{itemize} + \item + Diese Veranstaltung findet \textbf{in Präsenz} statt.\\ + Wir versuchen aber, auch eine Online-Teilnahme zu ermöglichen. + \medskip + \item + \textbf{Mumble}: Seminarraum 2\\ + Fragen: Mikrofon einschalten oder über den Chat\\ + Umfragen: über den Chat -- \textbf{auch während der Präsenz-Veranstaltung} + \smallskip + \item + \textbf{VNC}: Kanal 6, Passwort: \lstinline[style=cmd]{testcvh}\\ + Eigenen Bildschirm freigeben: VNC-Software oder Web-Interface \emph{yesVNC}\\ + Eigenes Kamerabild übertragen: Web-Interface \emph{CVH-Camera} + \smallskip + \item + Allgemeine Informationen: + \url{https://www.cvh-server.de/online-werkzeuge/} + \smallskip + \item + Notfall-Schnellzugang: \url{https://www.cvh-server.de/virtuelle-raeume/}\\ + Seminarraum 2, VNC-Passwort: \lstinline[style=cmd]{testcvh} + \smallskip + \item + Bei Problemen: bitte notieren:\\ + Art des Problems, genaue Uhrzeit, eigener Internet-Zugang + \bigskip + \item + GitLab: \url{https://gitlab.cvh-server.de/pgerwinski/es} + \end{itemize} + +\end{frame} + +\sectionnonumber{Was sind eingebettete Systeme?} + +\begin{frame} + + \showsectionnonumber + + \emph{Der Ausdruck \textbf{\newterm{eingebettetes System\/}} (\dots\,) bezeichnet + einen elektronischen Rechner oder auch Computer, + der in einen technischen Kontext eingebunden (eingebettet) ist.} + \vspace*{-0.5cm} + \begin{flushright} + \url{https://de.wikipedia.org/wiki/Eingebettetes_System} + \end{flushright} + + \begin{itemize} + \pause + \item + \emph{keine\/} Aussage über die Größe + \item + in der Praxis: so klein wie möglich\only<4->{, z.\,B.:}\\[\smallskipamount] + \only<3>{\vspace*{-3.3cm}\hspace*{0.7cm}\includegraphics[height=8cm]{csa2.jpg}\hspace*{-1cm}\vspace*{-8cm}} + \pause + \pause + \begin{itemize} + \item + mehrere Rechnerschränke + \item + Industrie-PC + \item + Einplatinencomputer + \item + Mikro-Controller + \end{itemize} +% \pause + \item + Bedienung über spezielle Ein-/Ausgabegeräte (z.\,B.\ PKW, Telefon) +% \pause + \item + Wartung über speziellen Adminstrator-Zugang + \begin{itemize} + \item + Bus-Schnittstelle (RS-232, CAN-BUS) + \item + Netzwerk (TCP/IP, Ethernet oder WLAN) + \end{itemize} +% \pause + \item + Programmierung oft außerhalb des Systems\\ + (Cross-Entwicklungswerkzeuge) + \end{itemize} + \vspace*{-1cm} + +\end{frame} + +\sectionnonumber{In dieser Lehrveranstaltung} + +\begin{frame} + + \showsectionnonumber + \vspace*{-\medskipamount} + \begin{itemize} + \item + Einführung in Unix + \item + TCP/IP und Bus-Systeme in der Praxis + \item + C-Programmierung für Fortgeschrittene + \item + Echtzeit-Systeme in Theorie und Praxis + \medskip + \item + Prüfungsleistung: Projektaufgabe\\ + Eingebettetes System eigener Wahl zum Laufen bringen + \arrowitem + {\color{red}Projektaufgabe überlegen} + \end{itemize} + +\iffalse + + \bigskip + + {\color{gray} + Weitere Ideen: + \begin{itemize} + \item + {\color{black}im Sommer: Exkursion: Lufthansa Aviation Training, Frankfurt am Main} + \item[\color{gray}$\bullet$]\color{gray} + falls möglich: Exkursion: TFC -- Simulatoren und Technik GmbH, Velbert-Nierenhof + \item[\color{gray}$\bullet$]\color{gray} + Einführung in die GUI-Programmierung + \item[\color{gray}$\bullet$]\color{gray} + Web-Interfaces + \end{itemize}} + + \vspace*{-1cm plus 1filll} + + \underconstruction + +\fi + +\end{frame} + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/es}}} + \begin{itemize} + \color{medgreen} + \item[1.1] Was sind eingebettete Systeme? +% \item[1.2] Vertiefung Systemtechnik + \item[1.2] In dieser Lehrveranstaltung + \end{itemize} + \item[\textbf{2}] \textbf{Einführung in Unix} + \begin{itemize} + \item[2.1] \color{red}Grundkonzepte + \item[2.2] Die Kommandozeile: Grundlagen + \item[2.3] Dateisysteme + \item[2.4] Ein- und Ausgabeströme + \item[2.5] Pipes + \item[2.6] Verzweigungen und Schleifen +% \item[\dots] + \end{itemize} + \color{gray} + \item[\textbf{3}] \textbf{TCP/IP in der Praxis} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + +% \vspace*{-1cm plus 1filll} +% +% \underconstruction + +\end{frame} + +\setcounter{section}{1} +\section{Einführung in Unix} + +\subsection{Grundkonzepte} + +\begin{frame} + + \begin{minipage}[b]{6.5cm} + \showsection + \vspace{-\medskipamount} + \showsubsection + \end{minipage} + + \begin{description} + \addtolength{\leftskip}{-1cm} + \item[1965] + Vorgänger: Multics (Multiplexed Information and Computing Service)\\ + "`überladen"' + \item[1970] + Unix: Einfachheit als Grundkonzept + \item[1972] + Umstellung auf neu entwickelte Programmiersprache C + \item[1975] + AT\&T: Unix inkl.\ Quelltext für Universitäten + \item[1977] + Berkeley Software Distribution (BSD) + \item[1983] + GNU-Projekt + \item[1987] + Minix + \item[1991] + Linux + \item[1993] + FreeBSD, NetBSD + \item[1994] + OpenBSD + \item[2000] + Darwin (Mac OS X, BSD-basiert) + \item[2008] + Android (Linux-basiert) + \end{description} + +\end{frame} + +\begin{frame}[fragile] + + \begin{minipage}[b]{6.5cm} + \showsection + \vspace{-\medskipamount} + \showsubsection + + Unix und C: Einfachheit als Grundkonzept +% \vspace{-\bigskipamount} + \begin{itemize} + \item + Vermeiden von Ausnahmen + \item[\color{lightgray}$\bullet$] + \color{lightgray}Baukastensystem + \end{itemize} + \end{minipage}\hspace*{0.5cm}% + \begin{minipage}[b]{5cm} + \small + C: Hauptprogramm\\ + = "`normale"' Funktion + + \medskip + + \begin{lstlisting}[gobble=6] + int main (int argc, char **argv) + { + printf ("Hello, world!\n"); + return 0; + } + \end{lstlisting} + \vspace{-\bigskipamount} + \end{minipage} + + \bigskip + \bigskip + + Unix: übergeordnetes Verzeichnis = "`normales"' Verzeichnis + + \medskip + + \begin{lstlisting}[style=terminal] + cassini/home/peter/foo> ¡ls -la¿ + insgesamt 24 + drwxr-xr-x 2 peter peter 4096 Okt 6 13:30 . + drwxr-xr-x 172 peter peter 20480 Okt 6 13:30 .. + cassini/home/peter/foo> ¡cd ..¿ + cassini/home/peter> + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \begin{minipage}[b]{6.5cm} + \showsection + \vspace{-\medskipamount} + \showsubsection + + Unix und C: Einfachheit als Grundkonzept +% \vspace{-\bigskipamount} + \begin{itemize} + \item + Vermeiden von Ausnahmen + \item + Baukastensystem + \end{itemize} + \end{minipage}% + \begin{minipage}[b]{5.5cm} + \small + C: Bibliotheken + + \smallskip + + z.\,B.: \lstinline{printf()} = "`normale"' Funktion\\ + aus eine Bibliothek (\file{libc}) + \end{minipage} + + \bigskip + \bigskip + + Unix: Programme arbeiten zusammen + + \medskip + + \begingroup\small + + \begin{lstlisting}[style=terminal] + cassini/home/peter/bo> ¡find . -name "*klausur*.tex" \ + | xargs grep -l "PBM-Datei"¿ + ./2014ws/ainf/20150130.0/ainf-klausur-20150130.tex + ./2016ws/hp/20170920.0/klausur.tex + ./2016ws/hp/20170206.0/klausur.tex + ./2011ws/rarch/20120322.0/rarch-klausur-20120322.tex + ./2012ws/klausuren-gerwinski/rarch-klausur-20120322.tex + ./2013ws/ainf/20140918.0/ainf-klausur-20140918.tex + ./2017ws/hp/20180213.k1/klausur.tex + ./2017ws/hp/20180205/klausur.tex + ./2015ws/ainf/20160913/ainf-klausur-20160913.tex + \end{lstlisting} + + \endgroup + +\end{frame} + +\subsection{Die Kommandozeile: Grundlagen} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Programm aufrufen: Namen eingeben, z.\,B.: \lstinline[style=cmd]{ls} + \item + Optionen: \lstinline[style=cmd]{ls -l} + \item + Lange Optionen (GNU-Konvention): \lstinline[style=cmd]{ls --help} + \medskip + \item + Text schreiben: \lstinline[style=cmd]{echo "Hello, world!"} + \item + (String-)Variable setzen: \lstinline[style=cmd]{FOO=bar} + \item + Variable abrufen: \lstinline[style=cmd]{echo $FOO} + \end{itemize} + + \pause + \begin{lstlisting}[style=terminal] + cassini/home/peter/bo> ¡FOO=ls¿ + cassini/home/peter/bo> ¡echo $FOO¿ + ls + cassini/home/peter/bo> ¡$FOO¿ + 2011ws 2012ws 2013ws doc misc projekte + 2012ss 2013ss briefe material orga + cassini/home/peter/bo> + \end{lstlisting} + +\end{frame} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + Befehl zurückholen: Pfeiltasten $\uparrow$, $\downarrow$ + \item + Befehl bearbeiten: Pfeiltasten $\leftarrow$, $\rightarrow$ usw. + \item + Befehl vervollständigen: TAB + \item + Befehl rückwärts suchen: Ctrl+R + \item + Bildschirm löschen: Ctrl+L + \item + Befehl abbrechen: Ctrl+C + \bigskip + \pause + \item + Hilfe-Option: \lstinline[style=cmd]{ls --help} + \item + Unix-Handbuch -- \emph{manual\/}: \lstinline[style=cmd]{man ls}\\ + (Beenden mit \lstinline[style=cmd]{q}) + \end{itemize} + +\end{frame} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + Verzeichnisse für Programme: \lstinline[style=cmd]{echo $PATH} + \item + Programm in explizitem Verzeichnis aufrufen: \lstinline[style=cmd]{/bin/ls -l} + \item + Programm im aktuellen Verzeichnis aufrufen: \lstinline[style=cmd]{./hello} + \bigskip + + \addtolength{\leftskip}{1cm} + \item[MS-DOS:] + Ausführbare Programme werden gefunden,\\ + wenn sie im \lstinline[style=terminal]{PATH} stehen\\ + \emph{oder\/} sich im aktuellen Verzeichnis befinden. + \smallskip + \item[Unix:] + Ausführbare Programme werden gefunden,\\ + wenn sie im \lstinline[style=terminal]{PATH} stehen. + + \smallskip + \textarrow\ Vermeiden von Ausnahmen + + \pause + \smallskip + Das aktuelle Verzeichnis (\lstinline[style=terminal]{.}) + \emph{kann\/} im \lstinline[style=terminal]{PATH} stehen,\\ + muß dies aber nicht\only<2>{ --\\ + und sollte es aus Sicherheitsgründen auch nicht}. + + \end{itemize} + +\end{frame} + +\subsection{Dateisysteme} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + Dateien listen: \lstinline[style=cmd]{ls}\\ + langes Listenformat: \lstinline[style=cmd]{ls -l}\\ + rückwärts nach Zeit sortiert: \lstinline[style=cmd]{ls -lrt} + \item + Datei ausgeben: \lstinline[style=cmd]{cat hello.c} + \item + Datei anzeigen: \lstinline[style=cmd]{less hello.c} + \end{itemize} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Arbeitsverzeichnis anzeigen: \lstinline[style=cmd]{pwd}\\ + \item + Arbeitsverzeichnis wechseln: \lstinline[style=cmd]{cd script}\\ + (\emph{kein\/} Programm, sondern Shell-Befehl) + \item + übergeordnetes Verzeichnis: \lstinline[style=cmd]{cd ..} + \item + eigenes \newterm{Home-\/}Verzeichnis: \lstinline[style=cmd]{cd} + \item + Wurzelverzeichnis: \lstinline[style=cmd]{cd /} + \item + wieder zurück: \lstinline[style=cmd]{cd -} + \end{itemize} + +% \pause + \begin{lstlisting}[style=terminal] + cassini/home/peter/bo/2013ss/net/script> ¡cd /usr/bin¿ + cassini/usr/bin> ¡cd ../lib¿ + cassini/usr/lib> ¡cd¿ + cassini/home/peter> + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Dateien kopieren (\emph{copy\/}): \lstinline[style=cmd]{cp} + \item + Dateien verschieben/umbenennen (\emph{move\/}): \lstinline[style=cmd]{mv} + \item + Dateien löschen (\emph{remove\/}): \lstinline[style=cmd]{rm} + \end{itemize} + + \begin{lstlisting}[style=terminal,xleftmargin=-3pt] + cassini/home/peter> ¡cp -p foo/test.txt¿ + cp: missing destination file operand after `foo/test.txt' + Try `cp --help' for more information. + cassini/home/peter> ¡cp -p foo/test.txt .¿ + cassini/home/peter> ¡mv test.txt bla.txt¿ + cassini/home/peter> ¡cat bla.txt¿ + Dies ist ein Test. + cassini/home/peter> ¡rm bla.txt¿ + cassini/home/peter> + \end{lstlisting} + + \medskip + + Aktuelles Verzeichnis: \lstinline[style=cmd]{.} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Datenträger in Verzeichnis \newterm{einhängen\/}: \lstinline[style=cmd]{mount} + \end{itemize} + + \begin{lstlisting}[style=terminal] + cassini/home/peter> ¡ls /media/usb1/¿ + cassini/home/peter> ¡mount /media/usb1¿ + cassini/home/peter> ¡ls /media/usb1/¿ + es-20191002.pdf hello.c hexapode KIS-Bericht.pdf + cassini/home/peter> ¡umount /media/usb1¿ + cassini/home/peter> ¡ls /media/usb1/¿ + cassini/home/peter> + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \newterm{Zugriffsrechte} + \end{itemize} + + \begingroup +% \small + \begin{lstlisting}[style=terminal,gobble=6,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191009> ¡ls -l¿ + ... + -rw-r--r-- 1 peter peter 24523 Okt 8 21:47 es-20191009.tex + \end{lstlisting} + \endgroup + \begin{onlyenv}<2> + \begin{picture}(0,1) + \color{red} + \put(0.3,0){\tikz{\draw[-latex,red](0,0)--(0,1); + \draw[-latex,red](0,0)--(2.5,1);}} + \put(0,-0.1){\makebox(0,0)[tl]{Benutzer (u -- \emph{user\/}) darf lesen und schreiben}} + \end{picture} + \end{onlyenv} + \begin{onlyenv}<3> + \begin{picture}(0,1) + \color{red} + \put(0.84,0){\tikz{\draw[-latex,red](0,0)--(0,1); + \draw[-latex,red](0,0)--(3.2,1);}} + \put(0,-0.1){\makebox(0,0)[tl]{Gruppe (g -- \emph{group\/}) darf lesen}} + \end{picture} + \end{onlyenv} + \begin{onlyenv}<4> + \begin{picture}(0,1) + \color{red} + \put(1.47,0){\tikz{\draw[-latex,red](0,0)--(0,1);}} + \put(0,-0.1){\makebox(0,0)[tl]{alle anderen (o -- \emph{other\/}) dürfen lesen}} + \end{picture} + \end{onlyenv} + + \medskip + \pause[5] + \begin{itemize} + \item + Zugriffsrechte ändern:\\ + \lstinline[style=cmd]{chmod o-r es-20191009.tex} -- Lesezugriff entziehen\\ + \lstinline[style=cmd]{chmod g+w es-20191009.tex} -- Schreibzugriff gewähren\\ + \lstinline[style=cmd]{chmod 640 es-20191009.tex} -- + auf \lstinline[style=terminal]{-}% + \lstinline[style=terminal]{rw-}% + \lstinline[style=terminal]{r--}% + \lstinline[style=terminal]{---} setzen + \end{itemize} + \pause + \begin{picture}(0,0) + \color{red} + \put(7.22,0.55){\makebox(0,0)[tl]{% + \small + \begin{math}% + \underbrace{\rule{0.7em}{0pt}}_{\textstyle 6}% + \underbrace{\rule{0.7em}{0pt}}_{\textstyle 4}% + \underbrace{\rule{0.7em}{0pt}}_{\textstyle 0} + \end{math}}} + \end{picture} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \newterm{ausführbare\/} Dateien + \end{itemize} + + \begingroup +% \small + \begin{lstlisting}[style=terminal,gobble=6,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191002> ¡cat test2.txt¿ + ls -l + cassini/home/peter/bo/2019ws/es/20191002> ¡chmod +x test2.txt¿ + cassini/home/peter/bo/2019ws/es/20191002> ¡ls -l test2.txt¿ + -rwxr-xr-x 1 peter peter 6 Okt 2 13:43 test2.txt + cassini/home/peter/bo/2019ws/es/20191002> ¡./test2.txt¿ + insgesamt 4828 + lrwxrwxrwx 1 peter peter 18 Apr 13 2016 csa2.jpg -> ../common/csa2.jpg + -rw-r--r-- 1 peter peter 4619138 Okt 8 21:28 es-20191002.pdf + ... + \end{lstlisting} + \endgroup + +% \pause + \begin{itemize} + \item + ausführbare Textdateien: \newterm{Skripte} + +% \pause + \smallskip + hier: ausführbare Textdatei mit Shell-Befehlen\\ + (ohne spezielle Kennung): Shell-Skript + + \pause + \smallskip + Kennung: 1.\ Zeile enthält \lstinline[style=terminal]{#!} und den Interpreter,\\ + z.\,B.\ \lstinline[style=terminal]{#!/bin/bash}\\ + \end{itemize} + +\end{frame} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/es}}}% + \begin{itemize} + \color{medgreen} + \item[1.1] Was sind eingebettete Systeme? + \item[1.2] Vertiefung Systemtechnik + \item[1.3] In dieser Lehrveranstaltung + \end{itemize} + \item[\textbf{2}] \textbf{Einführung in Unix} + \begin{itemize} + \color{medgreen} + \item[2.1] Grundkonzepte + \item[2.2] Die Kommandozeile: Grundlagen + \color{orange} + \item[2.3] Dateisysteme + \color{red} + \item[2.4] Ein- und Ausgabeströme + \item[2.5] Pipes + \item[2.6] Verzweigungen und Schleifen + \end{itemize} + \color{gray} + \item[\textbf{3}] \textbf{TCP/IP in der Praxis} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + +% \vspace*{-1cm plus 1filll} + +% \underconstruction + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \newterm{Symbolische Verknüpfungen -- symbolic links} + + \smallskip + + Verweis auf die eigentliche Datei\\ + \textarrow\ Wenn man die Datei löscht, zeigt der Link ins Leere. + + \smallskip + + Verknüpfung anlegen: \lstinline[style=cmd]{ln -s datei link}\\ + (Richtung: wie bei \lstinline[style=cmd]{cp}) + + \smallskip + + Beispiel: \lstinline[style=cmd]{ln -s ../common/GNU-GPL-3 gpl.txt} + \pause + \medskip + \item + \newterm{Harte Verknüpfungen -- hard links} + + \smallskip + + Dieselben Daten auf dem Datenträger\\ + sind unter mehreren Namen verfügbar.\\ + \textarrow\ Wenn man einen löscht, sind die Daten noch da. + + \smallskip + + \begingroup + \begin{lstlisting}[style=terminal,gobble=10,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191002> ¡ls -l¿ + ... + -rw-r--r-- 1 peter peter 1202 Okt 2 13:35 shell-06.txt + drwxr-xr-x 2 peter peter 4096 Okt 2 13:16 test + \end{lstlisting} + \endgroup + \begin{picture}(0,0.5) + \color{red} + \put(2.31,0){\tikz{\draw[-latex,red](0,0)--(0,0.5);}} + \put(0,-0.1){\makebox(0,0)[tl]{Anzahl der ("`harten"') Links + auf diese Datei / dieses Verzeichnis}} + \end{picture} + \end{itemize} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{grep}: Dateien durchsuchen + \end{itemize} + \begin{lstlisting}[style=terminal,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191002> ¡grep gcc *.txt¿ + shell-03.txt: cassini/...> gcc -Wall -O hello.c -o hello + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{find}: Dateien anhand ihrer Eigenschaften suchen + \end{itemize} + +% \small + \begin{lstlisting}[style=terminal] + $ ¡find . -name "*.txt"¿ + ./shell-06.txt + ./shell-03.txt + ./shell-05.txt + ./test.txt + ./test/test.txt + ... + $ ¡find . -name "*.txt" -perm /u+x¿ + ./test2.txt + $ ¡find . -name "*.txt" -perm /u+x -exec ls -l {} \;¿ + -rwxr-xr-x 1 peter peter 6 Okt 2 13:43 ./test2.txt + \end{lstlisting} + +\end{frame} + +\subsection{Ein- und Ausgabeströme} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Standard-Ausgabe in Datei umleiten + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡echo "Dies ist ein Test." > test.txt¿ + $ ¡cat test.txt¿ + Dies ist ein Test. + \end{lstlisting} + + \pause + \smallskip + + \begin{itemize} + \item + Standard-Ausgabe an Datei anhängen + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡echo "Dies ist noch ein Test." >> test.txt¿ + $ ¡cat test.txt¿ + Dies ist ein Test. + Dies ist noch ein Test. + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Fehler-Ausgabe in Datei umleiten + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡cat gibtsnicht.txt > fehler.txt¿ + cat: gibtsnicht.txt: No such file or directory + $ ¡cat fehler.txt¿ + $ ¡cat gibtsnicht.txt 2> fehler.txt¿ + $ ¡cat fehler.txt¿ + cat: gibtsnicht.txt: No such file or directory + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Standard-Eingabe aus Datei lesen + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡bc¿ + bc 1.06.95 + Copyright [...] 2006 Free Software Foundation, Inc. + This is free software with ABSOLUTELY NO WARRANTY. + For details type `warranty'. + ¡2 + 2¿ + 4 + $ ¡echo "2 + 2" > test.bc¿ + $ ¡bc < test.bc¿ + 4 + \end{lstlisting} + +\end{frame} + +\subsection{Pipes} + +\begin{frame}[fragile] + + \showsubsection + + Standard-Ausgabe von Programm A\\ + wird zu Standard-Eingabe von Programm B + + \smallskip + + \begin{lstlisting}[style=terminal] + $ ¡echo "2 + 2" | bc¿ + 4 + \end{lstlisting} + + \smallskip + + \textarrow\ sehr mächtiger "`Baukasten"' + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{sed}: \emph{stream editor}\\ + Suchen und Ersetzen (und noch viel mehr) + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡echo "Schlimmer geht nimmer." | sed -e 's/nim/im/g'¿ + Schlimmer geht immer. + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{grep}: Standard-Eingabe durchsuchen + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡ls | grep slides¿ + pgslides.sty + $ ¡ls *.pdf | grep -v logo¿ + es-20191002.pdf + Zeichen_123.pdf + $ ¡ls -l $(ls *.pdf | grep -v logo)¿ + -rw-r--r-- 1 ... 4619138 Okt 8 21:28 es-20191002.pdf + lrwxrwxrwx 1 ... 25 Okt 3 2016 Zeichen_123.pdf -> ... + \end{lstlisting} + +\end{frame} + +\subsection{Verzweigungen und Schleifen} + +\begin{frame}[fragile] + + \showsubsection + + \begin{lstlisting}[style=terminal] + $ ¡if grep Blubb test.txt; then echo "gefunden"; \ + else echo "nicht gefunden"; fi¿ + nicht gefunden + $ ¡for x in foo bar baz; do echo $x; done¿ + foo + bar + baz + \end{lstlisting} + +\end{frame} + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/es}}}% + \item[\textbf{2}] \textbf{Einführung in Unix} + \begin{itemize} + \item[2.1] Grundkonzepte + \item[2.2] Die Kommandozeile: Grundlagen + \color{medgreen} + \item[2.3] Dateisysteme + \item[2.4] Ein- und Ausgabeströme + \item[2.5] Pipes + \item[2.6] Verzweigungen und Schleifen + \end{itemize} + \color{red} + \item[\textbf{3}] \textbf{TCP/IP in der Praxis} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + +% \vspace*{-1cm plus 1filll} + +% \underconstruction + +\end{frame} + +\end{document} diff --git a/20221005/logo-hochschule-bochum-cvh-text-v2.pdf b/20221005/logo-hochschule-bochum-cvh-text-v2.pdf new file mode 120000 index 0000000000000000000000000000000000000000..4aa99b8f81061aca6dcaf43eed2d9efef40555f8 --- /dev/null +++ b/20221005/logo-hochschule-bochum-cvh-text-v2.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum-cvh-text-v2.pdf \ No newline at end of file diff --git a/20221005/logo-hochschule-bochum.pdf b/20221005/logo-hochschule-bochum.pdf new file mode 120000 index 0000000000000000000000000000000000000000..b6b9491e370e499c9276918182cdb82cb311bcd1 --- /dev/null +++ b/20221005/logo-hochschule-bochum.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum.pdf \ No newline at end of file diff --git a/20221005/pgslides.sty b/20221005/pgslides.sty new file mode 120000 index 0000000000000000000000000000000000000000..5be1416f4216f076aa268901f52a15d775e43f64 --- /dev/null +++ b/20221005/pgslides.sty @@ -0,0 +1 @@ +../common/pgslides.sty \ No newline at end of file diff --git a/README.md b/README.md index 4e857f2b3aacfa2fe4d137c57206b659d8453bfa..7732f148c46ac8d760561d4352cadb01adfd3d3e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ Für Details siehe [common/README](https://gitlab.cvh-server.de/pgerwinski/es/ra Vortragsfolien: --------------- - * [28.09.2022: Einführung: eingebettete Systeme, Unix-Kommandozeile](https://gitlab.cvh-server.de/pgerwinski/es/raw/2022ws/20220928/es-20220928.pdf) + * [28.09.2022: Einführung: eingebettete Systeme, Unix](https://gitlab.cvh-server.de/pgerwinski/es/raw/2022ws/20220928/es-20220928.pdf) + * [05.10.2022: Unix-Kommandozeile, Shell-Skripte](https://gitlab.cvh-server.de/pgerwinski/es/raw/2022ws/20221005/es-20221005.pdf) * [alle in 1 Datei](https://gitlab.cvh-server.de/pgerwinski/es/raw/2022ws/es-slides-2022ws.pdf) Original-Materialien einschließlich Beispiel-Programme und LaTeX-Quelltexte: diff --git a/es-slides-2022ws.pdf b/es-slides-2022ws.pdf index ac83168c3aca051ad83fd91763fa4cf884acf594..1d98bb192f5aab062d0eef74a5d5c4c597cfae36 100644 Binary files a/es-slides-2022ws.pdf and b/es-slides-2022ws.pdf differ