ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Referência de fonte: SYS/DRV/FORMAT.CC

Referência de fonte: SYS/DRV/FORMAT.CC

Registro determinístico da fonte. O conteúdo completo do arquivo é reproduzido abaixo; esta página não substitui a interpretação arquitetural dos capítulos autorais.

Identidade do arquivo

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

Dependências sintáticas detectadas

Linha Include
— Nenhum include de preprocessor detectado.

Símbolos detectados

Linha Símbolo
1 yes_arg
21 main

Fonte completa

O bloco seguinte é o arquivo textual integral na revisão indicada. Não há elisão, abreviação ou paráfrase.

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);
  }
}

Papel deste registro

O atlas garante rastreabilidade arquivo-a-arquivo. Responsabilidade, invariantes, ownership, concorrência, segurança, desempenho e interação entre subsistemas pertencem aos capítulos autorais e devem citar este arquivo quando aplicável.

Registro do documento ID: source-59e4d01cfe7022cb Reviewed source: da3df29cb397 Class: generated-source-reference