PROPHET/OS

NAME

slot: the system lies twice, as slot A and slot B, and one record says which of the two the start takes

SYNOPSIS

slot [show|switch a|b|confirm|back]

DESCRIPTION

The system lies twice, as slot A and slot B, and one record says which of the two the start takes.

An update writes the slot that is not running, so nothing of the running system is touched while it is written. slot switch b then points the start at B, and B goes **on trial**: the loader spends one of three tries per start, and when they are gone it takes A again, for good. A machine that never comes up far enough to say anything therefore comes back on its own.

slot confirm ends the trial. It refuses while the machine has not reached a runlevel, while the starter does not answer, and while any vigil of this level is not up: a system that confirms itself before its vigils are up confirms nothing.

slot back goes to the other slot at once and without a trial, because that slot is the one that was running before.

The record lies in two sectors of the system partition, one copy each, with a sequence number over both. Read takes the valid copy with the higher number, written is always the other one. So a power cut in the middle of a write costs the copy nobody was believing, and the next start reads the older of the two and starts.

EXAMPLE

$ slot
  drive       3
  slot        A, confirmed
  sequence    1, in copy A
  way back    A

SEE ALSO

kernel swap, vigils, disks, mount