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

Source reference: SYS/DRV/MKSTICK.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/MKSTICK.CC
Lines 25
Bytes 514
SHA-256 b871304b373bf535bd815bf2bc2fa341cd388a85c71e8cbb17301b3eeceaf7bd
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
1 main

Complete source

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

void main() {
  int sec;
  int buf;
  viewport(300, 80);
  text(8, 8, "usb stick", 0x00FFFFFF);
  sec = disk_sectors();
  buf = malloc(512);
  if (buf == 0) {
    text(8, 28, "no mem", 0x00FF8080);
  } else {
    storeb(buf + 510, 0x55);
    storeb(buf + 511, 0xAA);
    storeb(buf + 446, 0x80);
    storeb(buf + 450, 0x83);
    text(8, 28, "mbr built", 0x00A0FFA0);
    text(8, 48, "lba0 locked", 0x00FFC080);
  }
  if (sec == 0) {
    text(160, 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-b871304b373bf535 Reviewed source: da3df29cb397 Class: generated-source-reference