Commit graph

104 commits

Author SHA1 Message Date
Le Baron de Charlus
83b01baa07
Change command prompt style in chapter-04.md
Updated command syntax from '#' to '%' for clarity.
2026-07-13 10:15:53 +02:00
LeBaronDeCharlus
af44b276c2 Fixing git command leading to an error and adjust commands where sudo
was not present.

git clone --branch releng/15.0 --depth 1 https://git.FreeBSD.org/src.git src /usr/src
fatal: Too many arguments.

to

sudo git clone --branch releng/15.0 --depth 1 https://git.FreeBSD.org/src.git /usr/src
2026-07-09 14:11:53 +02:00
Edson Brandi
5b820df308
Merge pull request #26 from DtxdF/untrack-public
Don't track /public/downloads directory
2026-06-10 09:19:53 +01:00
Edson Brandi
4be733c3dd
Merge pull request #27 from DtxdF/missing-quotes
part1/chapter-04: Add missing quotes
2026-06-10 09:17:27 +01:00
Edson Brandi
af8a1eb902
Merge pull request #28 from DtxdF/fix-eisvogel-install
scripts/build-book.sh: Fix broken URL for Eisvogel
2026-06-10 09:11:36 +01:00
Edson Brandi
fe248da153
Merge pull request #25 from DtxdF/fix-detailed-readme
scripts/build-book.sh: Fix invalid README path
2026-06-10 09:04:55 +01:00
Jesús Daniel Colmenares Oviedo
e9277b40c3 part1/chapter-04: Add missing quotes 2026-06-10 01:53:52 -04:00
Jesús Daniel Colmenares Oviedo
c56b07942f scripts/build-book.sh: Fix broken URL for Eisvogel
The URL on gist.github.com doesn't work, and the current instructions
seem to indicate that the template should be installed in two files
rather than just one.
2026-06-10 01:45:27 -04:00
Jesús Daniel Colmenares Oviedo
edf9812fc8 Don't track /public/downloads 2026-06-10 01:34:27 -04:00
Jesús Daniel Colmenares Oviedo
12037eb918 scripts/build-book.sh: Fix invalid README path 2026-06-09 20:50:47 -04:00
Edson Brandi
b1b1cd0c77
Merge pull request #24 from LeeXiaolan/main
chapter-04: add the missing `S` of `SYSCTL_INT`
2026-06-08 09:39:34 +01:00
Kidd Lee
4e0b53ccb0
chapter-04: add the missing S of SYSCTL_INT
Signed-off-by: Kidd Lee <LeeXiaolan@gmail.com>
2026-06-05 22:25:03 +08:00
Edson Brandi
e4982fa6e8
Merge pull request #22 from lu4nx/fix/chinese-translation
Complete unfinished translations and manually fix translation errors
2026-05-14 13:49:33 +01:00
lu4nx
b6e3f7571c Merge branch 'main' into fix/chinese-translation 2026-05-14 19:00:03 +08:00
lu4nx
f0605065e6 Complete unfinished translations and manually fix translation errors 2026-05-14 19:00:03 +08:00
Edson Brandi
c288bfb19e Update README.md to include informations about the language zh_CN 2026-05-13 21:13:32 +00:00
Edson Brandi
2e72c740ef scripts: add zh_CN build support and language-aware dependency install
Wire Chinese (Simplified) into build-book.sh as a first-class target
alongside en_US, pt_BR, and es_ES, and teach setup_translation.sh how
to install the system packages that translated editions need.

build-book.sh:
- Add zh_CN to LANGUAGES_ALL and to every language helper
  (get_chapters_dir, get_appendices_dir, get_pandoc_lang,
  get_lang_display, normalize_lang) so it flows through the
  existing per-language build path with no special-casing.
- Wire Noto CJK fonts into the PDF build for zh_CN via the
  Eisvogel template's CJKmainfont/CJKsansfont/CJKmonofont
  variables (which auto-load xeCJK), plus a mainfont override
  so Latin text in the body matches the surrounding Chinese.
  The Latin defaults from metadata.yaml have no CJK glyphs,
  so this is required for the zh_CN PDF to render.
- Refresh help text, error messages, output-file listing,
  CONTENT SOURCES, EXAMPLES, and REQUIREMENTS to include
  zh_CN and the CJK font / texlive-lang-chinese dependencies.

