# BBeOS Project Structure This document provides a comprehensive overview of the BBeOS project structure and organization. ## ๐Ÿ“ Directory Layout ``` BBeOS/ โ”œโ”€โ”€ ๐Ÿ“š docs/ # Documentation โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ phases/ # Phase-by-phase development docs โ”‚ โ”‚ โ”œโ”€โ”€ PHASE_1_*.md # Research & Feasibility โ”‚ โ”‚ โ”œโ”€โ”€ PHASE_2_*.md # Bootstrapping โ”‚ โ”‚ โ”œโ”€โ”€ PHASE_3_*.md # Hardware Support โ”‚ โ”‚ โ”œโ”€โ”€ PHASE_4_*.md # User Interface โ”‚ โ”‚ โ”œโ”€โ”€ PHASE_5_*.md # Telephony Stack โ”‚ โ”‚ โ”œโ”€โ”€ PHASE_6_*.md # Packaging & Updates โ”‚ โ”‚ โ””โ”€โ”€ PHASE_7_*.md # Community & SDK โ”‚ โ”œโ”€โ”€ ๐Ÿ“– guides/ # How-to guides and tutorials โ”‚ โ”‚ โ”œโ”€โ”€ EMULATION_GUIDE.md # QEMU emulation guide โ”‚ โ”‚ โ””โ”€โ”€ hardware-testing-guide.md # Hardware testing guide โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง api/ # API documentation and design docs โ”‚ โ”‚ โ”œโ”€โ”€ UI_UX_DESIGN.md # UI/UX design specifications โ”‚ โ”‚ โ””โ”€โ”€ SECURITY_ANALYSIS.md # Security analysis and recommendations โ”‚ โ””โ”€โ”€ DEVELOPMENT_GUIDE.md # Main development guide โ”‚ โ”œโ”€โ”€ ๐Ÿ’ป src/ # Source code โ”‚ โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ kernel/ # Kernel configuration and patches โ”‚ โ”‚ โ””โ”€โ”€ msm8960-defconfig # MSM8960 kernel configuration โ”‚ โ”œโ”€โ”€ ๐Ÿ”Œ drivers/ # Hardware drivers โ”‚ โ”‚ โ”œโ”€โ”€ display/ # Display drivers โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ q20-panel.c # Q20 LCD panel driver โ”‚ โ”‚ โ”œโ”€โ”€ input/ # Input device drivers โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ q20-keyboard.c # Q20 keyboard driver โ”‚ โ”‚ โ””โ”€โ”€ Makefile # Driver build configuration โ”‚ โ”œโ”€โ”€ ๐Ÿ–ผ๏ธ ui/ # User interface components โ”‚ โ”‚ โ”œโ”€โ”€ compositor/ # Wayland compositor โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ q20-compositor.c # Q20-specific compositor โ”‚ โ”‚ โ”œโ”€โ”€ applications/ # UI applications โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ home-screen.c # Home screen application โ”‚ โ”‚ โ””โ”€โ”€ Makefile # UI build configuration โ”‚ โ”œโ”€โ”€ ๐Ÿ“ž telephony/ # Phone functionality โ”‚ โ”‚ โ”œโ”€โ”€ modem/ # Modem drivers โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ q20-modem.c # MDM9615 modem driver โ”‚ โ”‚ โ”œโ”€โ”€ voice/ # Voice call management โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ q20-voice.c # Voice call driver โ”‚ โ”‚ โ”œโ”€โ”€ sms/ # SMS management โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ q20-sms.c # SMS driver โ”‚ โ”‚ โ””โ”€โ”€ Makefile # Telephony build configuration โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฑ apps/ # Core applications โ”‚ โ”‚ โ”œโ”€โ”€ core/ # Core system apps โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ calculator.c # Calculator application โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ text-editor.c # Text editor application โ”‚ โ”‚ โ””โ”€โ”€ Makefile # Application build configuration โ”‚ โ”œโ”€โ”€ ๐Ÿ› ๏ธ sdk/ # Development tools and SDK โ”‚ โ”‚ โ””โ”€โ”€ tools/ # SDK tools โ”‚ โ”‚ โ””โ”€โ”€ bbeos-sdk.c # BBeOS SDK main tool โ”‚ โ””โ”€โ”€ ๐Ÿ“ฆ packaging/ # System packaging and deployment โ”‚ โ”œโ”€โ”€ system/ # System image creation โ”‚ โ”‚ โ””โ”€โ”€ image-builder.c # System image builder โ”‚ โ”œโ”€โ”€ security/ # Security components โ”‚ โ”‚ โ””โ”€โ”€ secure-boot.c # Secure boot implementation โ”‚ โ”œโ”€โ”€ updates/ # Update system โ”‚ โ”‚ โ””โ”€โ”€ ota-updater.c # OTA update system โ”‚ โ””โ”€โ”€ Makefile # Packaging build configuration โ”‚ โ”œโ”€โ”€ ๐Ÿ”จ build/ # Build artifacts โ”‚ โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ kernel/ # Kernel builds โ”‚ โ”‚ โ”œโ”€โ”€ zImage # Kernel image โ”‚ โ”‚ โ”œโ”€โ”€ *.dtb # Device tree blobs โ”‚ โ”‚ โ””โ”€โ”€ modules/ # Kernel modules โ”‚ โ”œโ”€โ”€ ๐Ÿ“ rootfs/ # Root filesystem โ”‚ โ”‚ โ”œโ”€โ”€ bin/ # Binary files โ”‚ โ”‚ โ”œโ”€โ”€ etc/ # Configuration files โ”‚ โ”‚ โ”œโ”€โ”€ lib/ # Library files โ”‚ โ”‚ โ””โ”€โ”€ init # Init script โ”‚ โ”œโ”€โ”€ ๐Ÿ–ผ๏ธ images/ # Boot images โ”‚ โ”‚ โ”œโ”€โ”€ bbeos-boot.img # Bootable system image โ”‚ โ”‚ โ”œโ”€โ”€ initramfs.img # Initial RAM filesystem โ”‚ โ”‚ โ””โ”€โ”€ recovery.img # Recovery image โ”‚ โ”œโ”€โ”€ ๐Ÿ–ผ๏ธ ui/ # UI build artifacts โ”‚ โ”‚ โ”œโ”€โ”€ compositor/ # Compiled compositor โ”‚ โ”‚ โ”œโ”€โ”€ applications/ # Compiled applications โ”‚ โ”‚ โ””โ”€โ”€ assets/ # UI assets โ”‚ โ””โ”€โ”€ ๐Ÿ“ฆ boot-unpacked/ # Unpacked boot components โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง scripts/ # Build automation and tools โ”‚ โ”œโ”€โ”€ build-kernel.sh # Full kernel build script โ”‚ โ”œโ”€โ”€ build-kernel-minimal.sh # Minimal kernel build script โ”‚ โ”œโ”€โ”€ build-rootfs.sh # Root filesystem build script โ”‚ โ”œโ”€โ”€ build-boot-image.sh # Boot image creation script โ”‚ โ”œโ”€โ”€ build-drivers.sh # Driver build script โ”‚ โ”œโ”€โ”€ build-ui.sh # UI build script โ”‚ โ”œโ”€โ”€ build-telephony.sh # Telephony build script โ”‚ โ”œโ”€โ”€ build-packaging.sh # Packaging build script โ”‚ โ”œโ”€โ”€ emulate-simple.sh # Simple QEMU emulation โ”‚ โ”œโ”€โ”€ emulate-bbeos.sh # Full BBeOS emulation โ”‚ โ”œโ”€โ”€ emulate-terminal.sh # Terminal-based simulation โ”‚ โ”œโ”€โ”€ hardware-test.sh # Hardware testing script โ”‚ โ”œโ”€โ”€ flash-boot.sh # Device flashing script โ”‚ โ”œโ”€โ”€ test-qemu.sh # QEMU testing script โ”‚ โ””โ”€โ”€ test-qemu-compatible.sh # Compatible QEMU testing โ”‚ โ”œโ”€โ”€ ๐Ÿงช tests/ # Test files and test automation โ”‚ โ”œโ”€โ”€ unit/ # Unit tests โ”‚ โ”œโ”€โ”€ integration/ # Integration tests โ”‚ โ””โ”€โ”€ hardware/ # Hardware tests โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฆ vendor/ # Third-party code and dependencies โ”‚ โ””โ”€โ”€ kernel-source/ # Linux kernel source โ”‚ โ”œโ”€โ”€ arch/arm/boot/dts/qcom/ # Qualcomm device trees โ”‚ โ””โ”€โ”€ ... # Other kernel files โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฅ downloads/ # External downloads and sources โ”‚ โ”œโ”€โ”€ busybox-1.36.1/ # BusyBox source โ”‚ โ”œโ”€โ”€ busybox-1.36.1.tar.bz2 # BusyBox archive โ”‚ โ””โ”€โ”€ ... # Other downloads โ”‚ โ”œโ”€โ”€ ๐ŸŒ community/ # Community website and resources โ”‚ โ””โ”€โ”€ website/ # Community website โ”‚ โ””โ”€โ”€ index.html # Main website page โ”‚ โ”œโ”€โ”€ ๐Ÿ”ฌ research/ # Hardware research and analysis โ”‚ โ”œโ”€โ”€ q20-hardware-research.md # Q20 hardware research โ”‚ โ”œโ”€โ”€ bootloader-analysis.md # Bootloader analysis โ”‚ โ”œโ”€โ”€ driver-compatibility.md # Driver compatibility research โ”‚ โ””โ”€โ”€ q20-specs.md # Q20 specifications โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ .gitea/ # Gitea configuration โ”‚ โ””โ”€โ”€ workflows/ # CI/CD workflows โ”‚ โ””โ”€โ”€ ci.yml # Continuous integration โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Configuration Files โ”‚ โ”œโ”€โ”€ README.md # Project overview โ”‚ โ”œโ”€โ”€ QUICK_START.md # Quick start guide โ”‚ โ”œโ”€โ”€ PROJECT_STRUCTURE.md # This file โ”‚ โ”œโ”€โ”€ .gitignore # Git ignore rules โ”‚ โ”œโ”€โ”€ config.yaml # Gitea runner configuration โ”‚ โ””โ”€โ”€ bbeos-runner.service # Systemd service file โ”‚ โ””โ”€โ”€ ๐Ÿ—๏ธ hardware/ # Hardware specifications โ””โ”€โ”€ q20-specs.md # BlackBerry Classic Q20 specs ``` ## ๐ŸŽฏ Organization Principles ### **1. Separation of Concerns** - **Source code** (`src/`) is separate from **build artifacts** (`build/`) - **Documentation** (`docs/`) is organized by type and purpose - **Scripts** (`scripts/`) handle automation and tooling - **Third-party code** (`vendor/`) is isolated from project code ### **2. Build System Organization** - **Build artifacts** are placed in `build/` subdirectories - **Downloads** are stored in `downloads/` directory - **Scripts** reference the new directory structure - **Clean separation** between source and build files ### **3. Documentation Structure** - **Phase documentation** in `docs/phases/` - **How-to guides** in `docs/guides/` - **API documentation** in `docs/api/` - **Main development guide** at `docs/DEVELOPMENT_GUIDE.md` ### **4. Source Code Organization** - **Kernel components** in `src/kernel/` - **Hardware drivers** in `src/drivers/` - **User interface** in `src/ui/` - **Telephony stack** in `src/telephony/` - **Applications** in `src/apps/` - **Development tools** in `src/sdk/` - **Packaging tools** in `src/packaging/` ## ๐Ÿ”„ Build Workflow ### **1. Kernel Build** ```bash ./scripts/build-kernel.sh # Full kernel build ./scripts/build-kernel-minimal.sh # Minimal kernel build ``` - **Source**: `vendor/kernel-source/` - **Output**: `build/kernel/` ### **2. Root Filesystem** ```bash ./scripts/build-rootfs.sh # Build BusyBox rootfs ``` - **Source**: `downloads/busybox-*/` - **Output**: `build/rootfs/` ### **3. System Components** ```bash ./scripts/build-drivers.sh # Build hardware drivers ./scripts/build-ui.sh # Build UI components ./scripts/build-telephony.sh # Build telephony stack ./scripts/build-packaging.sh # Build system images ``` - **Source**: `src/*/` - **Output**: `build/*/` ### **4. System Integration** ```bash ./scripts/build-boot-image.sh # Create bootable image ``` - **Input**: `build/kernel/`, `build/rootfs/` - **Output**: `build/images/` ## ๐Ÿงช Testing and Emulation ### **Emulation Options** ```bash ./scripts/emulate-simple.sh # Simple QEMU demo ./scripts/emulate-bbeos.sh # Full BBeOS emulation ./scripts/emulate-terminal.sh # Terminal-based simulation ``` ### **Hardware Testing** ```bash ./scripts/hardware-test.sh # Hardware component testing ``` ## ๐Ÿ“š Documentation Access ### **Main Guides** - **Development Guide**: `docs/DEVELOPMENT_GUIDE.md` - **Project Structure**: `PROJECT_STRUCTURE.md` (this file) - **Quick Start**: `QUICK_START.md` ### **Phase Documentation** - **Phase 1**: `docs/phases/PHASE_1_*.md` - Research & Feasibility - **Phase 2**: `docs/phases/PHASE_2_*.md` - Bootstrapping - **Phase 3**: `docs/phases/PHASE_3_*.md` - Hardware Support - **Phase 4**: `docs/phases/PHASE_4_*.md` - User Interface - **Phase 5**: `docs/phases/PHASE_5_*.md` - Telephony Stack - **Phase 6**: `docs/phases/PHASE_6_*.md` - Packaging & Updates - **Phase 7**: `docs/phases/PHASE_7_*.md` - Community & SDK ### **How-to Guides** - **Emulation**: `docs/guides/EMULATION_GUIDE.md` - **Hardware Testing**: `docs/guides/hardware-testing-guide.md` ### **API Documentation** - **UI/UX Design**: `docs/api/UI_UX_DESIGN.md` - **Security Analysis**: `docs/api/SECURITY_ANALYSIS.md` ## ๐Ÿ”ง Configuration ### **Build Configuration** - **Kernel config**: `src/kernel/msm8960-defconfig` - **Device tree**: `vendor/kernel-source/arch/arm/boot/dts/qcom/` - **Build artifacts**: `build/` directory structure ### **Environment Variables** - `CROSS_COMPILE`: ARM cross-compilation toolchain - `KERNEL_DIR`: Kernel source directory (`vendor/kernel-source`) - `BUILD_DIR`: Build output directory (`build/`) ## ๐ŸŽฏ Benefits of This Structure ### **1. Maintainability** - **Clear separation** between source, build, and documentation - **Consistent naming** conventions throughout - **Modular organization** for easy navigation ### **2. Scalability** - **Extensible structure** for new components - **Standard directories** for common project needs - **Build system** that scales with project growth ### **3. Developer Experience** - **Intuitive navigation** through logical organization - **Comprehensive documentation** at every level - **Clear build workflows** with dedicated scripts ### **4. Open Source Best Practices** - **Standard directory layout** following open source conventions - **Proper separation** of concerns - **Comprehensive documentation** structure --- *This structure is designed to support the development of a complete operating system while maintaining clarity and organization for developers and contributors.*