Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O OSKernel2026-StellarOS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • StellarOS
  • OSKernel2026-StellarOS
  • Merge requests
  • !5
You need to sign in or sign up before continuing.

Add accept4 syscall and enhance socket handling with documentation updates

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged StellarOS requested to merge net into main Mar 12, 2026
  • Overview 13
  • Commits 4
  • Pipelines 0
  • Changes 14

Created by: Alic3r3L1cwhk

This pull request implements the core of process inter-process communication (IPC) in StellarOS, including a full futex (fast userspace mutex) subsystem and System V shared memory (shm). It introduces new modules, updates documentation to reflect the expanded system call set (now 53), and describes the new robust futex list support for correct lock cleanup on thread exit. The futex implementation includes all major operations and robust list handling, while the shared memory module is integrated under the new ipc module.

Major new features:

Futex subsystem and robust list support:

  • Added a complete futex subsystem (os/src/futex/), supporting FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_BITSET, FUTEX_REQUEUE, and FUTEX_CMP_REQUEUE operations, with 256 hash buckets for wait queues and Jenkins hash for keying. This includes robust list support for automatic lock cleanup on thread exit. [1] [2] [3] [4] [5]
  • Integrated futex and robust list modules into the kernel source tree and updated the kernel directory structure in documentation.

System V shared memory (IPC):

  • Added a new ipc module with System V shared memory support (shmget, shmat, shmdt, shmctl), and re-exported the core syscalls and mapping structure.

Documentation and system call updates:

Documentation and syscall tracking:

  • Updated the project README.md to mark phase 12 (IPC: shm/futex/clone) as complete, describe the newly supported syscalls and kernel modules, and increase the syscall count from 43 to 53. [1] [2]
  • Expanded the documented kernel directory structure to include the new futex/ and ipc/ modules. This pull request introduces a major refactor and extension of the networking subsystem, adding a full-featured loopback interface, trait-based socket abstraction, a unified event system for I/O multiplexing, and a global port manager. It also updates documentation to reflect the new architecture and system call capabilities. The changes significantly improve modularity, maintainability, and standards compliance for network features.

Networking Subsystem Refactor and Feature Enhancements:

  • Added a loopback interface (lo) alongside the existing eth0 interface, both sharing the same SOCKET_SET. Introduced dual-interface polling and automatic routing for TCP connections based on destination address. Provided a new get_iface_info() API for querying interface information and a with_iface_context_for() helper for context-aware socket operations. [1] [2] [3] [4] [5] [6] [7] [8]
  • Introduced a unified Socket trait (detailed in documentation), enabling polymorphic handling of sockets, and created a PollEvent bitflags type for standardized I/O event reporting across all multiplexing syscalls.
  • Implemented a global PortManager to allocate and track TCP/UDP ports, ensuring no conflicts and proper ephemeral port assignment.

Raw Socket and Event Handling Improvements:

  • Updated the raw socket implementation to support the new PollEvent system, added a method to check non-blocking mode, and provided a poll() method for event readiness. [1] [2] [3]

Documentation and Metadata Updates:

  • Updated README.md and project structure documentation to reflect the addition of the loopback interface, the new system call (accept4), the total syscall count, and the new network architecture. Clarified future work and current capabilities. [1] [2] [3] [4] [5]
  • Removed the now-obsolete LOOPBACK_ADDR constant from addr.rs, as loopback addressing is now handled in the main network module.

These changes lay the foundation for advanced networking features, improved testability (via loopback), and easier extension for future protocols and socket types.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: net