setup_translation.sh:
- Add install_language_dependencies(), which maps a language
  code to the apt packages needed to build that edition:
  Noto CJK fonts + texlive-lang-chinese/cjk for zh*, the
  Japanese and Korean equivalents for ja/ko, and the
  matching texlive-lang-* packs for pt/es/fr/de/it/ru.
- Print the exact apt-get and fc-cache commands before
  running them so they can be reproduced manually, and
  fall back cleanly when apt-get is unavailable (non-Debian
  hosts) or sudo credentials are not cached.
- Add a --skip-deps flag for CI and unprivileged environments
  that just want the directory scaffolding without touching
  system packages.
- Update usage/help to document --skip-deps and the new
  zh_CN example.
2026-05-13 20:53:13 +00:00
Edson Brandi
55b603ecea
Merge pull request #20 from lu4nx/zh_CN
Add first AI-generated Chinese translation
2026-05-12 23:00:54 +01:00
lu4nx
1a16eb78ef Add first AI-generated Chinese translation 2026-05-12 18:58:06 +08:00
Edson Brandi
1e88c56f51
Merge pull request #15 from awbradle/main
Chapter 2: add a missing space after inline code
2026-04-28 09:00:31 +01:00
Edson Brandi
e7584ce958
Merge pull request #16 from johnholloway77/features/vmstat_explanation
added explanation to vmstat examples
2026-04-28 08:56:47 +01:00
johnholloway77
bdfde25ef7 added explanation to vmstat examples 2026-04-27 23:42:47 -06:00
Andie Bradley
3b42415b2e Chapter 2: add a missing space after inlined code 2026-04-27 20:04:13 -05:00
Edson Brandi
76bd7fa4b3
Merge pull request #14 from wjuszczyk/main
Fix for file's octal permissions
2026-04-27 22:49:04 +01:00
wjuszczyk
48c6916fdc
Fix for file's octal permissions 2026-04-27 20:39:57 +02:00
Edson Brandi
52e0424dd4
Merge pull request #13 from wjuszczyk/patch-1
Fix wildcards (globbing) ls output typo.
2026-04-27 18:03:14 +01:00
wjuszczyk
edfe6d9735
Fix wildcards (globbing) ls output typo. 2026-04-27 17:41:23 +02:00
Edson Brandi
c0d32ea29b
Merge pull request #11 from geertvl/patch-1
Fix clone command path in chapter-02.md
2026-04-27 14:20:45 +01:00
Geert Van Laethem
5412002814
Fix clone command path in chapter-02.md 2026-04-27 13:51:13 +02:00
Edson Brandi
6e6dac94fe Add book companion files under examples/
Organize companion code and materials by book part:

  part-01/      Foundations
  part-02/      Kernel & driver fundamentals
  part-03/      Character & block devices
  part-04/      Networking & storage
  part-05/      Buses & advanced topics
  part-06/      Debugging & performance
  part-07/      Real-world drivers
  appendices/   Supplementary material
  README.md     Overview and build instructions
2026-04-25 16:51:00 +00:00
Edson Brandi
0de35c86b5 Improve README informations 2026-04-25 14:52:22 +00:00
Edson Brandi
a5ecee722d Fix pt_BR version of appendix d to allow the proper pdf generation 2026-04-24 23:52:07 +00:00
Edson Brandi
9613347698 rename BUILD-README.md to README.md 2026-04-24 23:03:29 +00:00
Edson Brandi
526a42cec4 feat(i18n): add initial AI-generated Spanish translation
Introduce a preliminary Spanish version of the book, translated
with AI assistance using the qwen3.6:35b-a3b-bf16 model.

Note: This content has not been fully human-reviewed and may
contain errors or inconsistencies. The English version remains
the primary source of truth.

Update: scripts/book-build.sh to generate pt_BR and es_ES files

fix(docs): correct typo in chapter 6 crashing PDF workflow
2026-04-24 23:02:00 +00:00
Edson Brandi
48c1e609c6 Add credit to Ollama, Qwen and Python for the AI Assisted Translation Workflow that produced the pt_BR version of this book. 2026-04-23 20:20:38 +00:00
Edson Brandi
e4d0735183 Add Brazilian Portuguese translation generated with qwen3.6:35b-a3b-bf16
Introduce an initial Brazilian Portuguese version of the book, translated
with AI assistance using the qwen3.6:35b-a3b-bf16 model.

