Skip to content
Snippets Groups Projects
Commit b6738e6c authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Folien und Beispiele 19. und 26.10.2017

parent 6b4e391f
No related branches found
No related tags found
No related merge requests found
Showing
with 320 additions and 1906 deletions
Hello, world!
How are you?
This diff is collapsed.
ls -l
#!/bin/bash
ls -l
#!/bin/grep Hallo
Dies ist ein Test.
Ist da jemand?
Hallo?
Aha.
#!/usr/bin/bc
2 + 2
quit
../common/Zeichen_123.pdf
\ No newline at end of file
File added
% unix-20161006.pdf - Lecture Slides on Unix Fundamentals % es-20171019.pdf - Lecture Slides on Embedded Systems
% Copyright (C) 2013, 2015, 2016 Peter Gerwinski % Copyright (C) 2013, 2014, 2015, 2016, 2017 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons % modify it either under the terms of the Creative Commons
...@@ -24,68 +24,217 @@ ...@@ -24,68 +24,217 @@
\usepackage{pgslides} \usepackage{pgslides}
\usepackage{rotating} \usepackage{rotating}
\usepackage{pdftricks} \usepackage{tikz}
\usepackage[obeyfamily=false,mathrm=mathsf,textrm=sffamily]{siunitx}
\usepackage{eurosym} \newcommand{\underconstruction}{\vspace*{-5cm plus 1filll}%
\begin{picture}(0,0)
\begin{psinputs} \put(9,1.3){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}}
\usepackage[latin1]{inputenc} \put(9,1.0){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}}
\usepackage[german]{babel} \end{picture}}
\usepackage[T1]{fontenc}
\usepackage{helvet} \title{Vertiefung Systemtechnik\\Eingebettete Systeme}
\renewcommand*\familydefault{\sfdefault}
\usepackage{pstricks}
\psset{unit=1cm}
\end{psinputs}
\title{Einführung in Unix}
\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski} \author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski}
\date{6.\ Oktober 2016} \date{19.\ Oktober 2017}
\begin{document} \newcommand{\ItwoC}{I\raisebox{0.5ex}{\footnotesize 2}C}
\newlength{\normalpdfpageheight} \begin{document}
\setlength{\normalpdfpageheight}{\pdfpageheight}
\maketitleframe \maketitleframe
\sectionnonumber{U\quad Einführung in Unix} \nosectionnonumber{Vertiefung Systemtechnik -- Eingebettete Systeme}
\begin{frame} \begin{frame}
\showsectionnonumber \shownosectionnonumber
% \begingroup \begin{itemize}
% \large\color{structure}% \item[\textbf{1}] \textbf{Einführung}
% \textbf{Angewandte Informatik: wichtiges Werkzeug} \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/es.git}}}%
% \par\smallskip \begin{itemize}
% \textbf{Grundlagen Rechnertechnik: Beispiel für Skriptsprache} \color{medgreen}
% \par\bigskip \item[1.1] Was sind eingebettete Systeme?
% \endgroup \item[1.2] Vertiefung Systemtechnik
\item[1.3] In dieser Lehrveranstaltung
% \begin{itemize} \end{itemize}
% \item[\textbf{U}] \textbf{Einführung in Unix} \item[\textbf{2}] \textbf{Einführung in Unix}
\begin{itemize} \begin{itemize}
\item[U.1] \color{red}Grundkonzepte \item[2.1] \color{medgreen}Grundkonzepte
\item[U.2] Die Kommandozeile: Grundlagen \item[2.2] Die Kommandozeile: Grundlagen
\item[U.3] Dateisysteme \item[2.3] \color{orange}Dateisysteme
\item[U.4] Ein- und Ausgabeströme \item[2.4] \color{medgreen}Ein- und Ausgabeströme
\item[U.5] Pipes \item[2.5] Pipes
\item[U.6] Verzweigungen und Schleifen \item[2.6] \color{red}Verzweigungen und Schleifen
% \item[\dots] % \item[\dots]
\end{itemize} \end{itemize}
% \end{itemize} \color{gray}
\item[\textbf{3}] \textbf{TCP/IP in der Praxis}
\vspace*{-\smallskipamount}
\item[\textbf{\dots}]
\end{itemize}
\underconstruction
\end{frame} \end{frame}
\subsectionnonumber{U.1\quad Grundkonzepte} \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}
\item
\emph{keine\/} Aussage über die Größe
\item
in der Praxis: so klein wie möglich, z.\,B.:\\[\smallskipamount]
% \only<4>{\vspace*{-3.3cm}\hspace*{0.7cm}\includegraphics[height=8cm]{csa2.jpg}\hspace*{-1cm}\vspace*{-8cm}}
\begin{itemize}
\item
mehrere Rechnerschränke
\item
Industrie-PC
\item
Einplatinencomputer
\item
Mikro-Controller
\end{itemize}
\item
Bedienung über spezielle Ein-/Ausgabegeräte (z.\,B.\ Flugsimulator, Telefon)
\item
Wartung über speziellen Adminstrator-Zugang
\begin{itemize}
\item
Bus-Schnittstelle (RS-232, CAN-BUS)
\item
Netzwerk (TCP/IP, Ethernet oder WLAN)
\end{itemize}
\item
Programmierung oft außerhalb des Systems\\
(Cross-Entwicklungswerkzeuge)
\end{itemize}
\vspace*{-1cm}
\end{frame}
\sectionnonumber{Vertiefung Systemtechnik}
\begin{frame}[fragile]
% \begin{visibleenv}<2->
\begin{picture}(2,1)
\put(1.3,0.6){\vector(0,-1){0.6}}
\put(1.3,0.6){\line(1,0){1}}
\put(2.4,0.6){\makebox(0,0)[l]{\dots\ für Fortgeschrittene}}
\end{picture}
% \begin{pdfpic}
% \begin{pspicture}(2,1)
% \put(2.4,0.6){\makebox(0,0)[l]{\dots\ für Fortgeschrittene}}
% \psline[arrows=->](2.3,0.6)(1.3,0.6)(1.3,-0.4)
% \end{pspicture}
% \end{pdfpic}
% \vspace{-1cm}
% \end{visibleenv}
\showsectionnonumber
% \begin{onlyenv}<3->
\begin{picture}(2,2.3)(0,-1.3)
\put(4.2,0.7){\vector(0,1){0.6}}
% \only<3>{\put(0,0.5){\makebox(0,0)[tl]{\includegraphics[width=10.5cm]{wp-systemtechnik.png}}}}
\put(4.2,0.5){\makebox(0,0)[t]{\Large\textbf{\color{structure}Echtzeitsysteme}}}
\put(6.0,-0.8){\vector(-1,1){0.6}}
\put(6.0,-0.9){\makebox(0,0)[t]{Geräte aller Art}}
\put(2.0,-0.8){\vector(1,1){0.6}}
% \put(0,-0.9){\makebox(0,0)[tl]{Was ist Echtzeit?}}
\put(0,-0.9){\makebox(0,0)[tl]{\color{red}\shortstack{Thema dieser\\Lehrveranstaltung:\\Echtzeit}}}
\end{picture}
% \end{onlyenv}
\end{frame}
\begin{frame}
\begin{center}
\begin{tikzpicture}
\draw (0, 2) ellipse (4 and 3);
\node at (-1, 3.5) {Vertiefung Systemtechnik};
\color{red}
\draw (3, 2) ellipse (4 and 3);
\node at (4, 3.5) {\shortstack{Software-Entwicklung\\für eingebettete Systeme}};
% \pause
\color{blue}
\draw (1.5, 0) ellipse (4 and 3);
\node at (1.5, 1.0) {\shortstack{Eingebettete Systeme}};
% \pause
\color{gray}
\draw (5.5, -3.6) arc (0:180:4 and 3);
\node at (1.5, -3.3) {Netzwerktechnik};
\end{tikzpicture}
\end{center}
\vspace*{-1cm}
\end{frame}
\sectionnonumber{In dieser Lehrveranstaltung}
\begin{frame} \begin{frame}
\begin{minipage}[b]{6.5cm}
\showsectionnonumber \showsectionnonumber
\vspace*{-\medskipamount}
\begin{itemize}
\item
Einführung in Unix
\item
TCP/IP und Bus-Systeme in der Praxis
\item
Web-Interfaces
\item
C-Programmierung für Fortgeschrittene
\item
Theorie und Praxis der Echtzeitprogrammierung
\item
Prüfungsleistung: Projektaufgabe\\
Eingebettetes System bzw.\ Echtzeit-System eigener Wahl\\
zum Laufen bringen
\arrowitem
{\color{red}Projektaufgabe überlegen}
\end{itemize}
\bigskip
{\color{gray}
Weitere Ideen:
\begin{itemize}
\item[\color{gray}$\bullet$]\color{gray}
Exkursion: TFC -- Simulatoren und Technik GmbH,\\Velbert-Nierenhof
\item[\color{gray}$\bullet$]\color{gray}
Einführung in die GUI-Programmierung
\end{itemize}}
\underconstruction
\end{frame}
\setcounter{section}{1}
\section{Einführung in Unix}
\subsection{Grundkonzepte}
\begin{frame}
\begin{minipage}[b]{6.5cm}
\showsection
\vspace{-\medskipamount} \vspace{-\medskipamount}
\showsubsectionnonumber \showsubsection
\end{minipage} \end{minipage}
\begin{description} \begin{description}
...@@ -122,9 +271,9 @@ ...@@ -122,9 +271,9 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\begin{minipage}[b]{6.5cm} \begin{minipage}[b]{6.5cm}
\showsectionnonumber \showsection
\vspace{-\medskipamount} \vspace{-\medskipamount}
\showsubsectionnonumber \showsubsection
Unix und C: Einfachheit als Grundkonzept Unix und C: Einfachheit als Grundkonzept
% \vspace{-\bigskipamount} % \vspace{-\bigskipamount}
...@@ -136,6 +285,7 @@ ...@@ -136,6 +285,7 @@
\end{itemize} \end{itemize}
\end{minipage}\hspace*{0.5cm}% \end{minipage}\hspace*{0.5cm}%
\begin{minipage}[b]{5cm} \begin{minipage}[b]{5cm}
\small
C: Hauptprogramm\\ C: Hauptprogramm\\
= "`normale"' Funktion = "`normale"' Funktion
...@@ -172,9 +322,9 @@ ...@@ -172,9 +322,9 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\begin{minipage}[b]{6.5cm} \begin{minipage}[b]{6.5cm}
\showsectionnonumber \showsection
\vspace{-\medskipamount} \vspace{-\medskipamount}
\showsubsectionnonumber \showsubsection
Unix und C: Einfachheit als Grundkonzept Unix und C: Einfachheit als Grundkonzept
% \vspace{-\bigskipamount} % \vspace{-\bigskipamount}
...@@ -184,8 +334,9 @@ ...@@ -184,8 +334,9 @@
\item \item
Baukastensystem Baukastensystem
\end{itemize} \end{itemize}
\end{minipage}\hspace*{0.3cm}% \end{minipage}\hspace*{-0.3cm}%
\begin{minipage}[b]{6cm} \begin{minipage}[b]{6cm}
\small
C: Bibliotheken C: Bibliotheken
\begin{itemize} \begin{itemize}
\item \item
...@@ -227,11 +378,11 @@ ...@@ -227,11 +378,11 @@
\end{frame} \end{frame}
\subsectionnonumber{U.2\quad Die Kommandozeile: Grundlagen} \subsection{Die Kommandozeile: Grundlagen}
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -249,7 +400,7 @@ ...@@ -249,7 +400,7 @@
Variable abrufen: \lstinline[style=cmd]{echo $FOO} Variable abrufen: \lstinline[style=cmd]{echo $FOO}
\end{itemize} \end{itemize}
\pause % \pause
\begin{lstlisting}[style=terminal] \begin{lstlisting}[style=terminal]
cassini/home/peter/bo> ¡FOO=ls¿ cassini/home/peter/bo> ¡FOO=ls¿
cassini/home/peter/bo> ¡echo $FOO¿ cassini/home/peter/bo> ¡echo $FOO¿
...@@ -264,7 +415,7 @@ ...@@ -264,7 +415,7 @@
\begin{frame} \begin{frame}
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -280,7 +431,7 @@ ...@@ -280,7 +431,7 @@
\item \item
Befehl abbrechen: Ctrl+C Befehl abbrechen: Ctrl+C
\bigskip \bigskip
\pause % \pause
\item \item
Hilfe-Option: \lstinline[style=cmd]{ls --help} Hilfe-Option: \lstinline[style=cmd]{ls --help}
\item \item
...@@ -292,7 +443,7 @@ ...@@ -292,7 +443,7 @@
\begin{frame} \begin{frame}
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -316,22 +467,22 @@ ...@@ -316,22 +467,22 @@
\smallskip \smallskip
\textarrow\ Vermeiden von Ausnahmen \textarrow\ Vermeiden von Ausnahmen
\pause % \pause
\smallskip \smallskip
Das aktuelle Verzeichnis (\lstinline[style=terminal]{.}) Das aktuelle Verzeichnis (\lstinline[style=terminal]{.})
\emph{kann\/} im \lstinline[style=terminal]{PATH} stehen,\\ \emph{kann\/} im \lstinline[style=terminal]{PATH} stehen,\\
muß dies aber nicht\only<2>{ --\\ muß dies aber nicht --\\
und sollte es aus Sicherheitsgründen auch nicht}. und sollte es aus Sicherheitsgründen auch nicht.
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\subsectionnonumber{U.3\quad Dateisysteme} \subsection{Dateisysteme}
\begin{frame} \begin{frame}
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -348,7 +499,7 @@ ...@@ -348,7 +499,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -366,7 +517,7 @@ ...@@ -366,7 +517,7 @@
wieder zurück: \lstinline[style=cmd]{cd -} wieder zurück: \lstinline[style=cmd]{cd -}
\end{itemize} \end{itemize}
\pause % \pause
\begin{lstlisting}[style=terminal] \begin{lstlisting}[style=terminal]
cassini/home/peter/bo/2013ss/net/script> ¡cd /usr/bin¿ cassini/home/peter/bo/2013ss/net/script> ¡cd /usr/bin¿
cassini/usr/bin> ¡cd ../lib¿ cassini/usr/bin> ¡cd ../lib¿
...@@ -378,7 +529,7 @@ ...@@ -378,7 +529,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -409,7 +560,7 @@ ...@@ -409,7 +560,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -424,7 +575,7 @@ ...@@ -424,7 +575,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -445,7 +596,7 @@ ...@@ -445,7 +596,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -496,7 +647,8 @@ ...@@ -496,7 +647,8 @@
\pause \pause
\begin{picture}(0,0) \begin{picture}(0,0)
\color{red} \color{red}
\put(6.25,0.5){\makebox(0,0)[tl]{% \put(6.15,0.55){\makebox(0,0)[tl]{%
\small
\begin{math}% \begin{math}%
\underbrace{\rule{0.7em}{0pt}}_{\textstyle 6}% \underbrace{\rule{0.7em}{0pt}}_{\textstyle 6}%
\underbrace{\rule{0.7em}{0pt}}_{\textstyle 4}% \underbrace{\rule{0.7em}{0pt}}_{\textstyle 4}%
...@@ -508,7 +660,7 @@ ...@@ -508,7 +660,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -529,17 +681,17 @@ ...@@ -529,17 +681,17 @@
\end{lstlisting} \end{lstlisting}
\endgroup \endgroup
\pause % \pause
\begin{itemize} \begin{itemize}
\item \item
ausführbare Textdateien: \newterm{Skripte} ausführbare Textdateien: \newterm{Skripte}
\pause % \pause
\smallskip \smallskip
hier: ausführbare Textdatei mit Shell-Befehlen\\ hier: ausführbare Textdatei mit Shell-Befehlen\\
(ohne spezielle Kennung): Shell-Skript (ohne spezielle Kennung): Shell-Skript
\pause % \pause
\smallskip \smallskip
Kennung: 1.\ Zeile enthält \lstinline[style=terminal]{#!} und den Interpreter,\\ Kennung: 1.\ Zeile enthält \lstinline[style=terminal]{#!} und den Interpreter,\\
z.\,B.\ \lstinline[style=terminal]{#!/bin/bash}\\ z.\,B.\ \lstinline[style=terminal]{#!/bin/bash}\\
...@@ -549,7 +701,7 @@ ...@@ -549,7 +701,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -587,7 +739,7 @@ ...@@ -587,7 +739,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -613,11 +765,11 @@ ...@@ -613,11 +765,11 @@
\end{frame} \end{frame}
\subsectionnonumber{U.4\quad Ein- und Ausgabeströme} \subsection{Ein- und Ausgabeströme}
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -629,7 +781,7 @@ ...@@ -629,7 +781,7 @@
Dies ist ein Test. Dies ist ein Test.
\end{lstlisting} \end{lstlisting}
\pause % \pause
\smallskip \smallskip
\begin{itemize} \begin{itemize}
...@@ -647,7 +799,7 @@ ...@@ -647,7 +799,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -666,7 +818,7 @@ ...@@ -666,7 +818,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -687,11 +839,11 @@ ...@@ -687,11 +839,11 @@
\end{frame} \end{frame}
\subsectionnonumber{U.5\quad Pipes} \subsection{Pipes}
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
Standard-Ausgabe von Programm A\\ Standard-Ausgabe von Programm A\\
wird zu Standard-Eingabe von Programm B wird zu Standard-Eingabe von Programm B
...@@ -711,7 +863,7 @@ ...@@ -711,7 +863,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -727,7 +879,7 @@ ...@@ -727,7 +879,7 @@
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{itemize} \begin{itemize}
\item \item
...@@ -750,11 +902,11 @@ ...@@ -750,11 +902,11 @@
\end{frame} \end{frame}
\subsectionnonumber{U.6\quad Verzweigungen und Schleifen} \subsection{Verzweigungen und Schleifen}
\begin{frame}[fragile] \begin{frame}[fragile]
\showsubsectionnonumber \showsubsection
\begin{lstlisting}[style=terminal] \begin{lstlisting}[style=terminal]
$ ¡if grep Pipes test.txt; then echo "gefunden"; \ $ ¡if grep Pipes test.txt; then echo "gefunden"; \
...@@ -768,4 +920,34 @@ ...@@ -768,4 +920,34 @@
\end{frame} \end{frame}
\nosectionnonumber{Vertiefung Systemtechnik -- Eingebettete Systeme}
\begin{frame}
\shownosectionnonumber
\begin{itemize}
\item[\textbf{1}] \textbf{\color{medgreen}Einführung}
\hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/es.git}}}%
\item[\textbf{2}] \textbf{Einführung in Unix}
\begin{itemize}
\item[2.1] \color{medgreen}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{red}
\item[\textbf{3}] \textbf{TCP/IP in der Praxis}
\vspace*{-\smallskipamount}
\color{gray}
\item[\textbf{\dots}]
\end{itemize}
\underconstruction
\end{frame}
\end{document} \end{document}
bang='!'
n='\\n'
for x in 1 2 3 4; do
echo -e "#include <stdio.h>\n\nint main(void)\n{\n printf (\"Hello, world $x$bang$n\");\n return 0;\n}" > test-$x.c
gcc -Wall -O test-$x.c -o test-$x
./test-$x
done
bang='!'
n='\\n'
for x in $(seq 20); do
echo -e "#include <stdio.h>\n\nint main(void)\n{\n printf (\"Hello, world $x$bang$n\");\n return 0;\n}" > test-$x.c
gcc -Wall -O test-$x.c -o test-$x
./test-$x
done
bang='!'
for x in $(seq 20); do
echo -e "#include <stdio.h>\n\nint main(void)\n{\n printf (\"Hello, world $x!\\\n\");\n return 0;\n}" > test-$x.c
gcc -Wall -O test-$x.c -o test-$x
./test-$x
done
../common/logo-hochschule-bochum-cvh-text.pdf
\ No newline at end of file
../common/logo-hochschule-bochum.pdf
\ No newline at end of file
a = 2 + 2
b = 3 * a
b
#!/bin/bash
for x in $(ls -t); do
ls -l $x
done
#!/bin/bash
n=1
for x in $(ls -t); do
echo $((n++))
done
#!/bin/bash
n=1
for x in $(ls -t); do
printf "%04d\n" $((n++))
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment