# Introduction

---

# What Is Peios

_Peios / Introduction_

> The ideas that shape Peios, its security model, registry, event system, service manager, and browser desktop, and where to start reading.

Peios is an operating system. Its kernel is based on Linux, and adds its own
security model, configuration store, event system, layered storage, and
network packet policy. Above the kernel, Peios has its own service manager,
sign-in service, and system services, and a desktop that you use from a web
browser. A few ideas run through all of it, and knowing them makes the rest of
this documentation easier to follow.

## One security model for everything

Every decision about who can do what goes through one security model, built
into the kernel:

- Every account, group, and service has a
  [security identifier (SID)](/peios/using-peios/identity-and-access/security-identifiers.md)
  that never changes.
- Every running program acts with an
  [access token](/peios/using-peios/identity-and-access/access-tokens.md) that says who it
  is, which groups it belongs to, and which
  [privileges](/peios/using-peios/identity-and-access/privileges.md) it holds.
- Every protected object, whether a file, a registry key, a service, or a
  process, has a security descriptor that says who can do what to it.

When a program opens a file or changes a setting, the kernel compares the
program's token with the object's security descriptor. No account is exempt
from that check because of its number or name. An administrator has more
access because policy grants it, not because the check is skipped.

## Configuration lives in the registry

Almost all configuration lives in the
[registry](/peios/using-peios/registry/the-registry.md): a tree of keys holding typed
values, with a security descriptor on every key. Service definitions, network
profiles, sign-in policy, and desktop preferences are all registry values.

Configuration can come in layers. An installed role and a policy can each set
the same value, and the registry decides which one is in effect without
losing the other. Removing a layer restores what was there before.

## Every event takes one path

The kernel and every service report what they do through one event path.
eventd stores the events, logs, and metrics, and answers queries for them
according to who is asking. Each component documents the events it can emit,
and no component is allowed to emit a field that isn't documented. See
[Interpreting Events](/peios/using-peios/reading-records/interpreting-events.md).

## Services are defined and supervised

peinit starts the machine, starts each service in the order its dependencies
require, restarts services that fail, and shuts the machine down. Each
service is defined in the registry, and runs with an identity of its own. See
[Services and Jobs](/peios/using-peios/services-and-jobs/overview.md).

## A desktop in your browser

You can use Peios from a desktop in a web browser, at a local console, or
over SSH. The desktop's applications run on the Peios machine, with the
authority of the account you signed in with. See
[Signing In](/peios/signing-in/overview.md) and
[The Desktop](/peios/using-peios/desktop-basics/overview.md).

## Where to start

These pages are good places to begin:

- [How Peios Fits Together](/peios/introduction/how-peios-fits-together.md) for
  a map of the components and how a machine starts.
- [Preparing a PC](/peios/installing-peios/preparing-a-pc.md) to install Peios.
- [Finding Your Way](/peios/introduction/finding-your-way.md) to find the guide
  for a task.

---

# How Peios Fits Together

_Peios / Introduction_

> A map of Peios's components, from the kernel's own subsystems through boot, system services, and the desktop, the order in which a machine starts, and the kinds of documentation each part has.

A Peios machine is built from a small number of components, each with one
job. This page names them, shows the order in which they start, and says
where each is documented. When something goes wrong, the component that owns
the job is where to look.

## The kernel

The kernel manages the hardware and runs every program. Peios adds five
subsystems of its own to it:

| Subsystem | Job |
|---|---|
| Kernel Access Control Subsystem (KACS) | Access control: tokens, security descriptors, privileges, and every access decision |
| Layered Configuration Subsystem (LCS) | The registry: keys, values, layers, watches, and transactions |
| Kernel Mediated Event Subsystem (KMES) | Events: the single path every event takes, with trusted details about its sender |
| StrataFS | Layered storage: several directories, the strata that give it its name, presented as one directory tree |
| Network Traffic Filtering Engine (NTFE) | The network packet filter, which enforces network policy from the registry |

The subsystems rely on each other. The registry and the file systems use
KACS security descriptors, and KACS reports its access decisions through
KMES. The [Peios Kernel](/kernel.md) product documents all five.

