ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: SYS/DRV/FORMAT.CC

Source reference: SYS/DRV/FORMAT.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path SYS/DRV/FORMAT.CC
Lines 44
Bytes 704
SHA-256 59e4d01cfe7022cbb173a5484709f5f22523f7efdf2939c961ceb14d8132a58f
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
1 yes_arg
21 main

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

int yes_arg() {
  int buf;
  int n;
  buf = malloc(16);
  n = app_arg(buf);
  if (n < 1) {
    return 0;
  }
  if (loadb(buf) != 89) {
    return 0;
  }
  if (loadb(buf + 1) != 69) {
    return 0;
  }
  if (loadb(buf + 2) != 83) {
    return 0;
  }
  return 1;
}

void main() {
  int sec;
  int rc;
  viewport(280, 64);
  sec = disk_sectors();
  text(8, 8, "format", 0x00FFFFFF);
  if (yes_arg() == 0) {
    text(8, 28, "arg YES", 0x00FFC080);
  } else {
    rc = disk_format();
    if (rc == 0) {
      text(8, 28, "cfs ok", 0x00A0FFA0);
    } else {
      text(8, 28, "cfs fail", 0x00FF8080);
    }
  }
  if (sec == 0) {
    text(120, 28, "no disk", 0x00FF8080);
  }
  while (1) {
    wait(200);
  }
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-59e4d01cfe7022cb Reviewed source: da3df29cb397 Class: generated-source-reference