From 539ef021f88cc0f2062b60c99c94482656de1891 Mon Sep 17 00:00:00 2001 From: Edson Brandi Date: Mon, 4 Aug 2025 09:14:49 -0300 Subject: [PATCH] feat: Initial upload of FreeBSD Device Drivers Book structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit establishes the complete foundation for the FreeBSD Device Drivers Book project. ## 📚 Book Structure - **7 Parts** covering the complete driver development journey - **38 Chapters** with detailed metadata and placeholders - **5 Appendices** for reference materials - **Portuguese (Brazil) translation** structure ready ## 🗂️ Directory Organization - - Main book content with chapters and appendices - - Source code examples with comprehensive README - - Utility scripts for content management - - Multi-language support structure ## 🛠️ Key Features Added - **Content Management Scripts**: - - Sync content to website directory - - Set up new language translations - **Examples Documentation** - Complete README with build instructions - **Translation Infrastructure** - Ready for multiple languages ## 📖 Content Overview - **Part 1**: Foundations (FreeBSD, C, Kernel basics) - **Part 2**: Basic Driver Development - **Part 3**: Concurrency and Synchronization - **Part 4**: Hardware and Platform Integration - **Part 5**: Debugging, Tools, and Real-World Practices - **Part 6**: Transport-Specific Drivers - **Part 7**: Mastery Topics and Edge Cases --- README.md | 136 +++++++++- content/appendices/appendix-a.md | 12 + content/appendices/appendix-b.md | 13 + content/appendices/appendix-c.md | 13 + content/appendices/appendix-d.md | 14 + content/appendices/appendix-e.md | 13 + content/chapters/part1/chapter-01.md | 16 ++ content/chapters/part1/chapter-02.md | 13 + content/chapters/part1/chapter-03.md | 14 + content/chapters/part1/chapter-04.md | 13 + content/chapters/part1/chapter-05.md | 13 + content/chapters/part1/chapter-06.md | 14 + content/chapters/part2/chapter-07.md | 14 + content/chapters/part2/chapter-08.md | 13 + content/chapters/part2/chapter-09.md | 13 + content/chapters/part2/chapter-10.md | 13 + content/chapters/part3/chapter-11.md | 14 + content/chapters/part3/chapter-12.md | 15 ++ content/chapters/part3/chapter-13.md | 14 + content/chapters/part3/chapter-14.md | 14 + content/chapters/part3/chapter-15.md | 14 + content/chapters/part4/chapter-16.md | 14 + content/chapters/part4/chapter-17.md | 14 + content/chapters/part4/chapter-18.md | 14 + content/chapters/part4/chapter-19.md | 14 + content/chapters/part4/chapter-20.md | 15 ++ content/chapters/part4/chapter-21.md | 15 ++ content/chapters/part4/chapter-22.md | 14 + content/chapters/part5/chapter-23.md | 15 ++ content/chapters/part5/chapter-24.md | 15 ++ content/chapters/part5/chapter-25.md | 14 + content/chapters/part6/chapter-26.md | 14 + content/chapters/part6/chapter-27.md | 14 + content/chapters/part6/chapter-28.md | 14 + content/chapters/part7/chapter-29.md | 14 + content/chapters/part7/chapter-30.md | 14 + content/chapters/part7/chapter-31.md | 15 ++ content/chapters/part7/chapter-32.md | 14 + content/chapters/part7/chapter-33.md | 14 + content/chapters/part7/chapter-34.md | 14 + content/chapters/part7/chapter-35.md | 15 ++ content/chapters/part7/chapter-36.md | 14 + content/chapters/part7/chapter-37.md | 14 + content/chapters/part7/chapter-38.md | 14 + examples/README.md | 167 ++++++++++++ scripts/setup_translation.sh | 240 ++++++++++++++++++ scripts/sync_content.sh | 145 +++++++++++ translations/pt_BR/appendices/appendix-a.md | 12 + translations/pt_BR/appendices/appendix-b.md | 13 + translations/pt_BR/appendices/appendix-c.md | 13 + translations/pt_BR/appendices/appendix-d.md | 14 + translations/pt_BR/appendices/appendix-e.md | 13 + .../pt_BR/chapters/part1/chapter-01.md | 16 ++ .../pt_BR/chapters/part1/chapter-02.md | 13 + .../pt_BR/chapters/part1/chapter-03.md | 14 + .../pt_BR/chapters/part1/chapter-04.md | 13 + .../pt_BR/chapters/part1/chapter-05.md | 13 + .../pt_BR/chapters/part1/chapter-06.md | 14 + .../pt_BR/chapters/part2/chapter-07.md | 14 + .../pt_BR/chapters/part2/chapter-08.md | 13 + .../pt_BR/chapters/part2/chapter-09.md | 13 + .../pt_BR/chapters/part2/chapter-10.md | 13 + .../pt_BR/chapters/part3/chapter-11.md | 14 + .../pt_BR/chapters/part3/chapter-12.md | 15 ++ .../pt_BR/chapters/part3/chapter-13.md | 14 + .../pt_BR/chapters/part3/chapter-14.md | 14 + .../pt_BR/chapters/part3/chapter-15.md | 14 + .../pt_BR/chapters/part4/chapter-16.md | 14 + .../pt_BR/chapters/part4/chapter-17.md | 14 + .../pt_BR/chapters/part4/chapter-18.md | 14 + .../pt_BR/chapters/part4/chapter-19.md | 14 + .../pt_BR/chapters/part4/chapter-20.md | 15 ++ .../pt_BR/chapters/part4/chapter-21.md | 15 ++ .../pt_BR/chapters/part4/chapter-22.md | 14 + .../pt_BR/chapters/part5/chapter-23.md | 15 ++ .../pt_BR/chapters/part5/chapter-24.md | 15 ++ .../pt_BR/chapters/part5/chapter-25.md | 14 + .../pt_BR/chapters/part6/chapter-26.md | 14 + .../pt_BR/chapters/part6/chapter-27.md | 14 + .../pt_BR/chapters/part6/chapter-28.md | 14 + .../pt_BR/chapters/part7/chapter-29.md | 14 + .../pt_BR/chapters/part7/chapter-30.md | 14 + .../pt_BR/chapters/part7/chapter-31.md | 15 ++ .../pt_BR/chapters/part7/chapter-32.md | 14 + .../pt_BR/chapters/part7/chapter-33.md | 14 + .../pt_BR/chapters/part7/chapter-34.md | 14 + .../pt_BR/chapters/part7/chapter-35.md | 15 ++ .../pt_BR/chapters/part7/chapter-36.md | 14 + .../pt_BR/chapters/part7/chapter-37.md | 14 + .../pt_BR/chapters/part7/chapter-38.md | 14 + 90 files changed, 1886 insertions(+), 2 deletions(-) create mode 100644 content/appendices/appendix-a.md create mode 100644 content/appendices/appendix-b.md create mode 100644 content/appendices/appendix-c.md create mode 100644 content/appendices/appendix-d.md create mode 100644 content/appendices/appendix-e.md create mode 100644 content/chapters/part1/chapter-01.md create mode 100644 content/chapters/part1/chapter-02.md create mode 100644 content/chapters/part1/chapter-03.md create mode 100644 content/chapters/part1/chapter-04.md create mode 100644 content/chapters/part1/chapter-05.md create mode 100644 content/chapters/part1/chapter-06.md create mode 100644 content/chapters/part2/chapter-07.md create mode 100644 content/chapters/part2/chapter-08.md create mode 100644 content/chapters/part2/chapter-09.md create mode 100644 content/chapters/part2/chapter-10.md create mode 100644 content/chapters/part3/chapter-11.md create mode 100644 content/chapters/part3/chapter-12.md create mode 100644 content/chapters/part3/chapter-13.md create mode 100644 content/chapters/part3/chapter-14.md create mode 100644 content/chapters/part3/chapter-15.md create mode 100644 content/chapters/part4/chapter-16.md create mode 100644 content/chapters/part4/chapter-17.md create mode 100644 content/chapters/part4/chapter-18.md create mode 100644 content/chapters/part4/chapter-19.md create mode 100644 content/chapters/part4/chapter-20.md create mode 100644 content/chapters/part4/chapter-21.md create mode 100644 content/chapters/part4/chapter-22.md create mode 100644 content/chapters/part5/chapter-23.md create mode 100644 content/chapters/part5/chapter-24.md create mode 100644 content/chapters/part5/chapter-25.md create mode 100644 content/chapters/part6/chapter-26.md create mode 100644 content/chapters/part6/chapter-27.md create mode 100644 content/chapters/part6/chapter-28.md create mode 100644 content/chapters/part7/chapter-29.md create mode 100644 content/chapters/part7/chapter-30.md create mode 100644 content/chapters/part7/chapter-31.md create mode 100644 content/chapters/part7/chapter-32.md create mode 100644 content/chapters/part7/chapter-33.md create mode 100644 content/chapters/part7/chapter-34.md create mode 100644 content/chapters/part7/chapter-35.md create mode 100644 content/chapters/part7/chapter-36.md create mode 100644 content/chapters/part7/chapter-37.md create mode 100644 content/chapters/part7/chapter-38.md create mode 100644 examples/README.md create mode 100755 scripts/setup_translation.sh create mode 100755 scripts/sync_content.sh create mode 100644 translations/pt_BR/appendices/appendix-a.md create mode 100644 translations/pt_BR/appendices/appendix-b.md create mode 100644 translations/pt_BR/appendices/appendix-c.md create mode 100644 translations/pt_BR/appendices/appendix-d.md create mode 100644 translations/pt_BR/appendices/appendix-e.md create mode 100644 translations/pt_BR/chapters/part1/chapter-01.md create mode 100644 translations/pt_BR/chapters/part1/chapter-02.md create mode 100644 translations/pt_BR/chapters/part1/chapter-03.md create mode 100644 translations/pt_BR/chapters/part1/chapter-04.md create mode 100644 translations/pt_BR/chapters/part1/chapter-05.md create mode 100644 translations/pt_BR/chapters/part1/chapter-06.md create mode 100644 translations/pt_BR/chapters/part2/chapter-07.md create mode 100644 translations/pt_BR/chapters/part2/chapter-08.md create mode 100644 translations/pt_BR/chapters/part2/chapter-09.md create mode 100644 translations/pt_BR/chapters/part2/chapter-10.md create mode 100644 translations/pt_BR/chapters/part3/chapter-11.md create mode 100644 translations/pt_BR/chapters/part3/chapter-12.md create mode 100644 translations/pt_BR/chapters/part3/chapter-13.md create mode 100644 translations/pt_BR/chapters/part3/chapter-14.md create mode 100644 translations/pt_BR/chapters/part3/chapter-15.md create mode 100644 translations/pt_BR/chapters/part4/chapter-16.md create mode 100644 translations/pt_BR/chapters/part4/chapter-17.md create mode 100644 translations/pt_BR/chapters/part4/chapter-18.md create mode 100644 translations/pt_BR/chapters/part4/chapter-19.md create mode 100644 translations/pt_BR/chapters/part4/chapter-20.md create mode 100644 translations/pt_BR/chapters/part4/chapter-21.md create mode 100644 translations/pt_BR/chapters/part4/chapter-22.md create mode 100644 translations/pt_BR/chapters/part5/chapter-23.md create mode 100644 translations/pt_BR/chapters/part5/chapter-24.md create mode 100644 translations/pt_BR/chapters/part5/chapter-25.md create mode 100644 translations/pt_BR/chapters/part6/chapter-26.md create mode 100644 translations/pt_BR/chapters/part6/chapter-27.md create mode 100644 translations/pt_BR/chapters/part6/chapter-28.md create mode 100644 translations/pt_BR/chapters/part7/chapter-29.md create mode 100644 translations/pt_BR/chapters/part7/chapter-30.md create mode 100644 translations/pt_BR/chapters/part7/chapter-31.md create mode 100644 translations/pt_BR/chapters/part7/chapter-32.md create mode 100644 translations/pt_BR/chapters/part7/chapter-33.md create mode 100644 translations/pt_BR/chapters/part7/chapter-34.md create mode 100644 translations/pt_BR/chapters/part7/chapter-35.md create mode 100644 translations/pt_BR/chapters/part7/chapter-36.md create mode 100644 translations/pt_BR/chapters/part7/chapter-37.md create mode 100644 translations/pt_BR/chapters/part7/chapter-38.md diff --git a/README.md b/README.md index 471aa88..e33e268 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,134 @@ -# FDD-book -FreeBSD Device Driver Book +# FreeBSD Device Drivers: From First Steps to Kernel Mastery + +## 🌐 Live Site + +**Production URL**: https://freebsd.edsonbrandi.com +**Repository**: https://github.com/ebrandi/FDD-book + +## 📖 About the Book + +"FreeBSD Device Drivers: From First Steps to Kernel Mastery" - is a comprehensive, community-driven guide to writing device drivers for FreeBSD. The book covers everything from basic concepts to advanced topics like interrupt handling, DMA, and performance optimization. + +### What You'll Learn + +- **Foundation & Environment**: UNIX fundamentals, C programming, and development setup +- **Core Driver Development**: Building your first device driver and understanding kernel modules +- **Advanced System Programming**: Concurrency, synchronization, and memory management +- **Hardware Integration**: PCI drivers, interrupts, DMA, and power management +- **Debugging & Optimization**: FreeBSD-specific debugging tools and performance tuning +- **Professional Development**: Portable drivers, specialized hardware, and open-source contribution + +### Project Structure + +``` +FDD-book/ +├── content/ # Book content (Markdown files) +│ ├── appendices/ # Appendix markdown files +│ └── chapters/ # Chapter markdown files by part +├── examples/ # Book Code Examples +│ ├── appendices/ # Source Code from appendices +│ └── chapters/ # Source Code from appendices +├── translations/ # Book content translated +│ └── pt_BR/ # Content in pt_BR +│ ├── appendices/ # +│ └── chapters/ # +└── scripts/ # Utility scripts +``` + +## 📝 Content Management + +### Adding New Chapters + +1. **Create a new markdown file** in the appropriate part directory: + ```bash + content/chapters/part1/chapter-07.md + ``` + +2. **Add YAML frontmatter**: + ```yaml + --- + title: "Chapter Title" + description: "Chapter description" + chapter: 7 + part: 1 + status: "draft" # planned, draft, revised, complete + estimatedReadTime: 15 + lastUpdated: "2025-01-14" + author: "Author Name" + reviewer: "Reviewer Name" + --- + ``` + +3. **Write your content** in Markdown format + +### Adding New Appendices + +1. **Create a new markdown file** in the appendices directory: + ```bash + content/appendices/appendix-f.md + ``` + +2. **Add YAML frontmatter**: + ```yaml + --- + title: "Appendix Title" + description: "Appendix description" + status: "draft" + estimatedReadTime: 10 + lastUpdated: "2025-01-14" + author: "Author Name" + reviewer: "Reviewer Name" + --- + ``` + +### Content Status Types + +- **`planned`**: Content is planned but not yet started +- **`draft`**: Initial content written, needs review +- **`revised`**: Content reviewed and revised +- **`complete`**: Content finalized and ready for publication + +## 🤝 Contributing + +We welcome contributions! Please see our [Contributing Guide](https://freebsd.edsonbrandi.com/contribute) for detailed information. + +### Ways to Contribute + +- **Content**: Add new chapters, improve existing content +- **Review**: Technical review and proofreading +- **Translation**: Help translate the book to other languages +- **Code**: Improve the website and add features +- **Issues**: Report bugs and suggest improvements + +### Development Workflow + +1. Fork the repository +2. Create a feature branch: `git checkout -b feature/your-feature` +3. Make your changes +4. Test your changes: `npm run build` +5. Commit your changes: `git commit -m "Add your feature"` +6. Push to your fork: `git push origin feature/your-feature` +7. Create a Pull Request + +## 📄 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## 🙏 Acknowledgments + +- The FreeBSD development community +- All contributors and reviewers +- The open-source community for tools and inspiration + +## 📞 Support + +- **Website**: https://freebsd.edsonbrandi.com +- **Repository**: https://github.com/ebrandi/FDD-book +- **Issues**: [GitHub Issues](https://github.com/ebrandi/FDD-book/issues) +- **Discussions**: [GitHub Discussions](https://github.com/ebrandi/FDD-book/discussions) + +--- + +**Author**: Edson Brandi (ebrandi@FreeBSD.org) +**Website**: https://freebsd.edsonbrandi.com +**Repository**: https://github.com/ebrandi/FDD-book diff --git a/content/appendices/appendix-a.md b/content/appendices/appendix-a.md new file mode 100644 index 0000000..1b34671 --- /dev/null +++ b/content/appendices/appendix-a.md @@ -0,0 +1,12 @@ +--- +title: "FreeBSD Kernel API Reference" +description: "Comprehensive reference for FreeBSD kernel APIs, system calls, and data structures used in device driver development." +status: "planned" +estimatedReadTime: 25 +date: "2024-01-15" +author: "Edson Brandi" +reviewer: "FreeBSD Community" +--- + +planned + diff --git a/content/appendices/appendix-b.md b/content/appendices/appendix-b.md new file mode 100644 index 0000000..929b668 --- /dev/null +++ b/content/appendices/appendix-b.md @@ -0,0 +1,13 @@ +--- +title: "Algorithms and Logic for Systems Programming" +description: "Common algorithms and logical patterns used in systems programming and device drivers" +appendix: "B" +date: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned diff --git a/content/appendices/appendix-c.md b/content/appendices/appendix-c.md new file mode 100644 index 0000000..b4d273c --- /dev/null +++ b/content/appendices/appendix-c.md @@ -0,0 +1,13 @@ +--- +title: "Hardware Concepts for Driver Developers" +description: "Essential hardware concepts and terminology for device driver development" +appendix: "C" +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 30 +--- + +planned diff --git a/content/appendices/appendix-d.md b/content/appendices/appendix-d.md new file mode 100644 index 0000000..1c383ec --- /dev/null +++ b/content/appendices/appendix-d.md @@ -0,0 +1,14 @@ +--- +title: "Operating System Concepts" +description: "Core operating system concepts relevant to device driver development" +appendix: "D" +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned + diff --git a/content/appendices/appendix-e.md b/content/appendices/appendix-e.md new file mode 100644 index 0000000..e64fd72 --- /dev/null +++ b/content/appendices/appendix-e.md @@ -0,0 +1,13 @@ +--- +title: "FreeBSD Internals and Kernel Reference" +description: "Comprehensive reference for FreeBSD kernel internals and APIs" +appendix: "E" +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 35 +--- + +planned diff --git a/content/chapters/part1/chapter-01.md b/content/chapters/part1/chapter-01.md new file mode 100644 index 0000000..9b70a3c --- /dev/null +++ b/content/chapters/part1/chapter-01.md @@ -0,0 +1,16 @@ +--- +title: "Introduction" +description: "Introduction to FreeBSD device driver development and the journey ahead" +partNumber: 1 +partName: "Foundations: FreeBSD, C, and the Kernel" +chapter: 1 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +date: "2025-08-01" +estimatedReadTime: 15 +--- + +planned diff --git a/content/chapters/part1/chapter-02.md b/content/chapters/part1/chapter-02.md new file mode 100644 index 0000000..39ae00b --- /dev/null +++ b/content/chapters/part1/chapter-02.md @@ -0,0 +1,13 @@ +--- +title: "Setting Up Your Lab" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 2 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 20 +--- + +planned diff --git a/content/chapters/part1/chapter-03.md b/content/chapters/part1/chapter-03.md new file mode 100644 index 0000000..baa3f9d --- /dev/null +++ b/content/chapters/part1/chapter-03.md @@ -0,0 +1,14 @@ +--- +title: "A Gentle Introduction to UNIX" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 3 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 18 +--- + +planned + diff --git a/content/chapters/part1/chapter-04.md b/content/chapters/part1/chapter-04.md new file mode 100644 index 0000000..fa93e7e --- /dev/null +++ b/content/chapters/part1/chapter-04.md @@ -0,0 +1,13 @@ +--- +title: "A First Look at the C Programming Language" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 4 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned diff --git a/content/chapters/part1/chapter-05.md b/content/chapters/part1/chapter-05.md new file mode 100644 index 0000000..cfc1758 --- /dev/null +++ b/content/chapters/part1/chapter-05.md @@ -0,0 +1,13 @@ +--- +title: "Understanding C for Kernel Programming" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 5 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 30 +--- + +planned diff --git a/content/chapters/part1/chapter-06.md b/content/chapters/part1/chapter-06.md new file mode 100644 index 0000000..a477069 --- /dev/null +++ b/content/chapters/part1/chapter-06.md @@ -0,0 +1,14 @@ +--- +title: "The Anatomy of a FreeBSD Driver" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 6 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 22 +--- + +planned + diff --git a/content/chapters/part2/chapter-07.md b/content/chapters/part2/chapter-07.md new file mode 100644 index 0000000..365a5ee --- /dev/null +++ b/content/chapters/part2/chapter-07.md @@ -0,0 +1,14 @@ +--- +title: "Writing Your First Driver" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 7 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 28 +--- + +planned + diff --git a/content/chapters/part2/chapter-08.md b/content/chapters/part2/chapter-08.md new file mode 100644 index 0000000..ebe4ca3 --- /dev/null +++ b/content/chapters/part2/chapter-08.md @@ -0,0 +1,13 @@ +--- +title: "Working with Device Files" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 8 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 20 +--- + +planned diff --git a/content/chapters/part2/chapter-09.md b/content/chapters/part2/chapter-09.md new file mode 100644 index 0000000..458b70b --- /dev/null +++ b/content/chapters/part2/chapter-09.md @@ -0,0 +1,13 @@ +--- +title: "Reading and Writing to Devices" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 9 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned diff --git a/content/chapters/part2/chapter-10.md b/content/chapters/part2/chapter-10.md new file mode 100644 index 0000000..1c7014a --- /dev/null +++ b/content/chapters/part2/chapter-10.md @@ -0,0 +1,13 @@ +--- +title: "Handling Input and Output Efficiently" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 10 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 23 +--- + +planned diff --git a/content/chapters/part3/chapter-11.md b/content/chapters/part3/chapter-11.md new file mode 100644 index 0000000..8460642 --- /dev/null +++ b/content/chapters/part3/chapter-11.md @@ -0,0 +1,14 @@ +--- +title: "Concurrency in Drivers" +description: "Understanding and managing concurrent operations in device drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 11 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part3/chapter-12.md b/content/chapters/part3/chapter-12.md new file mode 100644 index 0000000..4c3027e --- /dev/null +++ b/content/chapters/part3/chapter-12.md @@ -0,0 +1,15 @@ +--- +title: "Synchronization Mechanisms" +description: "Implementing proper synchronization in FreeBSD device drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 12 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part3/chapter-13.md b/content/chapters/part3/chapter-13.md new file mode 100644 index 0000000..1088a3c --- /dev/null +++ b/content/chapters/part3/chapter-13.md @@ -0,0 +1,14 @@ +--- +title: "Timers and Delayed Work" +description: "Implementing time-based operations and delayed execution in drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 13 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part3/chapter-14.md b/content/chapters/part3/chapter-14.md new file mode 100644 index 0000000..1f9ae9f --- /dev/null +++ b/content/chapters/part3/chapter-14.md @@ -0,0 +1,14 @@ +--- +title: "Taskqueues and Deferred Work" +description: "Using taskqueues for deferred processing in device drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 14 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part3/chapter-15.md b/content/chapters/part3/chapter-15.md new file mode 100644 index 0000000..1e430d1 --- /dev/null +++ b/content/chapters/part3/chapter-15.md @@ -0,0 +1,14 @@ +--- +title: "More Synchronization — Conditions, Semaphores, and Coordination" +description: "Advanced synchronization techniques for complex driver scenarios" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 15 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part4/chapter-16.md b/content/chapters/part4/chapter-16.md new file mode 100644 index 0000000..c77c8d1 --- /dev/null +++ b/content/chapters/part4/chapter-16.md @@ -0,0 +1,14 @@ +--- +title: "Accessing Hardware" +description: "Direct hardware access techniques for device drivers" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 16 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part4/chapter-17.md b/content/chapters/part4/chapter-17.md new file mode 100644 index 0000000..46924d9 --- /dev/null +++ b/content/chapters/part4/chapter-17.md @@ -0,0 +1,14 @@ +--- +title: "Simulating Hardware" +description: "Creating virtual hardware for testing and development purposes" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 17 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part4/chapter-18.md b/content/chapters/part4/chapter-18.md new file mode 100644 index 0000000..a4f11b4 --- /dev/null +++ b/content/chapters/part4/chapter-18.md @@ -0,0 +1,14 @@ +--- +title: "Writing a PCI Driver" +description: "Developing drivers for PCI and PCIe devices" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 18 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part4/chapter-19.md b/content/chapters/part4/chapter-19.md new file mode 100644 index 0000000..ff58311 --- /dev/null +++ b/content/chapters/part4/chapter-19.md @@ -0,0 +1,14 @@ +--- +title: "Handling Interrupts" +description: "Implementing interrupt handling in FreeBSD device drivers" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 19 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part4/chapter-20.md b/content/chapters/part4/chapter-20.md new file mode 100644 index 0000000..ff26bc8 --- /dev/null +++ b/content/chapters/part4/chapter-20.md @@ -0,0 +1,15 @@ +--- +title: "Advanced Interrupt Handling" +description: "Sophisticated interrupt handling techniques and optimizations" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 20 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part4/chapter-21.md b/content/chapters/part4/chapter-21.md new file mode 100644 index 0000000..e698011 --- /dev/null +++ b/content/chapters/part4/chapter-21.md @@ -0,0 +1,15 @@ +--- +title: "DMA and High-Speed Data Transfer" +description: "Implementing Direct Memory Access for efficient data transfer" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 21 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part4/chapter-22.md b/content/chapters/part4/chapter-22.md new file mode 100644 index 0000000..be60bd4 --- /dev/null +++ b/content/chapters/part4/chapter-22.md @@ -0,0 +1,14 @@ +--- +title: "Power Management" +description: "Implementing power management features in device drivers" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 22 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part5/chapter-23.md b/content/chapters/part5/chapter-23.md new file mode 100644 index 0000000..2d5e01b --- /dev/null +++ b/content/chapters/part5/chapter-23.md @@ -0,0 +1,15 @@ +--- +title: "Debugging and Tracing" +description: "Tools and techniques for debugging FreeBSD device drivers" +partNumber: 5 +partName: "Debugging, Tools, and Real-World Practices" +chapter: 23 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part5/chapter-24.md b/content/chapters/part5/chapter-24.md new file mode 100644 index 0000000..fe5f4f5 --- /dev/null +++ b/content/chapters/part5/chapter-24.md @@ -0,0 +1,15 @@ +--- +title: "Integrating with the Kernel" +description: "Best practices for kernel integration and driver architecture" +partNumber: 5 +partName: "Debugging, Tools, and Real-World Practices" +chapter: 24 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part5/chapter-25.md b/content/chapters/part5/chapter-25.md new file mode 100644 index 0000000..3bcb1e2 --- /dev/null +++ b/content/chapters/part5/chapter-25.md @@ -0,0 +1,14 @@ +--- +title: "Advanced Topics and Practical Tips" +description: "Advanced techniques and practical advice for driver development" +partNumber: 5 +partName: "Debugging, Tools, and Real-World Practices" +chapter: 25 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part6/chapter-26.md b/content/chapters/part6/chapter-26.md new file mode 100644 index 0000000..ba0c8d0 --- /dev/null +++ b/content/chapters/part6/chapter-26.md @@ -0,0 +1,14 @@ +--- +title: "USB and Serial Drivers" +description: "Developing drivers for USB and serial communication devices" +partNumber: 6 +partName: "Writing Transport-Specific Drivers" +chapter: 26 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part6/chapter-27.md b/content/chapters/part6/chapter-27.md new file mode 100644 index 0000000..c318347 --- /dev/null +++ b/content/chapters/part6/chapter-27.md @@ -0,0 +1,14 @@ +--- +title: "Working with Storage Devices and the VFS Layer" +description: "Developing storage device drivers and VFS integration" +partNumber: 6 +partName: "Writing Transport-Specific Drivers" +chapter: 27 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part6/chapter-28.md b/content/chapters/part6/chapter-28.md new file mode 100644 index 0000000..d4c796f --- /dev/null +++ b/content/chapters/part6/chapter-28.md @@ -0,0 +1,14 @@ +--- +title: "Writing a Network Driver" +description: "Developing network interface drivers for FreeBSD" +partNumber: 6 +partName: "Writing Transport-Specific Drivers" +chapter: 28 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-29.md b/content/chapters/part7/chapter-29.md new file mode 100644 index 0000000..89d2e44 --- /dev/null +++ b/content/chapters/part7/chapter-29.md @@ -0,0 +1,14 @@ +--- +title: "Portability and Driver Abstraction" +description: "Creating portable drivers across different FreeBSD architectures" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 29 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-30.md b/content/chapters/part7/chapter-30.md new file mode 100644 index 0000000..b619e6e --- /dev/null +++ b/content/chapters/part7/chapter-30.md @@ -0,0 +1,14 @@ +--- +title: "Virtualisation and Containerization" +description: "Driver development for virtualized and containerized environments" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 30 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-31.md b/content/chapters/part7/chapter-31.md new file mode 100644 index 0000000..0cd60e2 --- /dev/null +++ b/content/chapters/part7/chapter-31.md @@ -0,0 +1,15 @@ +--- +title: "Security Best Practices" +description: "Implementing security measures in FreeBSD device drivers" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 31 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part7/chapter-32.md b/content/chapters/part7/chapter-32.md new file mode 100644 index 0000000..84ef43a --- /dev/null +++ b/content/chapters/part7/chapter-32.md @@ -0,0 +1,14 @@ +--- +title: "Device Tree and Embedded Development" +description: "Driver development for embedded systems using device tree" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 32 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-33.md b/content/chapters/part7/chapter-33.md new file mode 100644 index 0000000..a8f282c --- /dev/null +++ b/content/chapters/part7/chapter-33.md @@ -0,0 +1,14 @@ +--- +title: "Performance Tuning and Profiling" +description: "Optimizing driver performance through profiling and tuning" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 33 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-34.md b/content/chapters/part7/chapter-34.md new file mode 100644 index 0000000..32d0cab --- /dev/null +++ b/content/chapters/part7/chapter-34.md @@ -0,0 +1,14 @@ +--- +title: "Advanced Debugging Techniques" +description: "Sophisticated debugging methods for complex driver issues" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 34 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-35.md b/content/chapters/part7/chapter-35.md new file mode 100644 index 0000000..1e1daf4 --- /dev/null +++ b/content/chapters/part7/chapter-35.md @@ -0,0 +1,15 @@ +--- +title: "Asynchronous I/O and Event Handling" +description: "Implementing asynchronous operations and event-driven architectures" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 35 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/content/chapters/part7/chapter-36.md b/content/chapters/part7/chapter-36.md new file mode 100644 index 0000000..f617636 --- /dev/null +++ b/content/chapters/part7/chapter-36.md @@ -0,0 +1,14 @@ +--- +title: "Creating Drivers Without Documentation (Reverse Engineering)" +description: "Techniques for developing drivers when documentation is unavailable" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 36 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-37.md b/content/chapters/part7/chapter-37.md new file mode 100644 index 0000000..5a77410 --- /dev/null +++ b/content/chapters/part7/chapter-37.md @@ -0,0 +1,14 @@ +--- +title: "Submitting Your Driver to the FreeBSD Project" +description: "Process and guidelines for contributing drivers to FreeBSD" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 37 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/content/chapters/part7/chapter-38.md b/content/chapters/part7/chapter-38.md new file mode 100644 index 0000000..6cdb8d6 --- /dev/null +++ b/content/chapters/part7/chapter-38.md @@ -0,0 +1,14 @@ +--- +title: "Final Thoughts and Next Steps" +description: "Concluding thoughts and guidance for continued learning" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 38 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..da03470 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,167 @@ +# Examples Directory + +This directory contains the complete source code for all examples provided throughout the **FreeBSD Device Drivers Book**. These examples are designed to help readers understand and practice the concepts discussed in each chapter. + +## Directory Structure + +The examples are organized to mirror the book's structure: + +``` +examples/ +├── README.md # This file +├── chapters/ # Examples from main chapters +│ ├── part1/ # Part 1: Fundamentals +│ ├── part2/ # Part 2: Basic Drivers +│ ├── part3/ # Part 3: Advanced Topics +│ ├── part4/ # Part 4: Specialized Drivers +│ ├── part5/ # Part 5: Performance & Optimization +│ ├── part6/ # Part 6: Debugging & Testing +│ └── part7/ # Part 7: Real-world Applications +└── appendices/ # Examples from appendices + ├── appendix-a/ # Appendix A examples + ├── appendix-b/ # Appendix B examples + ├── appendix-c/ # Appendix C examples + ├── appendix-d/ # Appendix D examples + └── appendix-e/ # Appendix E examples +``` + +## Example Organization + +Each example includes: + +- **Source code files** (`.c`, `.h`, `.mk`, etc.) +- **Makefile** for building the example +- **README** with specific instructions for that example +- **Documentation** explaining the example's purpose and usage + +## Building Examples + +### Prerequisites + +Before building any examples, ensure you have: + +1. **FreeBSD development environment** set up +2. **Kernel source code** available +3. **Required tools** installed: + - `gcc` or `clang` + - `make` + - `kldload`/`kldunload` (for kernel modules) + +### Building a Specific Example + +```bash +# Navigate to the example directory +cd examples/chapters/part1/example-01 + +# Build the example +make + +# Load the kernel module (if applicable) +sudo kldload ./example_module.ko + +# Unload the kernel module (if applicable) +sudo kldunload example_module +``` + +### Building All Examples + +```bash +# From the examples directory +make all +``` + +## Example Types + +The examples cover various aspects of FreeBSD device driver development: + +### Part 1: Foundations: FreeBSD, C, and the Kernel +- **Introduction** - Getting started with FreeBSD device driver development +- **Setting Up Your Lab** - Development environment setup and configuration +- **A Gentle Introduction to UNIX** - UNIX fundamentals for driver development +- **A First Look at the C Programming Language** - C programming basics +- **Understanding C for Kernel Programming** - Advanced C concepts for kernel development +- **The Anatomy of a FreeBSD Driver** - Basic driver structure and components + +### Part 2: Basic Driver Development +- **Writing Your First Driver** - Creating a simple kernel module +- **Working with Device Files** - Device file creation and management +- **Reading and Writing to Devices** - Implementing read/write operations +- **Handling Input and Output Efficiently** - Optimizing I/O operations + +### Part 3: Concurrency and Synchronization +- **Concurrency in Drivers** - Managing concurrent operations +- **Synchronization Mechanisms** - Implementing proper synchronization +- **Timers and Delayed Work** - Time-based operations and delayed execution +- **Taskqueues and Deferred Work** - Using taskqueues for deferred processing +- **More Synchronization — Conditions, Semaphores, and Coordination** - Advanced synchronization techniques + +### Part 4: Hardware and Platform-Level Integration +- **Accessing Hardware** - Direct hardware access techniques +- **Simulating Hardware** - Creating virtual hardware for testing +- **Writing a PCI Driver** - Developing drivers for PCI and PCIe devices +- **Handling Interrupts** - Basic interrupt handling implementation +- **Advanced Interrupt Handling** - Sophisticated interrupt techniques +- **DMA and High-Speed Data Transfer** - Direct Memory Access implementation +- **Power Management** - Power management features in drivers + +### Part 5: Debugging, Tools, and Real-World Practices +- **Debugging and Tracing** - Tools and techniques for debugging drivers +- **Integrating with the Kernel** - Best practices for kernel integration +- **Advanced Topics and Practical Tips** - Advanced techniques and practical advice + +### Part 6: Writing Transport-Specific Drivers +- **USB and Serial Drivers** - Developing drivers for USB and serial devices +- **Working with Storage Devices and the VFS Layer** - Storage device drivers and VFS integration +- **Writing a Network Driver** - Network interface driver development + +### Part 7: Mastery Topics: Special Scenarios and Edge Cases +- **Portability and Driver Abstraction** - Creating portable drivers across architectures +- **Virtualisation and Containerization** - Driver development for virtualized environments +- **Security Best Practices** - Implementing security measures in drivers +- **Device Tree and Embedded Development** - Driver development for embedded systems +- **Performance Tuning and Profiling** - Optimizing driver performance +- **Advanced Debugging Techniques** - Sophisticated debugging methods +- **Asynchronous I/O and Event Handling** - Asynchronous operations and event-driven architectures +- **Creating Drivers Without Documentation (Reverse Engineering)** - Developing drivers without documentation +- **Submitting Your Driver to the FreeBSD Project** - Contributing drivers to FreeBSD +- **Final Thoughts and Next Steps** - Concluding guidance and continued learning + +## Contributing + +If you find issues with any examples or want to contribute improvements: + +1. **Test the example** on your FreeBSD system +2. **Document any issues** you encounter +3. **Submit improvements** via pull request +4. **Follow the coding standards** used in the book + +## Version Compatibility + +These examples are designed for: +- **FreeBSD 14.x** and later +- **x86_64** and **ARM64** architectures +- **GCC** and **Clang** compilers + +## Troubleshooting + +### Common Issues + +1. **Build errors**: Ensure you have the correct kernel headers installed +2. **Module loading failures**: Check kernel messages with `dmesg` +3. **Permission errors**: Use `sudo` for kernel module operations +4. **Architecture mismatches**: Verify you're building for the correct architecture + +### Getting Help + +- Check the specific example's README for detailed instructions +- Review the book chapter for theoretical background +- Consult FreeBSD documentation and man pages +- Check kernel messages: `dmesg | tail` + +## License + +These examples are provided under the same license as the FreeBSD Device Driver Book. See the main project LICENSE file for details. + +--- + +**Note**: These examples are for educational purposes. Always test thoroughly before using in production environments. diff --git a/scripts/setup_translation.sh b/scripts/setup_translation.sh new file mode 100755 index 0000000..9a13332 --- /dev/null +++ b/scripts/setup_translation.sh @@ -0,0 +1,240 @@ +#!/bin/bash + +# FDD Book Translation Setup Script +# Creates a new language directory and populates it with content files for translation + +set -e # Exit on any error + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Configuration +PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +CONTENT_DIR="$PROJECT_ROOT/content" +TRANSLATIONS_DIR="$PROJECT_ROOT/translations" + +# Function to print colored output +print_status() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}[WARNING]${NC} $1" +} + +print_error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +print_header() { + echo -e "${BLUE}[SETUP]${NC} $1" +} + +# Function to validate language code +validate_language_code() { + local lang_code="$1" + + # Check if language code is provided + if [ -z "$lang_code" ]; then + print_error "Language code is required." + return 1 + fi + + # Check if language code follows ISO 639-1 format (2 letters) or ISO 639-1 with region (e.g., pt_BR) + if [[ ! "$lang_code" =~ ^[a-z]{2}(_[A-Z]{2})?$ ]]; then + print_error "Invalid language code format. Use ISO 639-1 format (e.g., 'en', 'pt', 'es') or with region (e.g., 'pt_BR', 'en_US')." + return 1 + fi + + return 0 +} + +# Function to check if content directory exists +check_content_directory() { + if [ ! -d "$CONTENT_DIR" ]; then + print_error "Content directory does not exist: $CONTENT_DIR" + exit 1 + fi +} + +# Function to create language directory +create_language_directory() { + local lang_code="$1" + local lang_dir="$TRANSLATIONS_DIR/$lang_code" + + if [ ! -d "$lang_dir" ]; then + print_status "Creating language directory: $lang_dir" + mkdir -p "$lang_dir" + else + print_warning "Language directory already exists: $lang_dir" + fi +} + +# Global variables for tracking copy results +COPY_COUNT=0 +SKIP_COUNT=0 + +# Function to copy directory structure and files +copy_content_structure() { + local source_dir="$1" + local target_dir="$2" + + # Reset counters + COPY_COUNT=0 + SKIP_COUNT=0 + + # Create target directory if it doesn't exist + mkdir -p "$target_dir" + + # Find all .md files in source directory and copy them + while IFS= read -r -d '' file; do + # Get relative path from source directory + local relative_path="${file#$source_dir/}" + local target_file="$target_dir/$relative_path" + local target_file_dir="$(dirname "$target_file")" + + # Create target directory if it doesn't exist + mkdir -p "$target_file_dir" + + # Check if target file already exists + if [ -f "$target_file" ]; then + print_warning "Skipping existing file: $relative_path" + ((SKIP_COUNT++)) + else + print_status "Copying: $relative_path" + cp "$file" "$target_file" + ((COPY_COUNT++)) + fi + done < <(find "$source_dir" -name "*.md" -type f -print0) +} + +# Function to show usage +show_usage() { + echo "Usage: $0 [OPTIONS]" + echo "" + echo "Arguments:" + echo " language_code ISO 639-1 language code (e.g., 'en', 'pt', 'es')" + echo " or with region (e.g., 'pt_BR', 'en_US')" + echo "" + echo "Options:" + echo " -h, --help Show this help message" + echo " -f, --force Force copy even if files already exist" + echo " -v, --verbose Show detailed output" + echo "" + echo "Examples:" + echo " $0 fr # Set up French translation" + echo " $0 de_DE # Set up German (Germany) translation" + echo " $0 es_MX # Set up Spanish (Mexico) translation" + echo "" + echo "This script creates a new language directory under translations/" + echo "and populates it with copies of content files for translation work." +} + +# Function to get language name from code +get_language_name() { + local lang_code="$1" + case "$lang_code" in + "en") echo "English" ;; + "pt") echo "Portuguese" ;; + "pt_BR") echo "Portuguese (Brazil)" ;; + "es") echo "Spanish" ;; + "es_MX") echo "Spanish (Mexico)" ;; + "es_ES") echo "Spanish (Spain)" ;; + "fr") echo "French" ;; + "fr_FR") echo "French (France)" ;; + "de") echo "German" ;; + "de_DE") echo "German (Germany)" ;; + "it") echo "Italian" ;; + "it_IT") echo "Italian (Italy)" ;; + "ru") echo "Russian" ;; + "ru_RU") echo "Russian (Russia)" ;; + "zh") echo "Chinese" ;; + "zh_CN") echo "Chinese (Simplified)" ;; + "zh_TW") echo "Chinese (Traditional)" ;; + "ja") echo "Japanese" ;; + "ja_JP") echo "Japanese (Japan)" ;; + "ko") echo "Korean" ;; + "ko_KR") echo "Korean (South Korea)" ;; + *) echo "$lang_code" ;; + esac +} + +# Main script logic +main() { + local language_code="" + local force_copy=false + local verbose=false + + # Parse command line arguments + while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + show_usage + exit 0 + ;; + -f|--force) + force_copy=true + shift + ;; + -v|--verbose) + verbose=true + shift + ;; + -*) + print_error "Unknown option: $1" + show_usage + exit 1 + ;; + *) + if [ -z "$language_code" ]; then + language_code="$1" + else + print_error "Multiple language codes provided. Only one is allowed." + exit 1 + fi + shift + ;; + esac + done + + # Validate language code + if ! validate_language_code "$language_code"; then + show_usage + exit 1 + fi + + # Get language name + local language_name=$(get_language_name "$language_code") + + print_header "Setting up translation for $language_name ($language_code)" + + # Check prerequisites + check_content_directory + + # Create language directory + create_language_directory "$language_code" + local lang_dir="$TRANSLATIONS_DIR/$language_code" + + # Copy content structure + print_status "Copying content files..." + copy_content_structure "$CONTENT_DIR" "$lang_dir" + + print_status "Translation setup completed!" + print_status "Language directory: $lang_dir" + print_status "Files copied: $COPY_COUNT" + print_status "Files skipped (already exist): $SKIP_COUNT" + + if [ "$SKIP_COUNT" -gt 0 ]; then + print_warning "Some files already existed and were skipped." + print_warning "Use --force option to overwrite existing files." + fi + + print_status "Translators can now start working on files in: $lang_dir" +} + +# Run main function with all arguments +main "$@" \ No newline at end of file diff --git a/scripts/sync_content.sh b/scripts/sync_content.sh new file mode 100755 index 0000000..1443cfc --- /dev/null +++ b/scripts/sync_content.sh @@ -0,0 +1,145 @@ +#!/bin/bash + +# FDD Book Content Sync Script +# Syncs content from the current project to the website directory + +set -e # Exit on any error + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Configuration +SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../content" && pwd)" +TARGET_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../FDD-Book-website/content" && pwd)" + +# Function to print colored output +print_status() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}[WARNING]${NC} $1" +} + +print_error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +# Function to check if rsync is available +check_rsync() { + if ! command -v rsync &> /dev/null; then + print_error "rsync is not installed. Please install rsync to use this script." + exit 1 + fi +} + +# Function to check if source directory exists +check_source() { + if [ ! -d "$SOURCE_DIR" ]; then + print_error "Source directory does not exist: $SOURCE_DIR" + exit 1 + fi +} + +# Function to create target directory if it doesn't exist +ensure_target() { + if [ ! -d "$TARGET_DIR" ]; then + print_warning "Target directory does not exist. Creating: $TARGET_DIR" + mkdir -p "$TARGET_DIR" + fi +} + +# Function to perform the sync +sync_content() { + print_status "Starting content synchronization..." + print_status "Source: $SOURCE_DIR" + print_status "Target: $TARGET_DIR" + + # Use rsync with the following options: + # -a: archive mode (preserves permissions, timestamps, etc.) + # -v: verbose output + # -h: human-readable sizes + # --delete: remove files in target that don't exist in source + # --exclude: exclude common files that shouldn't be synced + rsync -avh --delete \ + --exclude='*.tmp' \ + --exclude='*.swp' \ + --exclude='*.bak' \ + --exclude='.DS_Store' \ + --exclude='Thumbs.db' \ + "$SOURCE_DIR/" "$TARGET_DIR/" + + if [ $? -eq 0 ]; then + print_status "Content synchronization completed successfully!" + else + print_error "Content synchronization failed!" + exit 1 + fi +} + +# Function to show usage +show_usage() { + echo "Usage: $0 [OPTIONS]" + echo "" + echo "Options:" + echo " -h, --help Show this help message" + echo " -d, --dry-run Show what would be synced without actually doing it" + echo "" + echo "This script syncs content from the current project's content directory" + echo "to the FDD-Book-website content directory." +} + +# Function to perform dry run +dry_run() { + print_status "Performing dry run (no files will be modified)..." + print_status "Source: $SOURCE_DIR" + print_status "Target: $TARGET_DIR" + + rsync -avh --delete --dry-run \ + --exclude='*.tmp' \ + --exclude='*.swp' \ + --exclude='*.bak' \ + --exclude='.DS_Store' \ + --exclude='Thumbs.db' \ + "$SOURCE_DIR/" "$TARGET_DIR/" +} + +# Main script logic +main() { + # Parse command line arguments + while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + show_usage + exit 0 + ;; + -d|--dry-run) + DRY_RUN=true + shift + ;; + *) + print_error "Unknown option: $1" + show_usage + exit 1 + ;; + esac + done + + # Check prerequisites + check_rsync + check_source + ensure_target + + # Perform sync or dry run + if [ "$DRY_RUN" = true ]; then + dry_run + else + sync_content + fi +} + +# Run main function with all arguments +main "$@" \ No newline at end of file diff --git a/translations/pt_BR/appendices/appendix-a.md b/translations/pt_BR/appendices/appendix-a.md new file mode 100644 index 0000000..1b34671 --- /dev/null +++ b/translations/pt_BR/appendices/appendix-a.md @@ -0,0 +1,12 @@ +--- +title: "FreeBSD Kernel API Reference" +description: "Comprehensive reference for FreeBSD kernel APIs, system calls, and data structures used in device driver development." +status: "planned" +estimatedReadTime: 25 +date: "2024-01-15" +author: "Edson Brandi" +reviewer: "FreeBSD Community" +--- + +planned + diff --git a/translations/pt_BR/appendices/appendix-b.md b/translations/pt_BR/appendices/appendix-b.md new file mode 100644 index 0000000..929b668 --- /dev/null +++ b/translations/pt_BR/appendices/appendix-b.md @@ -0,0 +1,13 @@ +--- +title: "Algorithms and Logic for Systems Programming" +description: "Common algorithms and logical patterns used in systems programming and device drivers" +appendix: "B" +date: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned diff --git a/translations/pt_BR/appendices/appendix-c.md b/translations/pt_BR/appendices/appendix-c.md new file mode 100644 index 0000000..b4d273c --- /dev/null +++ b/translations/pt_BR/appendices/appendix-c.md @@ -0,0 +1,13 @@ +--- +title: "Hardware Concepts for Driver Developers" +description: "Essential hardware concepts and terminology for device driver development" +appendix: "C" +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 30 +--- + +planned diff --git a/translations/pt_BR/appendices/appendix-d.md b/translations/pt_BR/appendices/appendix-d.md new file mode 100644 index 0000000..1c383ec --- /dev/null +++ b/translations/pt_BR/appendices/appendix-d.md @@ -0,0 +1,14 @@ +--- +title: "Operating System Concepts" +description: "Core operating system concepts relevant to device driver development" +appendix: "D" +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned + diff --git a/translations/pt_BR/appendices/appendix-e.md b/translations/pt_BR/appendices/appendix-e.md new file mode 100644 index 0000000..e64fd72 --- /dev/null +++ b/translations/pt_BR/appendices/appendix-e.md @@ -0,0 +1,13 @@ +--- +title: "FreeBSD Internals and Kernel Reference" +description: "Comprehensive reference for FreeBSD kernel internals and APIs" +appendix: "E" +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 35 +--- + +planned diff --git a/translations/pt_BR/chapters/part1/chapter-01.md b/translations/pt_BR/chapters/part1/chapter-01.md new file mode 100644 index 0000000..9b70a3c --- /dev/null +++ b/translations/pt_BR/chapters/part1/chapter-01.md @@ -0,0 +1,16 @@ +--- +title: "Introduction" +description: "Introduction to FreeBSD device driver development and the journey ahead" +partNumber: 1 +partName: "Foundations: FreeBSD, C, and the Kernel" +chapter: 1 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +date: "2025-08-01" +estimatedReadTime: 15 +--- + +planned diff --git a/translations/pt_BR/chapters/part1/chapter-02.md b/translations/pt_BR/chapters/part1/chapter-02.md new file mode 100644 index 0000000..39ae00b --- /dev/null +++ b/translations/pt_BR/chapters/part1/chapter-02.md @@ -0,0 +1,13 @@ +--- +title: "Setting Up Your Lab" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 2 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 20 +--- + +planned diff --git a/translations/pt_BR/chapters/part1/chapter-03.md b/translations/pt_BR/chapters/part1/chapter-03.md new file mode 100644 index 0000000..baa3f9d --- /dev/null +++ b/translations/pt_BR/chapters/part1/chapter-03.md @@ -0,0 +1,14 @@ +--- +title: "A Gentle Introduction to UNIX" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 3 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 18 +--- + +planned + diff --git a/translations/pt_BR/chapters/part1/chapter-04.md b/translations/pt_BR/chapters/part1/chapter-04.md new file mode 100644 index 0000000..fa93e7e --- /dev/null +++ b/translations/pt_BR/chapters/part1/chapter-04.md @@ -0,0 +1,13 @@ +--- +title: "A First Look at the C Programming Language" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 4 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned diff --git a/translations/pt_BR/chapters/part1/chapter-05.md b/translations/pt_BR/chapters/part1/chapter-05.md new file mode 100644 index 0000000..cfc1758 --- /dev/null +++ b/translations/pt_BR/chapters/part1/chapter-05.md @@ -0,0 +1,13 @@ +--- +title: "Understanding C for Kernel Programming" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 5 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 30 +--- + +planned diff --git a/translations/pt_BR/chapters/part1/chapter-06.md b/translations/pt_BR/chapters/part1/chapter-06.md new file mode 100644 index 0000000..a477069 --- /dev/null +++ b/translations/pt_BR/chapters/part1/chapter-06.md @@ -0,0 +1,14 @@ +--- +title: "The Anatomy of a FreeBSD Driver" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 1 +chapter: 6 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 22 +--- + +planned + diff --git a/translations/pt_BR/chapters/part2/chapter-07.md b/translations/pt_BR/chapters/part2/chapter-07.md new file mode 100644 index 0000000..365a5ee --- /dev/null +++ b/translations/pt_BR/chapters/part2/chapter-07.md @@ -0,0 +1,14 @@ +--- +title: "Writing Your First Driver" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 7 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 28 +--- + +planned + diff --git a/translations/pt_BR/chapters/part2/chapter-08.md b/translations/pt_BR/chapters/part2/chapter-08.md new file mode 100644 index 0000000..ebe4ca3 --- /dev/null +++ b/translations/pt_BR/chapters/part2/chapter-08.md @@ -0,0 +1,13 @@ +--- +title: "Working with Device Files" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 8 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 20 +--- + +planned diff --git a/translations/pt_BR/chapters/part2/chapter-09.md b/translations/pt_BR/chapters/part2/chapter-09.md new file mode 100644 index 0000000..458b70b --- /dev/null +++ b/translations/pt_BR/chapters/part2/chapter-09.md @@ -0,0 +1,13 @@ +--- +title: "Reading and Writing to Devices" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 9 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 25 +--- + +planned diff --git a/translations/pt_BR/chapters/part2/chapter-10.md b/translations/pt_BR/chapters/part2/chapter-10.md new file mode 100644 index 0000000..1c7014a --- /dev/null +++ b/translations/pt_BR/chapters/part2/chapter-10.md @@ -0,0 +1,13 @@ +--- +title: "Handling Input and Output Efficiently" +author: "Edson Brandi" +date: "2025-08-01" +status: "planned" +part: 2 +chapter: 10 +reviewer: "TBD" +translator: "TBD" +estimatedReadTime: 23 +--- + +planned diff --git a/translations/pt_BR/chapters/part3/chapter-11.md b/translations/pt_BR/chapters/part3/chapter-11.md new file mode 100644 index 0000000..8460642 --- /dev/null +++ b/translations/pt_BR/chapters/part3/chapter-11.md @@ -0,0 +1,14 @@ +--- +title: "Concurrency in Drivers" +description: "Understanding and managing concurrent operations in device drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 11 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part3/chapter-12.md b/translations/pt_BR/chapters/part3/chapter-12.md new file mode 100644 index 0000000..4c3027e --- /dev/null +++ b/translations/pt_BR/chapters/part3/chapter-12.md @@ -0,0 +1,15 @@ +--- +title: "Synchronization Mechanisms" +description: "Implementing proper synchronization in FreeBSD device drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 12 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part3/chapter-13.md b/translations/pt_BR/chapters/part3/chapter-13.md new file mode 100644 index 0000000..1088a3c --- /dev/null +++ b/translations/pt_BR/chapters/part3/chapter-13.md @@ -0,0 +1,14 @@ +--- +title: "Timers and Delayed Work" +description: "Implementing time-based operations and delayed execution in drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 13 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part3/chapter-14.md b/translations/pt_BR/chapters/part3/chapter-14.md new file mode 100644 index 0000000..1f9ae9f --- /dev/null +++ b/translations/pt_BR/chapters/part3/chapter-14.md @@ -0,0 +1,14 @@ +--- +title: "Taskqueues and Deferred Work" +description: "Using taskqueues for deferred processing in device drivers" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 14 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part3/chapter-15.md b/translations/pt_BR/chapters/part3/chapter-15.md new file mode 100644 index 0000000..1e430d1 --- /dev/null +++ b/translations/pt_BR/chapters/part3/chapter-15.md @@ -0,0 +1,14 @@ +--- +title: "More Synchronization — Conditions, Semaphores, and Coordination" +description: "Advanced synchronization techniques for complex driver scenarios" +partNumber: 3 +partName: "Concurrency and Synchronization" +chapter: 15 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part4/chapter-16.md b/translations/pt_BR/chapters/part4/chapter-16.md new file mode 100644 index 0000000..c77c8d1 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-16.md @@ -0,0 +1,14 @@ +--- +title: "Accessing Hardware" +description: "Direct hardware access techniques for device drivers" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 16 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part4/chapter-17.md b/translations/pt_BR/chapters/part4/chapter-17.md new file mode 100644 index 0000000..46924d9 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-17.md @@ -0,0 +1,14 @@ +--- +title: "Simulating Hardware" +description: "Creating virtual hardware for testing and development purposes" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 17 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part4/chapter-18.md b/translations/pt_BR/chapters/part4/chapter-18.md new file mode 100644 index 0000000..a4f11b4 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-18.md @@ -0,0 +1,14 @@ +--- +title: "Writing a PCI Driver" +description: "Developing drivers for PCI and PCIe devices" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 18 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part4/chapter-19.md b/translations/pt_BR/chapters/part4/chapter-19.md new file mode 100644 index 0000000..ff58311 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-19.md @@ -0,0 +1,14 @@ +--- +title: "Handling Interrupts" +description: "Implementing interrupt handling in FreeBSD device drivers" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 19 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part4/chapter-20.md b/translations/pt_BR/chapters/part4/chapter-20.md new file mode 100644 index 0000000..ff26bc8 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-20.md @@ -0,0 +1,15 @@ +--- +title: "Advanced Interrupt Handling" +description: "Sophisticated interrupt handling techniques and optimizations" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 20 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part4/chapter-21.md b/translations/pt_BR/chapters/part4/chapter-21.md new file mode 100644 index 0000000..e698011 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-21.md @@ -0,0 +1,15 @@ +--- +title: "DMA and High-Speed Data Transfer" +description: "Implementing Direct Memory Access for efficient data transfer" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 21 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part4/chapter-22.md b/translations/pt_BR/chapters/part4/chapter-22.md new file mode 100644 index 0000000..be60bd4 --- /dev/null +++ b/translations/pt_BR/chapters/part4/chapter-22.md @@ -0,0 +1,14 @@ +--- +title: "Power Management" +description: "Implementing power management features in device drivers" +partNumber: 4 +partName: "Hardware and Platform-Level Integration" +chapter: 22 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part5/chapter-23.md b/translations/pt_BR/chapters/part5/chapter-23.md new file mode 100644 index 0000000..2d5e01b --- /dev/null +++ b/translations/pt_BR/chapters/part5/chapter-23.md @@ -0,0 +1,15 @@ +--- +title: "Debugging and Tracing" +description: "Tools and techniques for debugging FreeBSD device drivers" +partNumber: 5 +partName: "Debugging, Tools, and Real-World Practices" +chapter: 23 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part5/chapter-24.md b/translations/pt_BR/chapters/part5/chapter-24.md new file mode 100644 index 0000000..fe5f4f5 --- /dev/null +++ b/translations/pt_BR/chapters/part5/chapter-24.md @@ -0,0 +1,15 @@ +--- +title: "Integrating with the Kernel" +description: "Best practices for kernel integration and driver architecture" +partNumber: 5 +partName: "Debugging, Tools, and Real-World Practices" +chapter: 24 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part5/chapter-25.md b/translations/pt_BR/chapters/part5/chapter-25.md new file mode 100644 index 0000000..3bcb1e2 --- /dev/null +++ b/translations/pt_BR/chapters/part5/chapter-25.md @@ -0,0 +1,14 @@ +--- +title: "Advanced Topics and Practical Tips" +description: "Advanced techniques and practical advice for driver development" +partNumber: 5 +partName: "Debugging, Tools, and Real-World Practices" +chapter: 25 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part6/chapter-26.md b/translations/pt_BR/chapters/part6/chapter-26.md new file mode 100644 index 0000000..ba0c8d0 --- /dev/null +++ b/translations/pt_BR/chapters/part6/chapter-26.md @@ -0,0 +1,14 @@ +--- +title: "USB and Serial Drivers" +description: "Developing drivers for USB and serial communication devices" +partNumber: 6 +partName: "Writing Transport-Specific Drivers" +chapter: 26 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part6/chapter-27.md b/translations/pt_BR/chapters/part6/chapter-27.md new file mode 100644 index 0000000..c318347 --- /dev/null +++ b/translations/pt_BR/chapters/part6/chapter-27.md @@ -0,0 +1,14 @@ +--- +title: "Working with Storage Devices and the VFS Layer" +description: "Developing storage device drivers and VFS integration" +partNumber: 6 +partName: "Writing Transport-Specific Drivers" +chapter: 27 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part6/chapter-28.md b/translations/pt_BR/chapters/part6/chapter-28.md new file mode 100644 index 0000000..d4c796f --- /dev/null +++ b/translations/pt_BR/chapters/part6/chapter-28.md @@ -0,0 +1,14 @@ +--- +title: "Writing a Network Driver" +description: "Developing network interface drivers for FreeBSD" +partNumber: 6 +partName: "Writing Transport-Specific Drivers" +chapter: 28 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-29.md b/translations/pt_BR/chapters/part7/chapter-29.md new file mode 100644 index 0000000..89d2e44 --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-29.md @@ -0,0 +1,14 @@ +--- +title: "Portability and Driver Abstraction" +description: "Creating portable drivers across different FreeBSD architectures" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 29 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-30.md b/translations/pt_BR/chapters/part7/chapter-30.md new file mode 100644 index 0000000..b619e6e --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-30.md @@ -0,0 +1,14 @@ +--- +title: "Virtualisation and Containerization" +description: "Driver development for virtualized and containerized environments" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 30 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-31.md b/translations/pt_BR/chapters/part7/chapter-31.md new file mode 100644 index 0000000..0cd60e2 --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-31.md @@ -0,0 +1,15 @@ +--- +title: "Security Best Practices" +description: "Implementing security measures in FreeBSD device drivers" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 31 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part7/chapter-32.md b/translations/pt_BR/chapters/part7/chapter-32.md new file mode 100644 index 0000000..84ef43a --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-32.md @@ -0,0 +1,14 @@ +--- +title: "Device Tree and Embedded Development" +description: "Driver development for embedded systems using device tree" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 32 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-33.md b/translations/pt_BR/chapters/part7/chapter-33.md new file mode 100644 index 0000000..a8f282c --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-33.md @@ -0,0 +1,14 @@ +--- +title: "Performance Tuning and Profiling" +description: "Optimizing driver performance through profiling and tuning" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 33 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-34.md b/translations/pt_BR/chapters/part7/chapter-34.md new file mode 100644 index 0000000..32d0cab --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-34.md @@ -0,0 +1,14 @@ +--- +title: "Advanced Debugging Techniques" +description: "Sophisticated debugging methods for complex driver issues" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 34 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-35.md b/translations/pt_BR/chapters/part7/chapter-35.md new file mode 100644 index 0000000..1e1daf4 --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-35.md @@ -0,0 +1,15 @@ +--- +title: "Asynchronous I/O and Event Handling" +description: "Implementing asynchronous operations and event-driven architectures" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 35 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned + diff --git a/translations/pt_BR/chapters/part7/chapter-36.md b/translations/pt_BR/chapters/part7/chapter-36.md new file mode 100644 index 0000000..f617636 --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-36.md @@ -0,0 +1,14 @@ +--- +title: "Creating Drivers Without Documentation (Reverse Engineering)" +description: "Techniques for developing drivers when documentation is unavailable" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 36 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-37.md b/translations/pt_BR/chapters/part7/chapter-37.md new file mode 100644 index 0000000..5a77410 --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-37.md @@ -0,0 +1,14 @@ +--- +title: "Submitting Your Driver to the FreeBSD Project" +description: "Process and guidelines for contributing drivers to FreeBSD" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 37 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned diff --git a/translations/pt_BR/chapters/part7/chapter-38.md b/translations/pt_BR/chapters/part7/chapter-38.md new file mode 100644 index 0000000..6cdb8d6 --- /dev/null +++ b/translations/pt_BR/chapters/part7/chapter-38.md @@ -0,0 +1,14 @@ +--- +title: "Final Thoughts and Next Steps" +description: "Concluding thoughts and guidance for continued learning" +partNumber: 7 +partName: "Mastery Topics: Special Scenarios and Edge Cases" +chapter: 38 +lastUpdated: "2025-08-01" +status: "planned" +author: "Edson Brandi" +reviewer: "TBD" +translator: "TBD" +--- + +planned