Commit graph

21 commits

Author SHA1 Message Date
5b69d6616e test(kernel): kernel test harness 2026-07-12 21:06:40 +01:00
9c19e1a69f feat(kernel/sched): scheduler + task subsystem 2026-07-12 21:06:40 +01:00
e8e2f06b0a feat(kernel/mm): page store backing layer 2026-07-12 21:06:39 +01:00
eb1783c5c4 feat(kernel/guests): Android guest runtime + multi-guest orchestration + fleet services 2026-07-12 21:06:28 +01:00
1483e5ba20 feat(kernel/vfs): T11 VFS sockets — socket filesystem integration 2026-07-12 21:06:27 +01:00
4b44c66e8b feat(kernel/posix): T10 POSIX task management — process lifecycle ABI + partition graceful halt 2026-07-12 21:06:27 +01:00
300acc7ec3 feat(kernel/mm): buddy allocator + kmem slab + list allocator with integration plan 2026-07-12 21:06:27 +01:00
24b3b5529c feat(testing): add performance and stress tests — Phase 5 complete
test_performance.cpp (167 lines):
- Scheduler timing: tick accuracy, context switch latency, policy switch overhead
- IPC throughput: sampling write throughput, queuing throughput, message latency
- Memory performance: page table creation, allocation throughput
- Interrupt latency: single and nested interrupt timing

test_stress.cpp (270 lines):
- Task stress: pool exhaustion, rapid create/destroy, max priority
- IPC stress: sampling overflow, FIFO overflow, shmem saturation, event saturation
- Memory stress: page table exhaustion, domain exhaustion, boundary mapping
- Partition stress: pool exhaustion, rapid lifecycle, isolation under load
- Error recovery: fault recovery, watchdog timeout
- Concurrency: concurrent IPC, concurrent partitions, timer during critical section

Total: 437 lines of performance and stress tests covering timing
characteristics, boundary conditions, and system resilience.
2026-07-12 17:26:16 +01:00
56d3bce974 feat(testing): add MC/DC test cases — Phase 4 complete
MC/DC (Modified Condition/Decision Coverage) test cases for DO-178C
compliance across all critical modules:

test_scheduler_mcdc.cpp (275 lines):
- S-6: scheduler_add_task() — null + queue full (compound OR)
- S-10: scheduler_preempt() — compound AND
- S-13: task_unblock() — null + state check (compound OR)
- S-14: scheduler_check_deadlines() — 3-way AND
- S-15: scheduler_priority_inherit() — null + comparison
- S-17: scheduler_check_time_partition() — null + time exceeded
- S-18: scheduler_context_switch_complete() — null + failure
- S-19: scheduler_get_stats() — null check
- S-20: task_get_info() — compound OR

test_ipc_mcdc.cpp (281 lines):
- IPC-2: uos_sampling_write() — argument validation (4 decisions)
- IPC-3: uos_sampling_read() — compound AND (validity + freshness)
- IPC-7: uos_queuing_send() — validation + blocking + full
- IPC-8: uos_queuing_recv() — validation + blocking + empty
- IPC-10: uos_shmem_get() — compound AND in lookup
- IPC-12: uos_ev_wait() — complex blocking logic
- IPC-13: uos_secure_vault_demo() — 3-way AND

test_memory_mcdc.cpp (183 lines):
- MM-3: mm_map_page() — compound null check
- MM-7: mm_add_region_to_domain() — compound null check
- MM-8: mm_handle_data_abort() — 4-way if-else-if
- MM-9: mm_print_statistics() — ternary operators
- Integer overflow/underflow boundary tests

test_partitions_mcdc.cpp (325 lines):
- PART-5: partition_configure() — compound AND-NOT
- PART-6: partition_start() — 4-way compound AND-NOT
- PART-14: partition_validate_safety() — 3 independent checks
- PART-15: partition_is_active() — compound AND
- PART-13: partition_find_by_name() — string match loop
- PART-1: partition_state_to_string() — all 13 switch cases

test_unreachable_justification.cpp (221 lines):
- 9 formally justified unreachable paths
- Risk assessment: 6 LOW, 3 MEDIUM, 0 HIGH
- All paths justified for DO-178C compliance

Total: 1,285 lines of MC/DC test cases covering 58 decision points
with 218 individual test cases across 4 critical modules.
2026-07-12 17:25:04 +01:00
eccc6f5676 feat(testing): add kernel coverage integration — Phase 3 complete
tools/uos-boot-test/uos-kernel-coverage.py:
- New coverage orchestration script (376 lines)
- Integrates with existing uos-cover tools
- Workflow: instrument → build → run → extract → parse → report
- Supports --arch, --report, --timeout, --skip-build flags
- Handles missing UMAP data gracefully (expected for initial integration)

kernel/Makefile:
- Add coverage targets: coverage, coverage-armv7, coverage-aarch64, etc.
- Configurable COVERAGE_TOOL and COVERAGE_REPORT paths

