--- /dev/null
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% %%
+%% %%
+%% The Linux Kernel Module Guide Simple Chinese Manual %%
+%% how to study for beginners %%
+%% Author: Felix Lee <felix@ivnss.com> %%
+%% Issue Date: Aug 22th, 2023 (GMT +08:00) %%
+%% %%
+%% (CN) 版权: 作者拥有《中华人民共和国版权法》规定的各项权利 %%
+%% 未经授权,禁止翻印 %%
+%% %%
+%% %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\documentclass[9pt, oneside]{book}
+\usepackage[Bjornstrup]{fncychap}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{fancyhdr}
+\usepackage{xparse}
+\usepackage{ifthen}
+\usepackage{pdfpages}
+\usepackage{CJKutf8}
+\usepackage{indentfirst}
+\begin{CJK}{UTF8}{song}
+
+\end{CJK}
+%% \usepackage[scale=1, fontsize=48pt, color={[gray]{0.6}}, text={IVNSS\\预排印版}]{draftwatermark}
+% tikz settings
+\usepackage{tikz}
+\usetikzlibrary{shapes.geometric, arrows, shadows, decorations.text}
+\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30, drop shadow]
+\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
+\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
+\tikzstyle{decision} = [diamond, minimum width=1cm, minimum height=1cm, text centered, draw=black, fill=green!30]
+\tikzstyle{arrow} = [thick,->,>=stealth]
+\tikzstyle{line} = [draw, -latex']
+
+% packages for code
+\usepackage{verbatim}
+\usepackage{verbatimbox}
+\usepackage{minted}
+
+% citation
+\usepackage{cite}
+\usepackage[colorlinks,citecolor=green]{hyperref}
+
+\usepackage{xcolor}
+\hypersetup{
+ colorlinks,
+ linkcolor = {red!50!black},
+ citecolor = {blue!50!black},
+ urlcolor = {blue!80!black}
+}
+
+\input{lib/codeblock}
+\input{lib/kernelsrc}
+
+% FIXME: classify with chapters instead of sections
+
+\author{Felix Lee}
+\date{2023年9月21日}
+\title{Linux内核模块编程指南\\认识与提高}
+%%
+\renewcommand{\contentsname}{目 录}
+\renewcommand{\chaptername}{章}
+\renewcommand{\figurename}{图}
+\linespread{1.2}
+%%%
+\makeatletter
+ \usecolortrue
+ % pzc (Zapf Chancelery) is nice. ppl (Palatino) is cool too.
+ \ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont}
+ \ChTitleVar{\raggedleft\Large\sffamily\bfseries}
+
+ \setlength{\myhi}{10pt} % Space between grey box border and text¶
+ \setlength{\mylen}{\textwidth}
+ \addtolength{\mylen}{-2\myhi}
+ \renewcommand{\DOCH}{%¶
+ \settowidth{\py}{\CNoV\thechapter}
+ \addtolength{\py}{10pt} % Amount of space by which the
+% % number is shifted right
+ \fboxsep=0pt%¶
+ \colorbox[gray]{.95}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}%¶
+ \kern-\py\raise20pt%¶
+ \hbox{\color[gray]{.05}第\CNoV\thechapter{\large{章}}}\\%¶
+ }
+
+ \renewcommand{\DOTI}[1]{%
+ \nointerlineskip\raggedright%¶
+ \fboxsep=\myhi%
+ \vskip-1ex%
+ \colorbox[gray]{.90}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak%¶
+ \vskip 40\p@%¶
+ }
+
+ \renewcommand{\DOTIS}[1]{%¶
+ \fboxsep=0pt
+ %\colorbox[gray]{.90}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\%
+ \nointerlineskip\raggedright%
+ \fboxsep=\myhi%
+ \colorbox[gray]{.90}{\parbox[t]{\mylen}{\CTV\FmTi{\begin{center}#1\end{center}}}}\par\nobreak%
+ %%% \colorbox[gray]{.90}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak%
+ \vskip 40\p@%¶
+ }
+
+\makeatother
+%%
+\begin{document}
+\begin{CJK}{UTF8}{song}
+
+\maketitle
+\ifdefined\HCode
+\includegraphics{assets/cover-with-names.png}
+% turn off TOC
+\else
+\pagestyle{empty}
+\begin{tikzpicture}[remember picture, overlay]
+ \node at (current page.center) {\includegraphics[width=\paperwidth, height=\paperheight]{assets/cover.png}}; \\
+ \node at (11.2, -9.5) {\huge \textbf{ how to study for beginners }}; \\
+ \node at (13.2, -10.1) {\Large \textbf{Linux内核模块编程指南}}; \\
+ \node at (14.6, -10.8) {\Large \textbf{认识与提高}};
+ \node at (14.5, -11.5) {\Large \textbf{Felix Lee}};
+\end{tikzpicture}
+\tableofcontents
+\fi
+\clearpage %
+\CJKindent%
+
+\clearpage
+\end{CJK}
+\end{document}