Commit graph

68 commits

Author SHA1 Message Date
bc09e717d9 was unable to ssh into vm without sysrc firewall_allowservices=any 2026-07-18 02:08:45 -07:00
fbe50a5e38 update ipfw as I could not ssh into my vm unless I added this link https://www.freebsdsoftware.org/blog/ipfw-freebsd-setup.html 2026-07-18 01:38:24 -07:00
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
Jesús Daniel Colmenares Oviedo
e9277b40c3 part1/chapter-04: Add missing quotes 2026-06-10 01:53:52 -04: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
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
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
wjuszczyk
48c6916fdc
Fix for file's octal permissions 2026-04-27 20:39:57 +02:00
wjuszczyk
edfe6d9735
Fix wildcards (globbing) ls output typo. 2026-04-27 17:41:23 +02:00
Geert Van Laethem
5412002814
Fix clone command path in chapter-02.md 2026-04-27 13:51:13 +02:00
Edson Brandi
00653fba13 Add ACKNOWLEDGMENTS.md and some small fixes 2026-04-23 08:46:21 +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
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
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
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
johnholloway77
98204d3d9f incorporated section on shell portability 2025-11-04 14:53:47 -07:00
Edson Brandi
f4c2a92c61
Merge pull request #5 from johnholloway77/feature/at-command-revision
Added instructions for at.allow
2025-11-03 23:58:30 +00:00
johnholloway77
b6605cc603 Added instructions for at.allow 2025-11-03 16:51:04 -07:00
Edson Brandi
cf61c0ff27 Fixed the script to solve the issue reported at https://github.com/ebrandi/FDD-book/issues/2 by johnholloway77
THis fix make the script fully POSIX-compliant for FreeBSD /bin/sh

Replace bash-specific `read -d ''` with tmpfile approach.
The -d option is not available in POSIX sh, causing the script
to fail on FreeBSD systems.

- Use tmpfile=$(mktemp) instead of null-delimited pipe
- Add trap for cleanup
- Remove -print0 and read -d '' options
- Add empty filename safety check

Fixes: read: Illegal option -d
2025-11-03 22:55:24 +00:00
Edson Brandi
915fb8df92 docs(book): add Chapter 6 draft (Anatomy of a FreeBSD Driver)
Adds the full draft of Chapter 6. This chapter has had only a single
review so far; readers should expect further edits and refinements
before the final book release.

Known issue:
- In the generated PDF, some code blocks appear before the section
  titles they belong to. This seems to be a Pandoc rendering quirk.
  I’ll investigate and fix later; for now, treat the Markdown as the
  source of truth.

No functional changes to earlier chapters.
2025-11-01 16:37:18 +00:00
Edson Brandi
c797046ae2 Fixed markdown issue that was generating error in pdf conversion, i missed some lines in the previous commit 2025-10-27 20:49:34 +00:00
Edson Brandi
8388fe50dd Fixed markdown issue that was generating error when being converted to pdf file. Thank you Isabelle Gonçalves for catching that bug! 2025-10-27 20:32:09 +00:00
Edson Brandi
87cfb19c2a fixed chapter 5 table of content formating 2025-10-14 19:36:52 +01:00
Edson Brandi
aecb21e649 Moving chapter 6 to draft stage 2025-10-13 23:35:48 +01:00
Edson Brandi
8e54fdc2bd Added the content for chapter 5, september was a hetic month at work and i had very little time to write... 2025-10-13 23:04:49 +01:00
Edson Brandi
b497957d9a Add scripts to generate the PDF and epub book files 2025-08-31 03:36:05 +01:00
Edson Brandi
5e9d9147d1 Fixing markdown to convert to pdf 2025-08-30 22:30:50 +01:00
Edson Brandi
81498906fe add chapter description to chapter header 2025-08-30 13:18:53 +01:00
Edson Brandi
a76643c253 Chapter 4 Finished, starting chapter 5 2025-08-30 13:12:51 +01:00
Edson Brandi
2e9165ae47 Progressing with chapter 4... 2025-08-29 00:07:11 +01:00
Edson Brandi
fd69335cc9 Added Struct and Typedef Section to Chapter 4 2025-08-28 00:01:07 +01:00
Edson Brandi
be051d9f51 Added the section about Arrays and Strings to chapter 4 2025-08-26 21:32:22 +01:00
Edson Brandi
bca5a7bb43 Progressing with chapter 4 content, finished section about pointers. 2025-08-25 23:26:01 +01:00
Edson Brandi
3320ee1a92 progressing chapter 4 content about pointers 2025-08-25 17:25:28 +01:00
Edson Brandi
14cba2419e Adding chapter 1 content 2025-08-24 13:52:06 +01:00
Edson Brandi
74d65e79f0 Fix images urls to work in github and project site 2025-08-24 00:44:08 +01:00
Edson Brandi
b925e7223a Adding the content for chapter 2 2025-08-24 00:41:03 +01:00
Edson Brandi
19234d79fd Adding images for chapter 2 2025-08-24 00:04:11 +01:00
Edson Brandi
c7c27ffb17 adding description to the .md file header 2025-08-23 17:03:44 +01:00
Edson Brandi
db2c220017 fixing typos... 2025-08-23 16:52:39 +01:00
Edson Brandi
a4af37ac03 Adding content for chapter 3, and small typo fix in chapter 4 2025-08-23 16:34:36 +01:00
Edson Brandi
10db731875
Progressing chapter 4, added Pointers and Functions and Pointers and Arrays 2025-08-21 20:47:07 +01:00
Edson Brandi
24e6a0970c
Progressing chapter 4, added the topic about Declaring and Using Pointers... 2025-08-21 00:15:47 +01:00
Edson Brandi
4534b904e0
Progressing chapter 4 to add first topic about pointers, and also fixing double quotes and single quotes to have a standard across the chapter 2025-08-19 01:22:24 +01:00
Edson Brandi
9187c98bf1 Progressing chapter 4, finished section about functions - Parameters Are Copies 2025-08-15 16:53:41 -03:00