From 1a7cc83707bd7ac5ccad0dc08443c0d9cd4a390a Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 16 May 2018 22:22:40 +0100 Subject: [PATCH] trs80: Add reboot support, remove now surplus timer ack, init irq mask properly --- Kernel/platform-trs80/trs80.s | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Kernel/platform-trs80/trs80.s b/Kernel/platform-trs80/trs80.s index 965ee89d..6b3c56d1 100644 --- a/Kernel/platform-trs80/trs80.s +++ b/Kernel/platform-trs80/trs80.s @@ -68,12 +68,25 @@ _platform_monitor: halt platform_interrupt_all: - in a,(0xef) ret +; +; We write the following into low memory +; out (0x84),a +; inc a +; out (0x9c),a +; .. then resets into ROM (see the technical reference manual) +; _platform_reboot: di - halt + ld hl,#0x84D3 ; out (0x84),a + ld (0),hl + ld hl,#0xD33C ; inc a, out ( + ld (2),hl + ld a,#0x9C ; 9c),a + ld (4),a + xor a + rst 0 ; ----------------------------------------------------------------------------- ; KERNEL MEMORY BANK (below 0xE800, only accessible when the kernel is mapped) @@ -83,6 +96,8 @@ _platform_reboot: _ctc6845: ; registers in order .db 99, 80, 85, 10, 25, 4, 24, 24, 0, 9, 101, 9, 0, 0, 0, 0 init_early: + ld a, #0x24 ; uart rx, timer + out (0xE0), a ld a, (_opreg) out (0x84), a ld a, (_modout) -- 2.34.1