Windows Core Services and Sessions Explained: SCM, Session 0 and Worked Examples

Separate Windows kernel managers, services and sessions, then test the distinctions through page counts, a dependency graph and a seven-process snapshot.

KnowledgeGate Team

Exam prep & CS education

Updated 25 Nov 20265 min read
Windows Core Services and Sessions Explained: SCM, Session 0 and Worked Examples

Windows core managers, Windows services, the Service Control Manager (SCM), Session Manager and user sessions sit at different layers. The kernel schedules threads, the SCM controls service state, and sessions isolate logon contexts. A 16 KiB read exercises the I/O managers, a four-service graph exposes dependency timing, and a seven-process snapshot makes session boundaries countable. GATE CS Exam Preparation places these ideas in the wider syllabus.

Core OS service, Windows service and session are different concepts

An OS service is a facility such as execution, memory, I/O, files, communication or protection. Windows kernel managers implement mechanisms, a Windows service is a managed background program, and a session groups processes and state for one logon context.

Term

Layer

Main job

Example

kernel-mode manager

kernel mode

manage a resource class

Memory Manager

Windows service

user mode

perform background work

fictional AlphaSvc.exe

Service Control Manager

user-mode system process

maintain service configuration and send controls

services.exe

session

isolation and interaction boundary

group processes for one logon context

Session 1

Session Manager

boot-time system component

start the user-mode environment

smss.exe

For the wider architecture, process, memory and access model, start with Windows Operating System: Architecture, Processes, Memory and Worked Examples. Service control, Session 0 isolation, logon-session lifecycle and named-object namespaces require a narrower map. Then place those distinctions within Operating Systems for GATE: Deadlocks, Scheduling, Memory.

Windows core managers: trace one 16 KiB read end to end

Microsoft Learn's kernel manager overview supplies the names. The Process and Thread Manager owns execution objects; the kernel schedules threads. Memory, Object and I/O managers handle memory, objects and requests. Plug and Play, Power and Configuration managers handle devices, power and configuration.

Alice's notes.exe, PID 2240 in Session 1, uses T7 and handle 0x84 for a simplified page-aligned 16 KiB direct-I/O read. The supplied page size is 4 KiB.

  1. The scheduler selects T7.

  2. The Object Manager resolves 0x84.

  3. The Memory Manager covers 16 / 4 = 4 virtual pages.

  4. The I/O Manager sends the logical 16 KiB request through the file-system and storage-driver path.

  5. Completion makes T7 eligible to run again.

Starting 3 KiB into a page changes the span to 3 + 16 = 19 KiB, so ceil(19 / 4) = 5 pages are touched. The supplied page size is not a universal Windows guarantee. Real requests can be transformed or split.

System I/O trace for notes.exe shows four 4 KiB pages for a 16 KiB buffer and five pages when a 3 KiB offset is added.

The Service Control Manager controls service state, not CPU scheduling

The SCM maintains configuration, starts services, tracks status and sends controls, as Microsoft documents. Stopped, start-pending, running and stop-pending are service states; ready, running and blocked are thread states. It does not schedule CPU time.

In a fictional parallel-start model, Alpha takes 2 s; Beta takes 4 s after Alpha; Gamma takes 3 s after Alpha; Delta takes 5 s after both.

  • Alpha runs 0 to 2.

  • Beta runs 2 to 6 while Gamma runs 2 to 5.

  • Delta starts at max(6, 5) = 6 and runs 6 to 11.

Completion is 11 s on Alpha -> Beta -> Delta: 2 + 4 + 5 = 11. A 14 s serial sum is wrong because Beta and Gamma overlap. Under this teaching model, service times are fixed inputs rather than measurements from a real Windows boot.

DAG timing chart shows Alpha, Beta, Gamma, and Delta completing in 11 seconds, with a one-second wait and 14 seconds as the serial total.

A Windows session is a logon and interaction boundary

An interactive logon receives a session ID and process environment. A terminal carries I/O; the session holds processes and state. The terminal can detach while the session remains.

Microsoft documents services and system processes in isolated Session 0, with interactive apps in higher sessions. A Session 0 dialog will not appear on Alice's Session 1 desktop; use IPC and a user-session component.

Do not assume a fixed number for the first human session, permanent identity from an ID, or that every background process is a service. In the snapshot, 1 and 3 are labels assigned to Alice's and Bob's logon contexts.

Worked snapshot: map seven processes and count session-local objects

Treat each PID and memory value in the snapshot as an exercise input, not a measurement from a live system.

Session

User/context

Process

PID

Working set

0

System

services.exe

560

150 MiB

0

System

AlphaSvc.exe

744

90 MiB

0

System

BrokerSvc.exe

1012

70 MiB

1

Alice

explorer.exe

2100

110 MiB

1

Alice

notes.exe

2240

240 MiB

3

Bob

explorer.exe

3400

115 MiB

3

Bob

notes.exe

3520

260 MiB

Checks: Session 0 has 3 processes and 150 + 90 + 70 = 310 MiB; Session 1 has 2 and 110 + 240 = 350 MiB; Session 3 has 2 and 115 + 260 = 375 MiB. Overall: 7 and 310 + 350 + 375 = 1,035 MiB.

Alice's and Bob's notes.exe each create an unprefixed NotesLock, producing two session-local objects. BrokerSvc.exe adds Global\SyncReady. Subject to permissions, 2 local + 1 global = 3 objects.

Revise identity with Threads & Process Creation MCQs (GATE OS). A PID alone does not reveal its session.

Connect, disconnect, log off and reboot change different state

  • At 09:00, boot creates Session 0: {0}.

  • At 09:02, Alice logs on in Session 1: {0, 1}.

  • At 09:05, Bob logs on remotely in Session 3: {0, 1, 3}.

  • At 09:10, Bob disconnects. Session 3 and its processes remain without an attached remote terminal.

  • At 09:15, Alice logs off. Her Session 1 processes end: {0, 3}.

A reconnect can attach to Bob's session. Persistence is policy-dependent. Alice's logoff leaves Session 0 services running here; reboot tears down the supplied state and starts boot again.

Removing Alice's processes subtracts 110 + 240 = 350 MiB, leaving 1,035 - 350 = 685 MiB. This table arithmetic does not predict real memory reclamation.

How exams can test core services and sessions

Typical questions match roles, separate service and thread states, trace I/O, find a critical path, map sessions, count objects, or apply lifecycle rules.

Repair six common traps:

  • SCM equals kernel scheduler: SCM controls services; the kernel schedules threads.

  • Session Manager equals user session: component versus boundary.

  • Every background process is a service: false.

  • Disconnect equals logoff: the session can remain.

  • One name means one system-wide object: per-session namespaces can create separate objects.

  • Session 0 UI reaches every user: services are isolated from interactive sessions.

In 30 seconds, classify nouns, add session IDs, draw dependencies, resolve local versus global names, and calculate only from the values in the question.

Short version and the next study step

Kernel-mode managers implement core mechanisms. The Service Control Manager maintains and controls Windows services. Session 0 contains services and system processes, while interactive users work in separate higher-numbered sessions with per-session state and namespaces. In the exercises, the aligned 16 KiB read uses four supplied 4 KiB pages, the fictional service graph finishes in 11 s, and the snapshot has 7 processes plus 3 named objects across Sessions 0, 1 and 3. Use GATE Guidance by Sanchit Sir for structured CS subject coverage, then redraw the dependency graph and session table from memory.