{"id":31465590,"url":"https://github.com/shekharshwetank/rtos","last_synced_at":"2026-05-16T11:33:07.855Z","repository":{"id":315743454,"uuid":"1060676018","full_name":"ShekharShwetank/RTOS","owner":"ShekharShwetank","description":"RTOS for Raspberry Pi 5 ","archived":false,"fork":false,"pushed_at":"2025-09-20T11:42:53.000Z","size":3785,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-20T13:17:55.383Z","etag":null,"topics":["linux-kernel","preempt-rt","real-time-depth-estimation","real-time-object-detection-models","real-time-operating-systems"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShekharShwetank.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-20T11:13:08.000Z","updated_at":"2025-09-20T11:50:07.000Z","dependencies_parsed_at":"2025-09-20T13:18:43.363Z","dependency_job_id":"02dcface-ce38-482f-96fd-045f5ede7950","html_url":"https://github.com/ShekharShwetank/RTOS","commit_stats":null,"previous_names":["shekharshwetank/rtos"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ShekharShwetank/RTOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShekharShwetank%2FRTOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShekharShwetank%2FRTOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShekharShwetank%2FRTOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShekharShwetank%2FRTOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShekharShwetank","download_url":"https://codeload.github.com/ShekharShwetank/RTOS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShekharShwetank%2FRTOS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277883736,"owners_count":25894167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-01T02:00:09.286Z","response_time":88,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux-kernel","preempt-rt","real-time-depth-estimation","real-time-object-detection-models","real-time-operating-systems"],"created_at":"2025-10-01T17:55:41.037Z","updated_at":"2026-05-16T11:33:07.848Z","avatar_url":"https://github.com/ShekharShwetank.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-Time OS (RTOS) for Raspberry Pi 5\n\n**Build and Benchmarking Suite for Deterministic Real-Time Systems**\n\n\u003e Award-winning project: [CATERPILLAR TECH CHALLENGE 2025 Winners](https://www.linkedin.com/posts/shwetank-shekhar-002b9b203_caterpillartechchallenge-caterpillar100-rtos-activity-7357453575540658177-fU2y?utm_source=share\u0026utm_medium=member_desktop\u0026rcm=ACoAADP3l0IB_pF2cEhbDCVtuh9m-Vzfyl9vxcI)\n\n---\n\n## Table of Contents\n\n- [Overview](#overview)\n- [System Specifications](#system-specifications)\n- [Quick Start](#quick-start)\n- [Components](#components)\n  - [Kernel Build](#kernel-build)\n  - [Benchmarking Suite](#benchmarking-suite)\n  - [End-to-End Inference Testing](#end-to-end-inference-testing)\n- [Installation \u0026 Setup](#installation--setup)\n- [Running Benchmarks](#running-benchmarks)\n- [Performance Results](#performance-results)\n- [Troubleshooting](#troubleshooting)\n- [Project Structure](#project-structure)\n\n---\n\n## Overview\n\nThis repository provides a **complete framework for building and validating a PREEMPT_RT real-time kernel** on Raspberry Pi 5, along with a **comprehensive benchmarking suite** to measure and characterize deterministic system behavior.\n\nThe RTOS kernel enables:\n- **Microsecond-level latency** (\u003c200 µs under full stress)\n- **Deterministic scheduling** with bounded jitter\n- **Suitable for real-time AI/ML workloads** including monocular depth estimation, robotics, and safety-critical edge computing\n\n### Key Features\n\n✅ **Custom PREEMPT_RT kernel** (v6.15.y branch, native compilation on Pi 5)  \n✅ **Multi-scenario cyclictest benchmarking** (idle, light, moderate, heavy, thermal stress)  \n✅ **End-to-end latency measurement** for inference pipelines  \n✅ **Comprehensive statistical analysis** (percentiles, jitter, WCET)  \n✅ **Thermal and power consumption tracking**  \n✅ **CPU isolation and frequency scaling support**  \n\n---\n\n## System Specifications\n\n### Operating System \u0026 Kernel Details\n\n| Parameter | Value |\n|-----------|-------|\n| **Operating System** | Raspberry Pi OS (64-bit), Debian Bookworm |\n| **Kernel Version** | 6.15.0-rc7-v8-16k-NTP+ |\n| **Architecture** | aarch64 (64-bit) |\n| **Build Method** | Native compilation on Raspberry Pi 5 |\n| **Real-Time Model** | PREEMPT_RT (Full Real-Time Preemption) |\n\n### Critical Kernel Configurations\n\n| Configuration | Setting | Purpose |\n|---|---|---|\n| `CONFIG_PREEMPT_RT` | `y` | Full kernel preemption for real-time scheduling |\n| `CONFIG_HZ_1000` | `y` | High-resolution timer (1000 Hz tick rate) |\n| `CONFIG_NO_HZ_FULL` | `y` | Tickless kernel on isolated cores |\n| `CONFIG_NTP_PPS` | `y` | Kernel PPS (Pulse Per Second) timing support |\n| `CONFIG_PPS_CLIENT_GPIO` | `y` | GPIO-based precise time synchronization |\n| CPU Governor | `performance` | Disabled frequency scaling during tests |\n\n---\n\n## Hardware Requirements\n\n| Component | Specification |\n|-----------|---------------|\n| **CPU** | Raspberry Pi 5 (4-core ARM Cortex-A76 @ 2.4 GHz) |\n| **RAM** | 8GB LPDDR4X-4267 SDRAM (minimum) |\n| **Storage** | 64GB microSD card (minimum) |\n| **Cooling** | Official Raspberry Pi Active Cooler (recommended) |\n| **Power** | 27W USB-C PSU (Pi 5 recommended supply) |\n| **Optional** | 128GB USB 3.2 for logging/datasets, GPIO test hardware |\n\n---\n\n## Quick Start\n\n### Option 1: Automated Build (Recommended)\n\n```bash\nchmod +x build_rt_kernel.sh\n./build_rt_kernel.sh\n```\n\nThe script handles:\n- Dependency installation\n- Kernel source cloning\n- Configuration \u0026 compilation\n- Boot directory setup\n- System reboot into RT kernel\n\n**⏱️ Estimated time:** 45–90 minutes (native compilation on Pi 5)\n\n### Option 2: Manual Build\n\nFollow the step-by-step instructions in [Kernel Build Process](Kernel_Build_Process.md).\n\n---\n\n## Components\n\n### Kernel Build\n\n**Purpose:** Compile a PREEMPT_RT kernel optimized for Raspberry Pi 5.\n\n**Files:**\n- [`build_rt_kernel.sh`](build_rt_kernel.sh) — Automated build script\n- [`README.md`](#) — This file (detailed instructions)\n\n**Key Optimizations:**\n- `-O3` compiler optimization + `-march=native` for Pi 5 CPU features\n- `-j6` parallel compilation (1.5× CPU cores for stability)\n- Native compilation avoids cross-compilation overhead\n- Device tree blobs (DTBs) tailored for BCM2712 (Pi 5 SoC)\n\n**Output:**\n- RT kernel binary: `/boot/firmware/kernel_2712-NTP.img`\n- Modules: `/lib/modules/$(uname -r)/`\n- Device trees: `/boot/firmware/NTP/`\n\n---\n\n### Benchmarking Suite\n\n**Purpose:** Comprehensive validation of real-time determinism under multiple load scenarios.\n\n**File:** [`Enhanced_rtos_benchmark_v2.1.sh`](Enhanced_rtos_benchmark_v2.1.sh)\n\n**What It Measures:**\n\n| Metric | Tool | Purpose |\n|--------|------|---------|\n| **Scheduling Latency** | `cyclictest` | RT timer interrupt response time under load |\n| **Thermal Profile** | `vcgencmd` | Temperature and throttling behavior |\n| **System Stress** | `stress-ng` | CPU, memory, I/O load simulation |\n| **Jitter Distribution** | Statistical analysis | Percentile latencies (50th–99.99th) |\n| **Power Consumption** | VCM monitoring | Voltage, frequency, throttle events |\n\n**Benchmark Scenarios:**\n\n1. **Idle** — No load, baseline performance (~2 µs latency)\n2. **Light** — 1 CPU core + light I/O (~1 µs latency)\n3. **Moderate** — 2 CPU cores + medium I/O (~5–10 µs latency)\n4. **Heavy** — 3 CPU cores + high memory pressure + I/O (~50–100 µs latency)\n5. **Thermal** — Sustained load to trigger thermal throttling\n\n**Output Structure:**\n```\nrtos_benchmark_YYYYMMDD_HHMMSS/\n├── system_info.txt                    # Hardware/kernel configuration\n├── thermal_power_log.csv              # Continuous monitoring (5s intervals)\n├── power_thermal_stats.txt            # Power analysis \u0026 throttle events\n├── statistical_summary.txt            # Complete percentile statistics\n├── statistical_summary.json           # Machine-readable results\n├── cyclictest_idle/\n│   ├── cyclictest.json\n│   ├── cyclictest_raw.txt\n│   ├── min_latency.txt\n│   ├── avg_latency.txt\n│   └── max_latency.txt\n├── cyclictest_light/\n├── cyclictest_moderate/\n├── cyclictest_heavy/\n└── cyclictest_thermal/\n```\n\n**Key Features:**\n- ✅ Pre-flight validation (RT kernel, tools, CPU isolation)\n- ✅ Background thermal monitoring (continuous)\n- ✅ Per-scenario stress load management\n- ✅ Configurable test duration (default: 600s)\n- ✅ JSON export for automated analysis\n\n---\n\n### End-to-End Inference Testing\n\n**Purpose:** Measure complete latency pipeline for AI/ML inference (e.g., depth estimation).\n\n**File:** [`e2e_inference_benchmark.py`](e2e_inference_benchmark.py)\n\n**What It Measures:**\n\n```\nFrame Capture → Preprocessing → Inference → Postprocessing → Decision\n       ↓              ↓              ↓            ↓              ↓\n   tflite runtime + OpenCV benchmarking\n       ↓\n   Total E2E Latency + Component Breakdown\n```\n\n**Breakdown Components:**\n- **Preprocessing:** Frame crop, resize, normalization (1–5 µs)\n- **Inference:** TFLite model inference on CPU (50–200 µs)\n- **Postprocessing:** Depth alignment, ROI extraction, threshold decision (5–10 µs)\n\n**Configuration:**\n```python\nMODEL_PATH = \"ADALITE_TFLITE.tflite\"\nMODEL_INPUT_HEIGHT = 256\nMODEL_INPUT_WIDTH = 256\nSAMPLE_COUNT = 1000\n```\n\n**Output:**\n- `e2e_inference_latency.csv` — Per-sample breakdown (Sample, Total, Preproc, Inference, Postproc)\n- `e2e_inference_stats.txt` — Statistical summary with percentiles \u0026 throughput\n\n**Example Usage:**\n```bash\npython3 e2e_inference_benchmark.py\n# Outputs: e2e_inference_latency.csv, e2e_inference_stats.txt\n```\n\n---\n\n## Installation \u0026 Setup\n\n### Prerequisites\n\n**Hardware:**\n- Raspberry Pi 5 (8GB RAM minimum)\n- 64GB microSD with Raspberry Pi OS (Bookworm, 64-bit)\n- Active cooling (fan or heatsink)\n\n**Software Dependencies (Auto-installed by scripts):**\n```bash\n# Kernel build dependencies\ngit bc bison flex libssl-dev make libncurses5-dev raspberrypi-kernel-headers\n\n# Benchmarking dependencies\nrt-tests          # Contains cyclictest\nstress-ng         # Load generation\npython3           # Analysis scripts\npython3-opencv    # Frame processing (for e2e_inference_benchmark.py)\ntflite-runtime    # For inference benchmarking\n```\n\n### Step 1: Initialize Environment\n\n```bash\nsudo apt update \u0026\u0026 sudo apt upgrade -y\n\n# Install essential build tools\nsudo apt install -y git bc bison flex libssl-dev make libncurses5-dev\n\n# Benchmarking tools\nsudo apt install -y rt-tests stress-ng\n\n# Python dependencies\npip3 install --break-system-packages \\\n    numpy opencv-python tflite-runtime pandas\n```\n\n### Step 2: Clone or Download Repository\n\n```bash\n# Clone from GitHub (if available)\ngit clone https://github.com/ShekharShwetank/RTOS.git\ncd RTOS\n\n# Or extract if provided as ZIP\nunzip RTOS.zip \u0026\u0026 cd RTOS\n```\n\n### Step 3: Build RT Kernel\n\n```bash\nchmod +x build_rt_kernel.sh\n./build_rt_kernel.sh\n```\n\n**What Happens:**\n1. Downloads Raspberry Pi Linux v6.15.y\n2. Applies BCM2712 (Pi 5) default configuration\n3. Prompts for manual config (or use defaults)\n4. Compiles kernel with `-O3 -march=native -j6`\n5. Installs modules\n6. Copies kernel + DTBs to `/boot/firmware/NTP/`\n7. Reboots into RT kernel\n\n**Troubleshooting:**\n- If `menuconfig` appears: press Escape → Save → Exit (to use defaults)\n- Build fails? Ensure `/boot/firmware/` has \u003e500MB free\n- Reboot hangs? Hold Ctrl+C, insert old SD, rebuild\n\n### Step 4: Verify RT Kernel\n\nAfter reboot:\n\n```bash\nuname -a\n# Expected: ...PREEMPT_RT...\n\n# Check RT config\ncat /boot/config-$(uname -r) | grep CONFIG_PREEMPT_RT\n# Expected: CONFIG_PREEMPT_RT=y\n\n# Check timer frequency\ncat /boot/config-$(uname -r) | grep CONFIG_HZ\n# Expected: CONFIG_HZ_1000=y\n```\n\n---\n\n## Running Benchmarks\n\n### Benchmark 1: Multi-Scenario Cyclictest\n\n```bash\n./Enhanced_rtos_benchmark_v2.1.sh [DURATION_SECONDS]\n```\n\n**Examples:**\n\n```bash\n# Default: 600 seconds (10 minutes)\n./Enhanced_rtos_benchmark_v2.1.sh\n\n# Extended run: 3600 seconds (1 hour) for statistical significance\n./Enhanced_rtos_benchmark_v2.1.sh 3600\n\n# Quick test: 300 seconds (5 minutes)\n./Enhanced_rtos_benchmark_v2.1.sh 300\n```\n\n**Output:**\n```\nEnhanced RTOS Benchmarking Suite v2.1\n✓ PREEMPT_RT kernel detected\n✓ Pre-flight checks complete\n[1/7] Capturing System Baseline...\n[2/7] Starting System Health Monitoring...\n[3/7] Preparing GPIO End-to-End Latency Test...\n[4/7] Running Multi-Scenario Cyclictest...\n[5/7] Power Consumption Analysis...\n[6/7] Computing Jitter and Percentile Statistics...\n[7/7] Generating Final Report...\n\nResults saved in: rtos_benchmark_*/\n```\n\n**Interpreting Results:**\n\n```bash\n# View statistical summary\ncat rtos_benchmark_*/statistical_summary.txt\n\n# View thermal profile\ncat rtos_benchmark_*/power_thermal_stats.txt\n\n# Analyze per-scenario latencies\ncat rtos_benchmark_*/cyclictest_idle/min_latency.txt\ncat rtos_benchmark_*/cyclictest_heavy/max_latency.txt\n```\n\n### Benchmark 2: End-to-End Inference Latency\n\n```bash\npython3 e2e_inference_benchmark.py\n```\n\n**Prerequisites:**\n```bash\n# Ensure TFLite model is in current directory\nls -lh ADALITE_TFLITE.tflite\n\n# Or provide test video\nls -lh input_road.mp4\n```\n\n**Output Example:**\n```\nEnd-to-End ADALITE Inference Latency Benchmark\n============================================================\nModel: ADALITE_TFLITE.tflite\nSamples: 1000\nResolution: 256x256\n\nMetric               Total    Preproc  Inference  Postproc\n------------------------------------------------------\nMean                 95.32 μs  2.15 μs  89.42 μs   3.75 μs\n99th %ile           156.00 μs  5.20 μs 148.30 μs   8.90 μs\n99.9th %ile         201.00 μs  8.10 μs 195.20 μs  12.50 μs\n\n✓ Detailed statistics saved to: e2e_inference_stats.txt\n✓ Raw data saved to: e2e_inference_latency.csv\n```\n\n---\n\n## Performance Results\n\n![alt text](benchmarking/publication_results/figures/fig1_latency_comparison.png)\n![alt text](benchmarking/publication_results/figures/fig2_jitter_analysis.png)\n![alt text](benchmarking/publication_results/figures/fig3_thermal_power.png)\n![alt text](benchmarking/publication_results/figures/fig4_e2e_latency.png)\n\n### Scheduling Latency Statistics Across Load Scenarios\n\n| Scenario | Mean (µs) | Median (µs) | 95th %ile (µs) | 99th %ile (µs) | 99.9th %ile (µs) | WCET (µs) | Jitter (µs) |\n|----------|-----------|-------------|----------------|----------------|------------------|-----------|-------------|\n| **Idle** | 2.01 | 2.00 | 2.00 | 3.00 | 4.00 | 16.00 | 0.20 |\n| **Light** | 1.02 | 1.00 | 1.00 | 2.00 | 4.00 | 23.00 | 0.23 |\n| **Moderate** | 1.16 | 1.00 | 2.00 | 3.00 | 9.00 | 109.00 | 0.79 |\n| **Heavy** | 1.34 | 1.00 | 3.00 | 5.00 | 11.00 | 76.00 | 1.01 |\n| **Thermal** | 1.55 | 2.00 | 2.00 | 2.00 | 5.00 | 20.00 | 0.55 |\n\n**Table Notes:**\n- WCET: Worst-Case Execution Time (maximum observed latency)\n- Jitter: Standard deviation of scheduling latencies\n- All measurements conducted on Raspberry Pi 5 with PREEMPT_RT Linux kernel v6.15\n- Each scenario tested with 3–6 million samples\n\n### End-to-End ADALITE Inference Latency\n\n| Metric | Latency (µs) | Latency (ms) |\n|--------|-------------|------------|\n| **Mean** | 116,436 | 116.4 |\n| **Median** | 115,899 | 115.9 |\n| **95th percentile** | 118,885 | 118.9 |\n| **99th percentile** | 140,788 | 140.8 |\n| **99.9th percentile** | 192,077 | 192.1 |\n| **Maximum (WCET)** | 221,341 | 221.3 |\n\n**Component Breakdown (Mean):**\n\n| Component | Latency (µs) | Latency (ms) | % of Total |\n|-----------|-------------|------------|-----------|\n| Preprocessing | 5,066 | 5.1 | 4.4% |\n| Inference | 111,076 | 111.1 | 95.4% |\n| Postprocessing | 282 | 0.3 | 0.2% |\n\n**Table Notes:**\n- Measured over 1,000 samples processing KITTI road scenes\n- Inference component dominates at 95.4% of total latency\n- End-to-end latency suitable for real-time robotics and autonomous systems\n\n---\n\n## Troubleshooting\n\n### Issue: PREEMPT_RT kernel not detected\n\n```bash\nuname -a\n# Should show: PREEMPT_RT\n\n# If not shown:\ncat /boot/config-$(uname -r) | grep CONFIG_PREEMPT_RT\n# Should output: CONFIG_PREEMPT_RT=y\n```\n\n**Solution:**\n1. Verify boot configuration: `cat /boot/firmware/config.txt`\n2. Check kernel copy: `ls -lh /boot/firmware/kernel_2712-NTP.img`\n3. Rebuild if needed: `./build_rt_kernel.sh`\n\n### Issue: cyclictest reports high latencies (\u003e1000 µs)\n\n**Causes:** Frequency scaling, CPU interrupts, kernel debugging\n\n**Solutions:**\n```bash\n# Check frequency governor\ncat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n# Should be: performance\n\n# Force performance governor if needed\necho performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor\n\n# Verify CPU isolation\ncat /sys/devices/system/cpu/isolated\n# Should include: 3 (isolated core)\n\n# Add to /boot/cmdline.txt if missing:\n# isolcpus=3 nohz_full=3 rcu_nocbs=3\n```\n\n### Issue: Benchmarking script fails (missing tools)\n\n```bash\n# Install missing dependencies\nsudo apt install -y rt-tests stress-ng python3 python3-pip\n\n# Install Python packages\npip3 install --break-system-packages \\\n    numpy pandas opencv-python tflite-runtime\n```\n\n### Issue: Thermal throttling detected\n\n```\nThrottle Events: 12 (ARM frequency capped)\n```\n\n**Solutions:**\n1. Attach active cooler to Pi 5\n2. Improve airflow (case ventilation)\n3. Reduce test duration temporarily\n4. Disable heavy load scenarios (thermal test)\n\n---\n\n## Project Structure\n\n```\nRTOS/\n├── README.md                          # This file\n├── build_rt_kernel.sh                 # Automated kernel build \u0026 deployment\n├── Enhanced_rtos_benchmark_v2.1.sh    # Multi-scenario benchmarking suite\n├── e2e_inference_benchmark.py         # End-to-end inference latency measurement\n├── benchmarking/                      # Example benchmark results\n│   ├── system_info.txt\n│   ├── statistical_summary.txt\n│   ├── statistical_summary.json\n│   ├── power_thermal_stats.txt\n│   ├── cyclictest_idle/\n│   ├── cyclictest_light/\n│   ├── cyclictest_moderate/\n│   ├── cyclictest_heavy/\n│   ├── cyclictest_thermal/\n│   └── publication_results/\n│       ├── ANALYSIS_SUMMARY.txt\n│       ├── figures/                  # PNG/PDF plots\n│       └── latex_tables/             # Publication-ready LaTeX tables\n├── assets/                            # Supporting files (if any)\n└── .git/                              # Version control\n```\n\n---\n\n## Advanced Configuration\n\n### CPU Isolation for Ultra-Low Latency\n\nTo dedicate core 3 entirely to RT tasks:\n\nEdit `/boot/cmdline.txt` and add:\n```\nisolcpus=3 nohz_full=3 rcu_nocbs=3 kthread_cpus=0-2 irqaffinity=0-2\n```\n\nThen rebuild/reboot. This prevents:\n- Kernel threads from running on core 3\n- IRQ handling on core 3\n- Timer ticks on core 3\n\n**Expected Latency Improvement:** 5–15% reduction in jitter under stress\n\n### GPIO PPS Timing (Advanced)\n\nFor synchronized clock with external PPS source:\n\n```bash\n# Install PPS tools\nsudo apt install pps-tools gpsd\n\n# Connect GPIO pin 17 to PPS source\n# Verify detection\nsudo ppstest /dev/pps0\n```\n\nThen configure NTP:\n```bash\n# Edit /etc/ntp.conf\n# Add: server 127.127.8.0 minpoll 4 maxpoll 4\n```\n\n---\n\n## Performance Tuning Tips\n\n| Tuning | Expected Gain | Difficulty |\n|--------|---------------|-----------|\n| CPU isolation (isolcpus) | 5–15% lower latency | Easy |\n| Performance governor | 10% lower latency | Easy |\n| Disable USB hub scanning | 5% lower jitter | Easy |\n| Move IRQs off core | 2–5% improvement | Medium |\n| Disable unused CPUs | 3% lower idle latency | Medium |\n| Custom cyclictest priority | Varies | Hard |\n\n---\n\n## References\n\n- **Linux Kernel Documentation:** https://www.kernel.org/doc/html/latest/\n- **RT-Tests (cyclictest):** https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/rt-tests\n- **Raspberry Pi Linux:** https://github.com/raspberrypi/linux\n- **PREEMPT_RT Wiki:** https://rt.wiki.kernel.org/\n\n---\n\n## Contributing\n\nContributions, bug reports, and performance improvements are welcome. Submit via:\n- GitHub Issues/PRs\n- Email: shwetankshekharcode@gmail.com\n\n---\n\n## License\n\nThis project documentation and scripts are provided as-is for research and educational purposes.\n\n---\n\n## Acknowledgments\n\n**Caterpillar Tech Challenge 2025 Winners** — Complete RTOS implementation and validation framework for real-time edge AI on embedded systems.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekharshwetank%2Frtos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshekharshwetank%2Frtos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekharshwetank%2Frtos/lists"}