X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=process.tex;h=30913ae8d9df5c24e209c12e5c64b173a0a8e3c2;hp=2daf77d6a2c33ca7eeb52fc3b0707f60b90b21cd;hb=3da7aa8ec1541a808985971cf3814baa83f32f69;hpb=a48e8dfeb4b05b57eab2336c7d2e0aaf6b9bd572 diff --git a/process.tex b/process.tex index 2daf77d..30913ae 100644 --- a/process.tex +++ b/process.tex @@ -234,7 +234,44 @@ normalmente un programma \begin{figure}[htb] \centering - \includegraphics[width=9cm]{img/proc_beginend} +% \includegraphics[width=9cm]{img/proc_beginend} + \begin{tikzpicture}[>=stealth] + \filldraw[fill=black!35] (-0.3,0) rectangle (12,1); + \draw(5.5,0.5) node {\large{kernel}}; + + \filldraw[fill=black!15] (1.5,2) rectangle (4,3); + \draw (2.75,2.5) node {\texttt{ld-linux.so}}; + \draw [->] (2.75,1) -- (2.75,2); + \draw (2.75,1.5) node [anchor=west]{\texttt{exec}}; + + \filldraw[fill=black!15,rounded corners] (1.5,4) rectangle (4,5); + \draw (2.75,4.5) node {\texttt{main}}; + + \draw [<->, dashed] (2.75,3) -- (2.75,4); + \draw [->] (1.5,4.5) -- (0.3,4.5) -- (0.3,1); + \draw (0.9,4.5) node [anchor=south] {\texttt{\_exit}}; + + \filldraw[fill=black!15,rounded corners] (1.5,6) rectangle (4,7); + \draw (2.75,6.5) node {\texttt{funzione}}; + + \draw [<->, dashed] (2.75,5) -- (2.75,6); + \draw [->] (1.5,6.5) -- (0.05,6.5) -- (0.05,1); + \draw (0.9,6.5) node [anchor=south] {\texttt{\_exit}}; + + \draw (6.75,4.5) node (exit) [rectangle,fill=black!15,minimum width=2.5cm,minimum height=1cm,rounded corners, draw]{\texttt{exit}}; + + \draw[->] (4,6.5) -- node[anchor=south west]{\texttt{exit}} (exit); + \draw[->] (4,4.5) -- node[anchor=south]{\texttt{exit}} (exit); + \draw[->] (exit) -- node[anchor=east]{\texttt{\_exit}}(6.75,1); + + \draw (10,4.5) node (exithandler1) [rectangle,fill=black!15,rounded corners, draw]{exit handler}; + \draw (10,5.5) node (exithandler2) [rectangle,fill=black!15,rounded corners, draw]{exit handler}; + \draw (10,3.5) node (stream) [rectangle,fill=black!15,rounded corners, draw]{chiusura stream}; + + \draw[<->, dashed] (exithandler1) -- (exit); + \draw[<->, dashed] (exithandler2) -- (exit); + \draw[<->, dashed] (stream) -- (exit); + \end{tikzpicture} \caption{Schema dell'avvio e della conclusione di un programma.} \label{fig:proc_prog_start_stop} \end{figure} @@ -420,7 +457,27 @@ seguenti segmenti: \begin{figure}[htb] \centering - \includegraphics[height=12cm]{img/memory_layout} +% \includegraphics[height=12cm]{img/memory_layout} + \begin{tikzpicture} + \draw (0,0) rectangle (4,1); + \draw (2,0.5) node {text}; + \draw (0,1) rectangle (4,2.5); + \draw (2,1.75) node {dati inizializzati}; + \draw (0,2.5) rectangle (4,5); + \draw (2,3.75) node {dati non inizializzati}; + \draw (0,5) rectangle (4,9); + \draw[dashed] (0,6) -- (4,6); + \draw[dashed] (0,8) -- (4,8); + \draw (2,5.5) node {heap}; + \draw (2,8.5) node {stack}; + \draw [->] (2,6) -- (2,6.5); + \draw [->] (2,8) -- (2,7.5); + \draw (0,9) rectangle (4,10); + \draw (2,9.5) node {environment}; + \draw (4,0) node [anchor=west] {\texttt{0x08000000}}; + \draw (4,5) node [anchor=west] {\texttt{0x08xxxxxx}}; + \draw (4,9) node [anchor=west] {\texttt{0xC0000000}}; + \end{tikzpicture} \caption{Disposizione tipica dei segmenti di memoria di un processo.} \label{fig:proc_mem_layout} \end{figure}