[bootlin/training-materials updates] master: kernel-resources: Split the sources intro between sysdev/kernel (1295575c)
Miquel Raynal
miquel.raynal at bootlin.com
Fri Jul 28 15:25:38 CEST 2023
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/1295575c8b67d31d71ab83a17770b891d5a1f2d2
>---------------------------------------------------------------
commit 1295575c8b67d31d71ab83a17770b891d5a1f2d2
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date: Fri Jul 28 11:02:01 2023 +0200
kernel-resources: Split the sources intro between sysdev/kernel
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>---------------------------------------------------------------
1295575c8b67d31d71ab83a17770b891d5a1f2d2
mk/linux-kernel.mk | 2 +-
.../kernel-intro-sources/kernel-intro-sources.tex | 102 +++++++++++++++++++++
.../sysdev-linux-intro-sources.tex | 2 -
3 files changed, 103 insertions(+), 3 deletions(-)
diff --git a/mk/linux-kernel.mk b/mk/linux-kernel.mk
index 36222e45..c31c37d4 100644
--- a/mk/linux-kernel.mk
+++ b/mk/linux-kernel.mk
@@ -8,7 +8,7 @@ LINUX_KERNEL_SLIDES = \
setup-lab \
kernel-introduction-title \
sysdev-linux-intro-features \
- sysdev-linux-intro-sources \
+ kernel-intro-sources \
kernel-source-code-download-lab \
kernel-source-code-title \
kernel-source-code-drivers \
diff --git a/slides/kernel-intro-sources/kernel-intro-sources.tex b/slides/kernel-intro-sources/kernel-intro-sources.tex
new file mode 100644
index 00000000..341db988
--- /dev/null
+++ b/slides/kernel-intro-sources/kernel-intro-sources.tex
@@ -0,0 +1,102 @@
+\subsection{Linux kernel sources}
+
+\begin{frame}
+ \frametitle{Location of official kernel sources}
+ \begin{itemize}
+ \item The mainline versions of the Linux kernel, as released by Torvalds
+ \begin{itemize}
+ \item These versions follow the development model of the kernel
+ \item They may not contain the latest developments from a specific
+ area yet
+ \item A good pick for products development phase
+ \item \url{https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git}
+ \end{itemize}
+ \item The stable versions of the Linux kernel, as maintained by a
+ maintainers group
+ \begin{itemize}
+ \item These versions do not bring new features compared to Linus'
+ tree
+ \item Only bug fixes and security fixes are pulled there
+ \item Each version is stabilized during the development period of
+ the next mainline kernel
+ \item Certain versions can be maintained for much longer, 2$+$ years
+ \item A good pick for products commercialization phase
+ \item \url{https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git}
+ \end{itemize}
+ \end{itemize}
+\end{frame}
+
+\begin{frame}
+ \frametitle{Location of non-official kernel sources}
+ \begin{itemize}
+ \item Many chip vendors supply their own kernel sources
+ \begin{itemize}
+ \item Focusing on hardware support first
+ \item Can have a very important delta with mainline Linux
+ \item Sometimes they break support for other platforms/devices
+ without caring
+ \item Useful in early phases only when mainline hasn't caught up yet
+ (many vendors invest in the mainline kernel at the same time)
+ \item Suitable for PoC, not suitable for products on the long term
+ as usually no updates are provided to these kernels
+ \item Getting stuck with a deprecated system with broken software
+ that cannot be updated has a real cost in the end
+ \end{itemize}
+ \item Many kernel sub-communities maintain their own kernel, with
+ usually newer but fewer stable features, only for cutting-edge
+ development
+ \begin{itemize}
+ \item Architecture communities (ARM, MIPS, PowerPC, etc)
+ \item Device drivers communities (I2C, SPI, USB, PCI, network, etc)
+ \item Other communities (real-time, etc)
+ \item Not suitable to be used in products
+ \end{itemize}
+ \end{itemize}
+\end{frame}
+
+\begin{frame}
+ \frametitle{Linux kernel size and structure}
+ \begin{itemize}
+ \item Linux v5.18 sources: close to 80k files, 35M lines, 1.3GiB
+ % files: git ls-files | wc -l
+ % lines: git ls-files | xargs cat | wc -l
+ % bytes: git ls-files | xargs cat | wc -c
+ \item But a compressed Linux kernel just sizes a few megabytes.
+ \item So, why are these sources so big?\\
+ Because they include numerous device drivers, network protocols,
+ architectures, filesystems... The core is pretty small!
+ \item As of kernel version v5.18 (in percentage of total number of lines):
+ % Update the data by running utils/source-code-line-statistics
+ % in the Linux kernel source directory
+ \end{itemize}
+ {\small
+ \begin{columns}
+ \column[t]{0.24\textwidth}
+ \begin{itemize}
+ \item \kdir{drivers}: 61.1\%
+ \item \kdir{arch}: 11.6\%
+ \item \kdir{fs}: 4.4\%
+ \item \kdir{sound}: 4.1\%
+ \item \kdir{tools}: 3.9\%
+ \item \kdir{net}: 3.7\%
+ \end{itemize}
+ \column[t]{0.30\textwidth}
+ \begin{itemize}
+ \item \kdir{include}: 3.5\%
+ \item \kdir{Documentation}: 3.4\%
+ \item \kdir{kernel}: 1.3\%
+ \item \kdir{lib}: 0.7\%
+ \item \kdir{usr}: 0.6\%
+ \item \kdir{mm}: 0.5\%
+ \end{itemize}
+ \column[t]{0.40\textwidth}
+ \begin{itemize}
+ \item \kdir{scripts}, \kdir{security}, \kdir{crypto}, \kdir{block},
+ \kdir{samples}, \kdir{ipc}, \kdir{virt}, \kdir{init}, \kdir{certs}: <0.5\%
+ \item Build system files: \kfile{Kbuild}, \kfile{Kconfig}, \kfile{Makefile}
+ \item Other files: \kfile{COPYING}, \kfile{CREDITS},
+ \kfile{MAINTAINERS}, \kfile{README}
+ \end{itemize}
+ \end{columns}
+ }
+\end{frame}
diff --git a/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex b/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex
index 81de43f0..d81e9334 100644
--- a/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex
+++ b/slides/sysdev-linux-intro-sources/sysdev-linux-intro-sources.tex
@@ -54,7 +54,6 @@
\end{itemize}
\end{frame}
-\ifthenelse{\equal{\training}{linux-kernel}}{}{
\begin{frame}
\frametitle{Getting Linux sources}
\begin{itemize}
@@ -99,7 +98,6 @@
\end{center}
\end{columns}
\end{frame}
-}
\begin{frame}
\frametitle{Linux kernel size and structure}
More information about the training-materials-updates
mailing list