Overview

The Session Manager (smss.exe) is the first user-mode process started by the kernel. It is responsible for initializing the user session and starting critical system processes.

Responsibilities

  • Create initial user session
  • Start CSRSS (Client/Server Runtime Subsystem)
  • Initialize session environment
  • Start Winlogon (or FreeWorld equivalent)
  • Manage session lifecycle
  • Register with kernel service manager
  • Monitor critical system processes

Service Registration

SMSS registers itself with the kernel service manager on startup:

#include "libc/syscalls/service_syscalls.h"

int main(int argc, char** argv) {
    // Initialize kernel service manager
    if (service_manager_init() != 0) {
        fprintf(stderr, "smss: Failed to initialize kernel service manager\n");
        return 1;
    }

    // Register smss service
    if (service_register("smss", "/sbin/smss", 
                        SERVICE_TYPE_SIMPLE, SERVICE_RESTART_ALWAYS) != 0) {
        fprintf(stderr, "smss: Failed to register service\n");
        return 1;
    }

    // ... rest of initialization
}
Service Integration: SMSS integrates with the kernel service manager for lifecycle management, automatic restart, and health monitoring. See Service Management System for complete documentation.

Boot Sequence

  1. Kernel starts smss.exe
  2. smss.exe creates session 0
  3. smss.exe starts csrss.exe
  4. smss.exe starts freeworldlogon.exe
  5. smss.exe waits for session termination

Implementation

smss.exe is implemented as a Node.js process that runs at system startup, managing the session initialization sequence.