## Starting the machine

A machine starts in this order:

1. **The firmware** loads one boot file that holds the kernel, a temporary
   file system loaded into memory, and the kernel's settings.
2. **Prelude** runs from that temporary file system. It prepares the
   devices, mounts the real disk, and hands over to peinit. See
   [Prelude](/peios/using-peios/boot/prelude.md).
3. **peinit**, the service manager, prepares the system, then starts the
   registry service, loregd, and the sign-in service, authd.
4. **peinit** then reads the service definitions from the registry and starts
   every service in dependency order. See
   [Boot and Boot Modes](/peios/using-peios/boot/boot-and-boot-modes.md).
5. **You sign in** at the console, over SSH, or from a browser, and authd
   creates the token your session runs with. See
   [Signing In](/peios/signing-in/overview.md).

If the machine can't finish starting, peinit starts it in a recovery mode
with a console for repairs.

## System services

These services run on every machine:

| Service | Job | Guide |
|---|---|---|
| peinit | Starts, supervises, and stops services and scheduled jobs | [Services and Jobs](/peios/using-peios/services-and-jobs/overview.md) |
| authd | Checks credentials and creates access tokens; its partner lpsd stores local accounts | [Local Accounts](/peios/using-peios/local-accounts/overview.md) |
| loregd | Stores the registry's data | [The Registry](/peios/using-peios/registry/the-registry.md) |
| eventd | Stores events, logs, and metrics and answers queries for them | [Reading Records](/peios/using-peios/reading-records/stored-records.md) |
| netd | Configures network interfaces, addresses, and routes | [Network Configuration](/peios/using-peios/network-configuration/configuring-profiles.md) |
| resolvd | Resolves names to addresses | [Diagnosing Name Resolution](/peios/using-peios/network-configuration/name-resolution.md) |
| timed | Keeps the clock correct and manages the time zone | [Keeping the Time](/peios/using-peios/time/overview.md) |
| trustd | Maintains the certificates the machine trusts | [The Trust Store](/peios/using-peios/certificate-trust/overview.md) |

## The desktop

Three programs make the desktop that you use from a browser. The Graphical
Extensible Web Interface (GXWI) serves the
session and handles sign-in from the browser, Fenestra arranges the windows,
and Fenesh provides the dock, launcher, and settings. A set of desktop
applications covers files, terminals, and system administration. See
[The Desktop](/peios/using-peios/desktop-basics/overview.md).

## Tools and development

The command-line utilities include the familiar file and text commands, and
tools for Peios's own features: `reg` for the registry, `sd` for security
descriptors, and `token` for identities. The installer installs Peios to a
disk and runs first-boot setup.

To build software for Peios, start with the
[Peios SDK](/peios/developing-for-peios/sdk-basics/what-is-the-peios-sdk.md).

## Kinds of documentation

Each kind of documentation answers a different question:

| Kind | Read it to find out |
|---|---|
| These Learn pages | How something works, and how to get a task done |
| Man pages, through `man` | Exactly what a command, file, or function does, with every option |
| Registry manuals, through `regman` | What a registry value means and which values are valid |
| Event manuals, through `evman` | What an event or one of its fields means |
| Technical reference manuals | How one component works inside |
| [Specifications](/specifications.md) | The contracts that independent programs must agree on |

A command's `--help` output is a short reminder of its man page.

---

# Finding Your Way

_Peios / Introduction_

> Which guide to open for installing Peios, signing in, everyday desktop work, and each administration task, and which reference owns each kind of fact.

Each task on a Peios machine belongs to the component that owns it, and each
component documents its own tasks. This page sends you to the right guide.
Before you change authentication, the network, or the service that provides
your session, keep a second way in: a console, or another signed-in session.
That way a mistake can't lock you out.

## Installing and first use

To install Peios, prepare a boot medium with
[Preparing a PC](/peios/installing-peios/preparing-a-pc.md), then follow
[Installing to Disk](/peios/installing-peios/installing-to-disk.md). Installing
erases the disk you choose, so identify it and save anything you need first.

