1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2026-04-19 18:16:26 +00:00

21 Commits

Author SHA1 Message Date
Radosław Kujawa d3bafd5892 Add Tiny OS example: scheduler with extended physical RAM
- examples/tinyos.c: host with 64K system RAM, 3x32KB task regions above 64K
  (bus_device_add_phys), MMU translate (virtual 32KB per task), console at
  , cooperative yield ( + JMP cd /home/rkujawa/repos/rk65c02 && git commit --trailer "Made-with: Cursor" -m "Add Tiny OS example: scheduler with extended physical RAM

- examples/tinyos.c: host with 64K system RAM, 3x32KB task regions above 64K
  (bus_device_add_phys), MMU translate (virtual 32KB per task), console at
  $DE00, cooperative yield ($FF00 + JMP $1000) and WAI + idle_wait + IRQ
  yield, vectors at $FFFC-$FFFF
- examples/tinyos_kernel.s: entry at $8000, IRQ handler at $8010 (JMP $1000)
- examples/tinyos_task.s: per-task loop printing task id, round-robin yield,
  optional WAI, STP after 3 runs
- Makefile: tinyos target, run-tinyos with timeout
- README.md, doc/MMU.md: document Tiny OS (64K virtual + expanded physical)
- .gitignore: /examples/tinyos"000) and WAI + idle_wait + IRQ
  yield, vectors at -
- examples/tinyos_kernel.s: entry at 000, IRQ handler at 010 (JMP cd /home/rkujawa/repos/rk65c02 && git commit --trailer "Made-with: Cursor" -m "Add Tiny OS example: scheduler with extended physical RAM

- examples/tinyos.c: host with 64K system RAM, 3x32KB task regions above 64K
  (bus_device_add_phys), MMU translate (virtual 32KB per task), console at
  $DE00, cooperative yield ($FF00 + JMP $1000) and WAI + idle_wait + IRQ
  yield, vectors at $FFFC-$FFFF
- examples/tinyos_kernel.s: entry at $8000, IRQ handler at $8010 (JMP $1000)
- examples/tinyos_task.s: per-task loop printing task id, round-robin yield,
  optional WAI, STP after 3 runs
- Makefile: tinyos target, run-tinyos with timeout
- README.md, doc/MMU.md: document Tiny OS (64K virtual + expanded physical)
- .gitignore: /examples/tinyos"000)
- examples/tinyos_task.s: per-task loop printing task id, round-robin yield,
  optional WAI, STP after 3 runs
- Makefile: tinyos target, run-tinyos with timeout
- README.md, doc/MMU.md: document Tiny OS (64K virtual + expanded physical)
- .gitignore: /examples/tinyos

Made-with: Cursor
2026-03-09 22:11:41 +01:00
Radosław Kujawa 981bcb0ec2 examples/msbasic: add Makefile, ld65 configs, and rk65c02 platform source (defines, extra, io, iscntc, loadsave)
Made-with: Cursor
2026-03-08 00:18:32 +01:00
Radosław Kujawa f7aa2d2826 examples/msbasic: add patches for rk65c02 platform (defines, extra, iscntc, loadsave, init, print)
Made-with: Cursor
2026-03-08 00:16:25 +01:00
Radosław Kujawa 016138ef79 Add MS BASIC example to main README and examples Makefile
Made-with: Cursor
2026-03-08 00:07:46 +01:00
Radosław Kujawa b93aa4ffdc examples/msbasic: fix README memory map and stub addresses, fix host run command
Made-with: Cursor
2026-03-08 00:07:06 +01:00
Radosław Kujawa bd59220c49 examples/msbasic: add host, map 32KB RAM from $0000
Made-with: Cursor
2026-03-07 23:57:20 +01:00
Radosław Kujawa f09bb28811 Build with or without GNU Lightning (optional JIT)
- Add jit_stub.c: no-op JIT API when HAVE_LIGHTNING is not set; rk65c02_run_jit
  runs interpreter loop so start() still works.
- src/Makefile: HAVE_LIGHTNING ?= 1; with 0 use jit_stub.o, no -llightning/-DHAVE_LIGHTNING.
- jit.c: remove #else branch from rk65c02_jit_enable (file only built with Lightning).
- examples/test Makefiles: LDFLAGS use $(if $(NO_LIGHTNING),,-llightning); test adds
  -DHAVE_LIGHTNING when not NO_LIGHTNING.
- test_mmu.c: register mmu_demand_page_jit only #ifdef HAVE_LIGHTNING.
- README: document building with or without JIT (HAVE_LIGHTNING=0, NO_LIGHTNING=1).

Made-with: Cursor
2026-03-07 16:26:44 +01:00
Radosław Kujawa a73ebc3024 examples: add interrupts, hello_serial, stepper, jit_bench, breakpoints
- interrupts: IRQ vector at $FFFE, vector device at $FFFC, idle_wait + assert_irq
- hello_serial: custom bus device at $DE00, guest writes host prints
- stepper: rk65c02_step(1) loop with regs and disassembly
- jit_bench: min3.rom interpreter vs JIT wall time
- breakpoints: debug_breakpoint_add at min3 entry, inspect then continue
- README: document new examples, run from examples/ or make run-<name>
- Makefile: EXAMPLES and run-* targets for all five

Made-with: Cursor
2026-03-07 15:16:18 +01:00
Radosław Kujawa 1b4e7fe598 MMU/JIT: extended bus, examples (mmu_mpu, mmu_pae), tests, doc
- src: bus extended phys API, MMU/JIT hooks, rk65c02 MMU/tick/stop APIs
- examples: mmu_mpu and mmu_pae, Makefile targets; idle_wait, mmu_cart,
  mmu_multitasking updates
- test: test_mmu, test_bus, test_debug, Makefile
- doc: jit-design.md

Made-with: Cursor
2026-03-07 13:49:52 +01:00
Radosław Kujawa 2cd7094f10 examples: fix comments, add PASS/Expected, improve docs
- min3.s: fix BPL comment (branch if B >= C)
- min3.c: document stack ABI in header
- host_control.c: add Expected in header, explicit PASS at exit
- mmu_cart.c: comment tick interval 0 (poll every opportunity)
- mul_8bit_to_8bits.c: note interpreter-only and stack ABI
- README: run mmu_mpu with timeout when testing
- doc/MMU.md: add build/run note, mmu_pae no .rom, mmu_mpu timeout

Made-with: Cursor
2026-03-07 13:48:53 +01:00
Radosław Kujawa ee826da6ec MMU: host-pluggable translation, TLB, JIT coherence, docs and examples
- Add MMU API: translate and fault callbacks, begin/mark/end_update, TLB
- Translation result: ok, paddr (32-bit), perms (R/W/X), fault_code, no_fill_tlb
- Internal TLB (transparent); no_fill_tlb for context-dependent mappings
- JIT: invalidate only code on changed pages; code-page refcount
- Fault: EMUERROR, mmu_last_fault_*; resume by re-run after mapping update
- doc/MMU.md: design goals, API reference, usage, guest contract, limits
- examples/mmu_cart: C64-style bank switch (host + guest asm)
- examples/mmu_multitasking: minimal task switch (host + guest asm)
- test_mmu: MMU tests; bench_mmu: ns/insn for MMU configs
- README: MMU feature and example links

Made-with: Cursor
2026-03-07 04:05:50 +01:00
Radosław Kujawa 8d532664a4 Add WAI idle-wait host integration and documentation.
Introduce an optional WAI-only host wait callback API with interpreter/JIT loop support, add regression tests and an idle_wait example, and align Doxygen docs to describe callback and IRQ wake semantics clearly.

Made-with: Cursor
2026-03-07 01:05:20 +01:00
Radosław Kujawa b980fdaae2 Add host-control callbacks and JIT-safe polling.
Expose stop/tick/request-stop APIs, keep host control active at JIT block boundaries, and document the control model with a fuller host example plus dependency-aware builds.

Made-with: Cursor
2026-03-06 19:58:55 +01:00
Radosław Kujawa 489a3c59a9 Add JIT. Fix bugs. 2026-03-06 18:40:31 +01:00
Radosław Kujawa 327d60932e Add an example of 8-bit multiplication. 2019-01-10 10:27:44 +01:00
Radosław Kujawa 184c23b399 Explicitly enable WDC65C02 mode in vasm. 2019-01-05 00:30:18 +01:00
Radosław Kujawa dfb3bd1fca Try to make this build on Linux, NetBSD and OS X.
Without actually using autoconf etc.
2018-06-25 13:19:35 +02:00
Radosław Kujawa ed4b2786b6 Simplify ROM loading by providing utility function. 2018-04-10 10:12:27 +02:00
Radosław Kujawa adef30da21 Load the example at 0xC000, stop the emulator after running. 2018-04-06 14:26:00 +02:00
Radosław Kujawa 5173d10a69 Add code to actually run the example. 2018-04-06 14:25:26 +02:00
Radosław Kujawa b44dcdc91a Add example routine finding min among 3 numbers. 2018-04-05 00:32:53 +02:00