Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

186 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dioptase OS

Operating system for the Dioptase system

Makefile usage

The Makefile in Dioptase-OS/ builds a test program from a C file under tests/ links it with kernel sources to produce kernel-mode bin/hex outputs in build/.

Requirements

These tools are expected to be built already (default VERSION=release):

  • ../Dioptase-Languages/Dioptase-C-Compiler/build/$(VERSION)/bcc
  • ../Dioptase-Assembler/build/$(VERSION)/basm
  • ../Dioptase-Emulators/Dioptase-Emulator-Full/target/$(VERSION)/Dioptase-Emulator-Full

Targets

  • make bios.hex builds the BIOS image at build/bios.hex.
  • make all builds the fixed kernel image and every program with a root/*/Makefile, placing guest executables under root/sbin/.
  • make bios.labels writes label lines (#...) from build/bios.hex to build/bios.labels.
  • make <test>.bin compiles Dioptase-OS/tests/<test>.c, compiles all kernel/*.c, assembles them along with any kernel/*.s, and writes build/<test>.bin.
  • make <test>.hex writes the kernel hex image to build/<test>.hex.
  • make <test>.labels writes label lines (#...) from build/<test>.hex to build/<test>.labels.
  • make <test> builds build/bios.hex + build/<test>.bin and runs the full emulator.
  • If tests/<test>.dir exists, make <test> also writes the final SD1 image to build/<test>.sd1.out.ext2 and attempts to extract it into tests/<test>.out.dir.
  • make <test>.test runs the emulator TEST_RUNS times, writes tests/<test>.raw, filters lines starting with *** into tests/<test>.out, compares to tests/<test>.ok, and prints successes/runs. A run fails on timeout, non-zero exit, or if tests/<test>.raw contains Warning or Spurious or PANIC.
  • make <test>.fail is the same as .test but stops on the first failure.
  • make test runs every test that has a checked-in tests/<test>.ok or tests/<test>.panic baseline through the quiet .summary-test path.
  • make ext runs the ext2-related baseline-checked subset: ext_read, ext_new_file, ext_write, ext_rename, and ext_delete.
  • make threads runs every baseline-checked threads_* test.
  • make datastructs runs the baseline-checked utility tests: hashmap_test, queue_test, and string.
  • make heap runs the baseline-checked heap_* allocator tests. Heap panic-mode negative checks run only when HEAP_DEBUG=yes.
  • make clean removes build outputs and temporary assembly outputs.

Configuration

  • VERSION (default release) selects the toolchain and emulator build.
  • NUM_CORES controls how many emulator cores to run.
  • TEST_RUNS controls the number of test iterations.
  • SCHEDULER controls the emulators scheduling for multicore runs. Options are free, random, and rr (round robin)
  • TIMEOUT_SECONDS controls the per-run timeout for .test/.fail.
  • HEAP_DEBUG=yes passes -DHEAP_DEBUG=1 to kernel/test C builds and enables heap bitmap/poison diagnostics. make test and make heap skip the heap_*.panic negative tests when this is not yes.
  • BLOCK_SIZE controls the ext2 block size used for tests with tests/<test>.dir.
  • The aggregate targets make test, make ext, make threads, make datastructs, and make heap all honor TEST_RUNS, TIMEOUT_SECONDS, BLOCK_SIZE, NUM_CORES, SCHEDULER, EMU_VGA, EMU_AUDIO, EMU_AUDIO_FAST, and TRACE_INTS.
  • EMU_FLAGS can include --trace-ints if you want information printed about each interrupt.
  • EMU_VGA=yes appends --vga to the emulator flags and assembles kernel/config.s and bios/config.s with -DUSE_VGA=1. Otherwise those files are assembled with -DUSE_VGA=0.
  • EMU_AUDIO=yes appends --audio to the emulator flags and assembles kernel/config.s and bios/config.s with -DUSE_AUDIO=1. Otherwise those files are assembled with -DUSE_AUDIO=0. If the cached emulator binary predates audio CLI support, the harness rebuilds it before running.
  • EMU_AUDIO_FAST=yes appends --audio-fast instead of --audio and also assembles kernel/config.s and bios/config.s with -DUSE_AUDIO=1. This mode is for host listening only; it intentionally changes guest-visible audio timing so playback stays close to wall clock even when emulation is slow.

Notes

  • Generated assembly files are named *.s and kept after assembly.
  • Kernel C assembly outputs live under build/kernel/ to keep them separate from the root test's assembly file.
  • The aggregate test targets only include tests with checked-in .ok or .panic baselines, just like make test.
  • superblock is left as an explicit one-off target instead of part of make ext because its checked-in baseline depends on the ext2 image geometry.
  • Tests with tests/<test>.dir use that directory to build an ext2 image for SD1; the harness tries to extract the final SD1 contents into tests/<test>.out.dir after emulator runs so filesystem side effects can be inspected on the host.
  • The makefile also compiles the BIOS. The emulator is run with the BIOS in ram and the kernel on the sd card, the bios loads the kernel and then jumps to it
  • The makefile was generated by Codex, and I occasionally use Codex to generate comments/documentation
  • The heap, threads, semaphores, and ref counting are ports of Gheith's kernel

About

Operating system for the Dioptase processor

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages