From: Alan Cox Date: Wed, 5 Nov 2014 00:08:32 +0000 (+0000) Subject: msx2: initial bootstrap debugging X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=fc696b9c8669713683243200b3c41e9f96a4aea2;p=FUZIX.git msx2: initial bootstrap debugging We get as far as enabling interrupts then curl up and die. The VDP programming also doesn't set text80 but does produce some interesting flashing blobs --- diff --git a/Kernel/platform-msx2/crt0.s b/Kernel/platform-msx2/crt0.s index dbab60fc..14bd2a2b 100644 --- a/Kernel/platform-msx2/crt0.s +++ b/Kernel/platform-msx2/crt0.s @@ -30,13 +30,21 @@ .globl s__INITIALIZER .globl kstack_top - ; startup code @0 + ; Just for the benefit of the map file + .globl start + + ; startup code @0x100 .area _CODE ; ; Execution begins with us correctly mapped and at 0x0x100 ; start: di + ; Debug port + ld a, #0x23 + out (0x2e), a + ld a, #'@' + out (0x2f), a ld sp, #kstack_top ; move the common memory where it belongs ld hl, #s__INITIALIZER diff --git a/Kernel/platform-msx2/msx2.s b/Kernel/platform-msx2/msx2.s index 6a94bdcb..608e8562 100644 --- a/Kernel/platform-msx2/msx2.s +++ b/Kernel/platform-msx2/msx2.s @@ -44,6 +44,11 @@ .globl _vdpport .globl _infobits + ; + ; vdp - we must initialize this bit early for the vt + ; + .globl vdpinit + .include "kernel.def" .include "../kernel.def" @@ -79,15 +84,17 @@ _trap_reboot: .area _CODE init_early: - ld a, #0x33 ; multibyte/ascii - out (0x2E), a + ld a, #'F' + out (0x2F), a ret init_hardware: + ld a, #'U' + out (0x2F), a ; save the useful bits of low memory first ld hl, (0x2B) ld (_infobits), a - ld a, (0x06) + ld a, (0x07) ld (_vdpport), a ; Size RAM @@ -100,8 +107,17 @@ init_hardware: call _program_vectors pop hl + ld a, #'Z' + out (0x2F), a + im 1 ; set CPU interrupt mode call _vtinit ; init the console video + + ld a, #'I' + out (0x2F), a + call vdpinit + ld a, #'X' + out (0x2F), a ret @@ -133,7 +149,6 @@ ramscan: ramwrapped: ld a, #3 out (c), a - ld a, (hl) ld (hl), #0x55 out (c), b ld a, (hl) @@ -169,7 +184,7 @@ pageslt256: ; set system RAM size in KB ld (_ramsize), hl - ld de, #0xFFC0 + ld de, #0xFFD0 add hl, de ; subtract 48K for the kernel ld (_procmem), hl ret diff --git a/Kernel/platform-msx2/vdp.s b/Kernel/platform-msx2/vdp.s index 77bac44c..d6aad926 100644 --- a/Kernel/platform-msx2/vdp.s +++ b/Kernel/platform-msx2/vdp.s @@ -15,17 +15,21 @@ .globl _vdpport + .globl vdpinit + .area _CODE ; ; Register write value E to register A ; vdpout: ld bc, (_vdpport) - out (c), e - out (c), d + ld bc, #0x98 ; hardcode for the moment + inc c ; Write port + out (c), e ; Write the data + out (c), d ; and then the register | 0x80 ret ; -; FIXME: table.. and move into init ROM +; FIXME: table.. and move into init RAM ; vdpinit: ld de, #0x8004 ; M4 } call vdpout ; } 80x25 mode