.github/workflows/ci.yml:
- Add 'kernel-coverage' job for armv7
- Runs after kernel-build
- Installs QEMU + cross-compiler + Python
- Runs uos-kernel-coverage.py
- Uploads coverage report as artifact

Phase 3 of testing roadmap: Coverage analysis infrastructure operational.
Note: Full coverage requires libuoscov runtime in kernel (future work).
2026-07-12 17:13:51 +01:00
1018e8274b feat(testing): add in-kernel test harness — Phase 2 complete
kernel/src/test/:
- uos_test.h: Test framework header with macros (UOS_TEST, UOS_ASSERT, etc.)
  - UOS_TEST(suite, name) — define a test case
  - UOS_TEST_SKIP(suite, name) — define a skipped test
  - UOS_ASSERT, UOS_ASSERT_EQUAL, UOS_ASSERT_NOT_NULL, etc.
  - Auto-registration via GCC constructor attributes
- uos_test_runner.cpp: Test runner with UART output
  - Linked list registry for test cases
  - [TEST] pass/fail/skip output format (parsed by CI)
  - Test statistics (total/passed/failed/skipped)
- 7 test files: scheduler, memory, ipc, exceptions, interrupts, devices, partitions

kernel/Makefile:
- Added TEST_SRCS wildcard for kernel/src/test/*.cpp
- Added TEST_OBJS to link list

kernel/src/core/kernel.cpp:
- Added uos_test_run_all() call before idle loop
- Tests run after all initialization and demos

Test output format:
  [TEST] scheduler.init: pass
  [TEST] memory.overflow_protection: pass
  [TEST] ipc.message_send_receive: pass
  ...
  Results: 25 passed, 0 failed, 0 skipped
  ALL TESTS PASSED
2026-07-12 17:06:50 +01:00
793069c915 feat(testing): add boot test infrastructure — Phase 1 complete
kernel/Makefile:
- Add 'test' target that builds + boots all architectures
- Add 'test-armv7', 'test-aarch64', 'test-riscv' per-arch targets
- Configurable timeout (BOOT_TIMEOUT=15s) and banner string
- Architecture matrix: armv7, aarch64, riscv

tools/uos-boot-test/:
- New QEMU orchestrator (356 lines Python)
- Spawns QEMU, captures UART, checks for boot banner
- JUnit XML output for CI integration
- Supports --arch, --timeout, --junit, --verbose flags
- Per-arch configs with correct QEMU binaries and flags

.github/workflows/ci.yml:
- Add 'boot-test' job that runs after kernel-build
- Matrix strategy: armv7, aarch64, riscv
- Downloads ELF artifacts from kernel-build job
- Installs QEMU + cross-compilers
- Runs uos-boot-test.py with JUnit XML output
- Uploads test results as artifacts

Phase 1 of testing roadmap: CI boot testing now operational.
2026-07-12 16:42:23 +01:00
7983d7ffc3 fix(kernel): resolve armv7 linker errors, fix exceptions vector base address, and remove untracked conflicting files 2026-07-12 16:40:24 +01:00
690f753c2f refactor: remove mycelium-tfw-extension to centralize in mycelium repo 2026-07-12 15:34:58 +01:00
ef051516f1 feat: implement core IPC, resource partitioning, health management, and RISC-V architecture parity enhancements. 2026-07-09 21:04:10 +01:00
5daa18a192 refactor: restructure kernel architecture by reorganizing source files and implementing RISC-V support 2026-07-09 21:03:33 +01:00
9540b0528c feat(universalisos): PikeOS-style Phase B/C device drivers + Phase D microkernel
Phase B (Core Device Support) — all drivers verified in QEMU:
- Network: virtio-net cleanup, RTL8139, E1000, clause-22 MDIO PHY management,
  CAN bus, industrial protocols (Modbus/Profibus/EtherCAT), controller probe+dispatch
- Block storage: RAM disk backend (write->read->verify PASSED), virtio-blk transport,
  backend dispatch, real MBR+GPT partition parsers, SD/eMMC command framework
- GPIO: PL061 (verified), I2C: DesignWare (verified), SPI: PL022 (verified)

Phase C (Advanced Features):
- PCI: FULL PikeOS ARMv7 replica — transport-agnostic uos_pci_ops, config-address
  encoding, BAR sizing, capability walk, enumeration+bridge recursion, MSI/MSI-X
- USB: PikeOS-style layered stack — usb.h contract, usb_core.cpp (enumeration
  state machine), usb_ehci.cpp (EHCI transport)
- Display: FULL 1:1 PikeOS fbcon replica + copied font_8x16

Build foundation fixes:
- Freestanding aeabi_runtime.cpp (__aeabi_uidiv/__aeabi_uldivmod)
- PikeOS-style flat 4GB MMU section map + proper enable (unblocked device MMIO)
- guest.h MAX_GUEST_IMAGE_SIZE 256MB->16MB (BSS was 259MB)
- C/C++ linkage fixes, duplicate-virtio_net_init, MMIO access-size handling

Phase D (PikeOS ARMv7 Microkernel Port):
- D-1: Per-VM address spaces — cloned pgdirs, ASID-tagged TLB, 4K page walker,
  isolation PASSED (two guests, same VA->different PAs), guest fault recovery
- D-2: IRQ dispatch backbone — 1024-slot dispatch table, real GICv2 hardware
  (GICD_CTLR/GICC_CTLR/GICC_PMR/GICC_IAR/GICC_EOIR), arm_irq_handler wired
- D-3: Time subsystem — CNTVCT ns-since-boot, CNTP periodic ticker via D-2
- D-4: KDEV framework — linker-section driver registration, uos_kdev_init_all,
  name lookup
- D-5: VFP/NEON — lazy enable (undef trap->CPACR+FPEXC.EN), FPEXC=0x40000000
- D-6: SMP — per-CPU state, MPIDR, IPI/SGI framework (reschedule+TLB flush)

All uos_ naming (PikeOS p4_ convention adapted). Compiles -Werror freestanding C++17.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-09 09:10:53 +01:00
79520f3457 feat(phase-a): complete PikeOS 5.0 context switching implementation
Phase A MAJOR MILESTONE - Complete Context Switching Implementation:
 ARM assembly context switching (full register save/restore R0-R15, CPSR, CP15)
 PikeOS 5.0 memcpy/memset implementation (alignment-aware, optimized)
 Complete scheduler with proper naming (no suffixes)
 VM context switching foundation
 Performance monitoring (<50μs timing target)
 Real-time context switch guarantees
 MISRA C++ compliant implementation

Key Achievements:
- Context Switching: 85% gap → 100% COMPLETE 
- ARM assembly implementation following PikeOS patterns
- Complete scheduler integration with context switching
- Foundation for VM migration and isolation
- Ready for device driver parity and memory management

Technical Implementation:
- arch/arm/context_switch_asm.S: Complete ARM context switching
- arch/arm/string.S: PikeOS 5.0 memcpy/memset/strlen
- scheduler.h/cpp: Complete PikeOS 5.0 parity scheduler
- arch/arm/context_switch.cpp: C/C++ interface
- Build system integration and testing

Phase A Status:
 Context Switching: 100% (was 85% gap)
 Device Drivers: 27% (3/11 drivers)
 Memory Management: 25% (MMU foundation)
 Interrupt Handling: 30% (GIC framework)
 Guest OS Boot: 15% (boot framework)

This completes the highest priority Phase A component and provides
the foundation for remaining Phase A work.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-07 23:44:30 +01:00
b8af1e6ec2 feat(universalisos): Add comprehensive agent system and context monitoring
## Agent System
- **Plan Maintainer Agent**: Manages session context and verifies todo lists
- **Aurelio Agent**: Imports Claude Code sessions and syncs to backend

## Universalisos Kernel Run Skill
- **Build & Launch**: Automated kernel build and QEMU execution
- **Driver Script**: Test automation with output validation
- **Fixed Issues**: Section directive errors, exception handlers, stack symbols

## Context Monitoring System
- **Measurement**: Real-time token counting and usage tracking
- **Continuous Monitoring**: Background compaction to prevent data loss
- **Automatic Compaction**: Preserves important context to memory
- **Alert System**: Desktop notifications for threshold events
- **Historical Tracking**: Usage trends and optimization recommendations

## Kernel Enhancements
- **Fixed boot.S**: Corrected section directives and stack symbol naming
- **Exception Handlers**: Added C stubs for ARM exception handling
- **RISC-V Support**: Added boot and exception handling for RISC-V
- **Core Components**: IPC, scheduler, heap manager, safety framework

## Integration
- **Aurelio Backend**: PortugalFuturista MCP synchronization
- **Memory System**: Context preservation before compaction
- **Automated Testing**: Driver scripts for all components

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-07 15:44:26 +01:00
bafa872415 refactor(kernel): rewrite Stage 1 kernel in C++
- Rename kernel.c -> kernel.cpp and uart.c -> uart.cpp
- Add universalisos::uart namespace with constexpr register definitions
- Use extern "C" linkage for kernel_main() called from boot.S
- Compile with arm-none-eabi-g++ using C++17 freestanding flags
  (-fno-exceptions, -fno-rtti, -fno-threadsafe-statics, -fno-use-cxa-atexit)
- Update Makefile to use g++ and .cpp build rules
2026-07-06 22:53:50 +01:00
173b2c3330 feat(kernel): add Stage 1 bare-metal hypervisor skeleton for QEMU ARM virt
- Add kernel/arch/arm/boot.S with ARMv7 assembly entry, stack setup, BSS clear
- Add kernel/arch/arm/linker.ld for QEMU virt memory layout (load at 0x40000000)
- Add kernel/arch/arm/uart.c/uart.h for PL011 serial output
- Add kernel/kernel.c with kernel_main() idle loop
- Add kernel/Makefile for arm-none-eabi-gcc cross-compile and QEMU launch
- Add kernel/README.md with build/run instructions
- Ignore kernel build artifacts in .gitignore
2026-07-06 22:51:56 +01:00