mirror of
https://github.com/rkujawa/rk65c02.git
synced 2026-03-11 03:16:11 +00:00
- 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
21 lines
808 B
ArmAsm
21 lines
808 B
ArmAsm
; =============================================================================
|
||
; Tiny OS — Shared kernel (loaded at physical $8000, system RAM)
|
||
; =============================================================================
|
||
; Virtual $8000–$FFFF is identity-mapped (shared). Kernel sets initial task 0,
|
||
; then JMPs to task entry at $1000 (MMU maps to current task's physical region).
|
||
; IRQ handler at $8010: JMP $1000 so that after WAI the host-selected task runs.
|
||
; =============================================================================
|
||
|
||
.org 0x8000
|
||
|
||
kernel:
|
||
lda #0
|
||
sta 0xFF00 ; yield reg: request task 0
|
||
sta 0xFF01 ; current task id (host mirror)
|
||
jmp 0x1000 ; run task 0 at virtual $1000
|
||
|
||
.org 0x8010
|
||
|
||
irq_handler:
|
||
jmp 0x1000 ; switch to task in $FF00 (set by host in idle_wait)
|