From 1796f76c21f3336217ed15647622ed81aa4bc7db Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 3 Nov 2014 21:55:00 +0000 Subject: [PATCH] msx2: RAM fixup Apparently RAM is added in the reverse order to tht expected - 3 is at 0x000 2 is at 0x4000 etc. Add them properly then add 0 so that init picks up the initial 0xC000 bank for common and udata --- Kernel/platform-msx2/main.c | 6 ++++-- Kernel/platform-msx2/msx2.s | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Kernel/platform-msx2/main.c b/Kernel/platform-msx2/main.c index 57c2b4b2..424870f8 100644 --- a/Kernel/platform-msx2/main.c +++ b/Kernel/platform-msx2/main.c @@ -25,10 +25,12 @@ void do_beep(void) void pagemap_init(void) { int i = /*FIXME*/ 16; /* in 16K banks */ - /* Add all the RAM, except 0,1,2 , which is the kernel data/bss, add 3 + /* Add all the RAM, except 0,1,2,3 which is the kernel data/bss, add 0 last to become the common for init */ - while (i > 0) + while (i > 3) pagemap_add(i--); + /* Init will pick this up correctly as its common */ + pagemap_add(0); } void map_init(void) diff --git a/Kernel/platform-msx2/msx2.s b/Kernel/platform-msx2/msx2.s index 1609ecb7..99ab0b00 100644 --- a/Kernel/platform-msx2/msx2.s +++ b/Kernel/platform-msx2/msx2.s @@ -159,14 +159,13 @@ map_process: ; map_kernel: push af - xor a + ld a, #3 out (0xFC), a - inc a + dec a out (0xFD), a - inc a + dec a out (0xFE), a - inc a - out (0xFF), a + ; and 0xFF is managed by task switches pop af ret map_process_2: -- 2.34.1