Commit Graph

9 Commits

Author SHA1 Message Date
c907d45763 Add write-after-cycles, reset handling 2026-04-16 15:37:32 +03:00
b5a4fdf755 update proto, add config update publish broadcast, add messages compacting 2026-04-10 22:25:32 +03:00
d8804c9ae2 Generate README.md, add clock dividers and limiters, load configs from WS client, fix stream per-segment subscriptions according to memory projections mechanism 2026-04-05 17:15:04 +03:00
71ec472510 fix: code quality improvements across C codebase
- Replace sprintf with snprintf (1024-byte errbuf) in hmmmm.c, base_device.c,
  compose_device.c, config.c
- Fix WRITE_MEM macro: use smartAddrWriteHandlers for write ident (was
  incorrectly reading from smartAddrReadHandlers)
- Replace alloca with malloc+free in dispatchMemAccessNotifications
- Guard closeBaseDevice against NULL lib/partial initialization
- Simplify intercept context storage to single contiguous allocation
- Add NULL checks after calloc in config handler with proper cleanup
- Guard find_device_by_id against zero-length path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 22:18:23 +00:00
eb7f4b7eb0 feat: add projection and intercept support, remove TOML, fix freeDevMem symbol bug
- Remove TOML dependency from Makefile and compose_device.c
- Implement projection support in config handler: remap device memory
  segments between devices via cells[] pointer reassignment
- Implement intercept support: shadow_copy (write to both devices) and
  shadow_replace (redirect read/write to another device) modes using
  smartAddr handler infrastructure
- Fix critical bug in hmmmm.c: freeDevMem was loaded from "freeDevSpecs"
  symbol instead of "freeDevMem", causing segfault on config reload
- Add intercept context lifecycle management to EmulContext

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 16:28:49 +00:00
589bc8d620 feat: migrate config management from TOML to FlatBuffers
Config is now loaded at runtime via WebSocket (ConfigCtrlMessage)
instead of from hardcoded TOML files. The emulator starts with no
devices and waits for clients to send configuration.

- Define FlatBuffers schemas: EmulationConfig, ComposeDeviceConfig,
  BaseDeviceConfig with recursive DeviceConfig union
- Rename MemSegment.start → addr (flatcc builder/reader name collision)
- Add ConfigCtrlMessage handler: validates STILL state, walks the
  device tree depth-first, assigns numeric IDs, responds with
  DeviceIdMappingNotif or ConfigLoadError
- Add fb_build_config_device_id_mapping() and fb_build_config_error()
  FlatBuffer builders
- Remove hardcoded device loading from main.c; iterate dynamically
  loaded devices in the exec loop
- Fix double-free: freeConf() already frees the struct itself, remove
  redundant free() calls in config.c and base_device.c
- Fix heap-buffer-overflow in device parseSpecsFromConfig: malloc
  for segment name was missing +1 for the null terminator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 14:02:41 +00:00
d83cb7fe7b flatbuffer base 2026-03-30 16:20:14 +03:00
aaa858b903 ws server +proto 2026-02-11 12:18:59 +03:00
2ff6b1a454 Initial commit 2025-01-21 22:03:23 +03:00