On a machine with first-boot setup,
[Completing Setup](/peios/first-boot/completing-setup.md) sets the machine's name
and creates the first administrator. Then continue with
[Signing In](/peios/signing-in/overview.md). In a browser, check the machine's
certificate before you enter your password.

## Everyday work

The [desktop applications](/peios/using-peios/everyday-apps/essential-apps.md) cover files,
text editing, terminals, and system tools.
[Desktop Settings](/peios/using-peios/desktop-settings/overview.md) changes your desktop's
appearance and preferences. A tool can't give you permission you don't have:
it acts with your access token, and a machine-wide change affects every user.

## Accounts and security

| Task | Guide |
|---|---|
| Create an account or change membership | [Local Accounts](/peios/using-peios/local-accounts/overview.md) or [Managing Accounts in Principals Manager](/peios/using-peios/local-accounts/managing-local-accounts.md) |
| Change your own password, keys, or display name | [Changing Your Account Settings](/peios/using-peios/local-accounts/my-settings.md) or [Changing Your Password](/peios/using-peios/local-accounts/passwd.md) |
| Change the privileges and integrity level that sign-ins receive | [Granting Access](/peios/using-peios/authentication/granting-access.md) |
| Find out why access was refused | [Diagnosing an Access Refusal](/peios/using-peios/identity-and-access/diagnosing-access.md) |
| Trust or distrust a certificate | [The Trust Store](/peios/using-peios/certificate-trust/overview.md) |

Changing an account doesn't change the tokens of programs already running.
Test a fresh sign-in before you close the session you made the change from.

## Software and services

| Task | Guide |
|---|---|
| Install, remove, or upgrade software | [Managing Packages](/peios/using-peios/packages/package-manager.md) and [Upgrading Peios from the Desktop](/peios/using-peios/packages/upgrade-peios.md) |
| Turn a feature on or off | [Managing Features in Feature Manager](/peios/using-peios/features/feature-manager.md) or [from the command line](/peios/using-peios/features/managing-features.md) |
| Start, stop, or inspect a service | [Controlling Services](/peios/using-peios/services-and-jobs/controlling-services.md) |
| Read a service's output | [Finding Service Logs](/peios/using-peios/services-and-jobs/output-and-logging.md) |
| See what is running and what it uses | [Inspecting Tasks and Sessions](/peios/using-peios/processes/task-manager.md) |
| Shut down or reboot | [Shutting Down and Rebooting](/peios/using-peios/boot/shutdown.md) |

Installing a package and setting up its feature are separate steps. Remove a
feature while the package that supplies its cleanup is still installed.

## Network, time, and storage

| Task | Guide |
|---|---|
| Configure a network connection | [Configuring Profiles](/peios/using-peios/network-configuration/configuring-profiles.md) or [Changing Network Settings in Network Manager](/peios/using-peios/network-configuration/changing-network-settings.md) |
| Diagnose a connection | [Checking Connectivity](/peios/using-peios/network-configuration/checking-connectivity.md) |
| Set the clock or the time zone | [Keeping the Time](/peios/using-peios/time/overview.md) |
| Inspect disks and file systems | [Disk Manager](/peios/using-peios/files-and-volumes/disk-manager.md) and [Filesystem Layout](/peios/using-peios/files-and-volumes/filesystem-layout.md) |

When you change a network connection remotely, use a method that rolls the
change back if you lose contact. Disk Manager inspects storage but doesn't
change it.

## Configuration

Most settings live in the [registry](/peios/using-peios/registry/the-registry.md). Before you
change a setting, read its manual with [`regman`](/peios/using-peios/registry/regman.md): it
gives the type, valid values, and when a change takes effect. Then change it
with [`reg`](/peios/using-peios/registry/reg.md) or [Registry Editor](/peios/using-peios/registry/registry-editor.md),
and check that the component using the setting picked it up.

## Reference

Learn explains and links. The facts themselves live in reference forms that
ship with the system:

- **Commands, files, and functions:** the man pages, read with `man`.
- **Registry settings:** the registry manuals, read with `regman`.
- **Events:** the event manuals, read with
  [`evman`](/peios/using-peios/reading-records/evman.md).
- **How a component works inside:** its technical reference manual, under
  [Reference](/peios/reference.md).

If something fails, start with
[Troubleshooting a Problem](/peios/introduction/troubleshoot-a-problem.md) before
you repeat a change or restart a service.

---

# Troubleshooting a Problem

_Peios / Introduction_

> Preserve the failure, inspect the responsible component, and verify one correction at a time.

Investigate the failed operation before changing the machine. A restart can
remove useful state, and retrying a request can repeat a change whose reply
was lost.

## Before you start

Keep the exact error, time, affected account, and resource name. Preserve a
working console or administrator session if the problem affects remote
access. Save unsaved work before an action that can end a session.

## Investigate and verify

1. Identify which component performs the operation. Use the symptom guide
   below to inspect its state and relevant records.
2. Distinguish a rejected request from an unavailable service or a lost
   reply. Read back inspectable state before repeating a mutation.
3. Record the proposed correction and existing value. Change one cause at
   a time through the component's documented interface.
4. Repeat the original operation and inspect the resulting state. Keep the
   initial evidence and the outcome of the correction.

## Browser access or sign-in

Check the address and port in [Signing in from a
Browser](/peios/signing-in/open-the-desktop.md). A listener
bound only to loopback is not reachable from another machine. For a
certificate warning, follow [The Machine's
Certificate](/peios/signing-in/the-certificate.md); do not enter
credentials when the fingerprint differs from a trusted observation.

At a reachable console, inspect `net status` and the `gxwid` service. During
installation and first boot, an address, overlay, or reboot can change what
the browser reaches. Return to that workflow's guide.

For a credential refusal, use [Diagnosing
Authentication](/peios/using-peios/authentication/diagnosing.md). A wrong
credential and an unknown account share an authentication failure response;
the response alone does not prove the account is absent. Authority and source
[events](/peios/using-peios/authentication/audit-events.md) answer different
parts of the decision.

## Services and network state

[Service Troubleshooting](/peios/using-peios/services-and-jobs/troubleshooting.md) covers
identity, dependencies, configuration, and repeated exits. A process existing
is not proof that it is ready. In Services Manager, **Logs…** opens the
relevant Event Viewer filter; widen the time range when the failure is older.

Use [Network Manager](/peios/using-peios/network-configuration/network-manager.md) or `net status`
to distinguish these cases:

- An unmanaged interface needs its profile-selection rules checked.
- A rejected configuration can leave the last complete configuration active.
- A local address does not prove there is a route beyond the local network.
- Working addresses with failing names need [resolver
  diagnosis](/peios/using-peios/network-configuration/name-resolution.md).

Displays labeled **Example data** are not measurements of live traffic.
For clock problems, inspect [time sources and clock
state](/peios/using-peios/time/overview.md) before changing the time or time zone.

## Storage and interrupted changes

Keep the failing path and exact error. [`df`](/peios/using-peios/files-and-paths/space-and-raw-copies.md)
and [`du`](/peios/using-peios/files-and-paths/space-and-raw-copies.md) answer different questions about
filesystem capacity and reachable directory contents. Permission failures or
incomplete scans do not establish that deletion is the appropriate remedy.

For interrupted package, upgrade, or feature work, inspect that tool's
recorded state and recovery instructions. Feature cleanup and package
transaction recovery are separate operations. Repeating the original action
without checking its state can make diagnosis harder.

## Denied access or missing records

Inspect the operation's required access, the caller's token, and the target's
security descriptor before widening permissions. The task guide identifies
the needed access; the permissions editor does not grant extra authority.

An empty event query does not prove that nothing happened. Check the time
range, filters, read policy, retention, and collection failures. [Event
Viewer](/peios/using-peios/reading-records/event-viewer.md) explains its access notices;
[Saving Event Evidence](/peios/using-peios/reading-records/saving-evidence.md) covers a
capture for later investigation.