This translated content has not yet been fully reviewed and may still contain
translation errors, terminology inconsistencies, or passages that sound
unnatural in Portuguese. If any part of the translation is unclear or seems
incorrect, readers should refer to the original English version as the source
of truth.
2026-04-23 20:05:09 +00:00
Edson Brandi
00653fba13 Add ACKNOWLEDGMENTS.md and some small fixes 2026-04-23 08:46:21 +00:00
Edson Brandi
42a979a40e Update the files needed to generate the .pdf and .epub 2026-04-22 21:48:00 +00:00
Edson Brandi
f92af5b969 docs: complete initial draft of all content for my FreeBSD Device Drivers: From First Steps to Kernel Mastery book.
After 10 months of daily work, the first full draft of the book is now complete.
2026-04-22 18:57:42 +00:00
Edson Brandi
92ac73a6fb Cleanup to reorganize the example files under examples/ directory 2026-04-22 18:48:19 +00:00
Edson Brandi
68843d0e40 removed binary files 2025-11-08 22:56:12 +00:00
Edson Brandi
763601b5bc
Add Chapter 4 source code examples and exercises
Introduce the first batch of practical code examples for Chapter 4,
covering fundamental C programming.
2025-11-07 23:34:26 +00:00
Edson Brandi
be78fa799d Fix null terminator demonstration to show undefined behavior
The previous example wasn't reliably demonstrating the danger of missing
null terminators because the stack happened to contain a '\0' byte
immediately after the array, making the broken code appear to work.

Added memset() to fill the stack with non-zero values before declaring
the unterminated array. This ensures the broken example actually exhibits
undefined behavior by reading past the array boundary, making the lesson
about null terminators clear and visible.

Changes:
- Added garbage array filled with 'Z' characters using memset()
- This forces printf() to read past the broken array until finding '\0'
- Readers now see actual garbage output demonstrating why null
  terminators are required in C strings
2025-11-07 22:57:09 +00:00
Edson Brandi
87e7742451 Specify FreeBSD 14.3 release branch in git clone commands
Updated all git clone commands for the FreeBSD source repository to
explicitly checkout the releng/14.3 branch. This ensures readers are
working with FreeBSD 14.3 Release source code, which matches the
version used throughout the book examples.

Changed from:
  git clone https://git.freebsd.org/src.git /usr/src

To:
  git clone -b releng/14.3 https://git.freebsd.org/src.git /usr/src

This prevents confusion from version mismatches and ensures all kernel
module examples compile and function as documented.
2025-11-07 22:17:40 +00:00
Edson Brandi
c7c03a1da2
Add Chapter 3 shell scripting examples
Add comprehensive shell scripting examples covering fundamental concepts:
- Basic scripts: hello.sh, vars.sh, status.sh
- Control flow: case.sh, loops.sh
- Functions and debugging: functions.sh, debug_demo.sh
- File handling: list_files variants (POSIX, bash, exec approaches)
- Practical utilities: backup.sh, organize_downloads.sh
- Advanced topics: IFS handling, temporary file management

These examples demonstrate portable shell scripting practices for
FreeBSD driver development workflows.
2025-11-07 22:00:05 +00:00
Edson Brandi
712daf6c49 Fix subshell variable scope issue in file counting scripts
The count variable was not being updated because the while loops were
running in subshells created by the pipe operator. Variable assignments
in subshells don't affect the parent shell, causing count to remain 0.

Changes:
- list_files.sh: Changed from pipe to here-document with command
  substitution to keep the while loop in the main shell
- list_files_bash.sh: Changed from pipe to process substitution using
  < <(...) syntax to avoid subshell creation for the while loop

Both scripts now correctly display the total number of files found.
2025-11-07 21:53:51 +00:00
Edson Brandi
ba961a1fee
Added chapter 2 source file for hello_world kernel module 2025-11-07 20:56:04 +00:00
Edson Brandi
66c0446388 Fixed minor errors found during an adhoc review 2025-11-07 18:42:06 +00:00
Edson Brandi
920d4fa330 Adjusted the Wrapping up Sections to better reflect the actual chapter content after the adition of new section about shell portability 2025-11-05 21:46:40 +00:00
Edson Brandi
b001b9aa28
Update chapter-03.md to fix wrapping up section position
Adjusted the position of wrapping up section for the shell section.
2025-11-04 23:10:37 +00:00