From 0929cedbfd3f71dc2053ef1c7b64edb909074cd3 Mon Sep 17 00:00:00 2001 From: Will Sowerbutts Date: Tue, 3 Feb 2015 00:28:22 +0000 Subject: [PATCH] Kernel: p112, n8vem-mark4: Push the base of common memory up to F800 When the kernel is mapped in, the memory at F000-F800 now belongs to the current process. --- Kernel/cpu-z180/z180.s | 4 ++-- Kernel/platform-n8vem-mark4/commonmem.s | 6 ------ Kernel/platform-n8vem-mark4/config.h | 14 +++----------- Kernel/platform-n8vem-mark4/fuzix.lnk | 2 +- Kernel/platform-n8vem-mark4/kernel.def | 2 +- Kernel/platform-n8vem-mark4/mark4.s | 2 +- Kernel/platform-p112/commonmem.s | 6 ------ Kernel/platform-p112/config.h | 14 +++----------- Kernel/platform-p112/fuzix.lnk | 2 +- Kernel/platform-p112/kernel.def | 2 +- Kernel/platform-p112/p112.s | 2 +- 11 files changed, 14 insertions(+), 42 deletions(-) diff --git a/Kernel/cpu-z180/z180.s b/Kernel/cpu-z180/z180.s index f23812c9..edee00d2 100644 --- a/Kernel/cpu-z180/z180.s +++ b/Kernel/cpu-z180/z180.s @@ -189,7 +189,7 @@ z180_init_hardware: ret ; ----------------------------------------------------------------------------- -; KERNEL MEMORY BANK (below 0xC000, only accessible when the kernel is mapped) +; KERNEL MEMORY BANK (only accessible when the kernel is mapped) ; ----------------------------------------------------------------------------- .area _CODE @@ -543,7 +543,7 @@ _dofork: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ----------------------------------------------------------------------------- -; COMMON MEMORY BANK (0xF000 upwards) +; COMMON MEMORY BANK ; ----------------------------------------------------------------------------- .area _COMMONMEM diff --git a/Kernel/platform-n8vem-mark4/commonmem.s b/Kernel/platform-n8vem-mark4/commonmem.s index 522503a8..cd68577e 100644 --- a/Kernel/platform-n8vem-mark4/commonmem.s +++ b/Kernel/platform-n8vem-mark4/commonmem.s @@ -1,9 +1,3 @@ -; -; Common on z80pack is at 0xF000 as defined by hardware. -; - .module commonmem - .area _COMMONMEM - .include "../cpu-z80/std-commonmem.s" diff --git a/Kernel/platform-n8vem-mark4/config.h b/Kernel/platform-n8vem-mark4/config.h index 351b96c5..43f605d9 100644 --- a/Kernel/platform-n8vem-mark4/config.h +++ b/Kernel/platform-n8vem-mark4/config.h @@ -10,13 +10,13 @@ #undef CONFIG_SINGLETASK /* CP/M emulation */ #undef CONFIG_CPM_EMU -/* Fixed banking */ +/* Fixed banking: 8 x 64K banks, top 4KB is shared with kernel, 60KB-62KB is user memory */ #define CONFIG_BANK_FIXED /* Permit large I/O requests to bypass cache and go direct to userspace */ #define CONFIG_LARGE_IO_DIRECT /* 8 60K banks, 1 is kernel */ #define MAX_MAPS 8 -#define MAP_SIZE 0xF000U +#define MAP_SIZE PROGTOP /* WRS: I feel this should be 60KB, but setting it so breaks pagemap_realloc() when exec calls it */ /* Banks as reported to user space */ #define CONFIG_BANKS 1 @@ -24,21 +24,13 @@ #define TICKSPERSEC 40U /* Ticks per second */ #define PROGBASE 0x0000 /* also data base */ #define PROGLOAD 0x0100 /* also data base */ -#define PROGTOP 0xF000 /* Top of program, base of U_DATA copy */ +#define PROGTOP 0xF800 /* Top of program, base of U_DATA copy */ #define PROC_SIZE 64 /* Memory needed per process */ -/* WRS: this is probably wrong -- we want to swap the full 64K minus the common code */ -/* For now let's just use something and fix this up later when we have a swap device */ -#define SWAP_SIZE 0x7F /* 63.5K in blocks (which is the wrong number) */ -#define SWAPBASE 0x0000 /* start at the base of user mem */ -#define SWAPTOP 0xFF00 /* can we stop at the top? not sure how. let's stop short. */ -#define MAX_SWAPS 10 /* Well, that depends really, hmmmmmm. Pick a number, any number. */ - /* We need a tidier way to do this from the loader */ #define CMDLINE (0x0081) /* Location of root dev name */ #define BOOTDEVICENAMES "hd#" -//#define SWAPDEV (256 + 1) /* Device for swapping. (z80pack drive J) */ #define NBUFS 10 /* Number of block buffers */ #define NMOUNTS 4 /* Number of mounts at a time */ diff --git a/Kernel/platform-n8vem-mark4/fuzix.lnk b/Kernel/platform-n8vem-mark4/fuzix.lnk index 9efea4e3..477f2557 100644 --- a/Kernel/platform-n8vem-mark4/fuzix.lnk +++ b/Kernel/platform-n8vem-mark4/fuzix.lnk @@ -1,7 +1,7 @@ -mwxuy -i fuzix.ihx -b _CODE=0x0088 --b _COMMONMEM=0xF000 +-b _COMMONMEM=0xF800 -b _DISCARD=0xE000 -l z180 platform-n8vem-mark4/crt0.rel diff --git a/Kernel/platform-n8vem-mark4/kernel.def b/Kernel/platform-n8vem-mark4/kernel.def index 634dbfeb..7596dced 100644 --- a/Kernel/platform-n8vem-mark4/kernel.def +++ b/Kernel/platform-n8vem-mark4/kernel.def @@ -1,6 +1,6 @@ ; UZI mnemonics for memory addresses etc -U_DATA .equ 0xF000 ; (this is struct u_data from kernel.h) +U_DATA .equ 0xF800 ; (this is struct u_data from kernel.h) U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes. Z80_TYPE .equ 2 diff --git a/Kernel/platform-n8vem-mark4/mark4.s b/Kernel/platform-n8vem-mark4/mark4.s index 7043e8dc..8fe12a14 100644 --- a/Kernel/platform-n8vem-mark4/mark4.s +++ b/Kernel/platform-n8vem-mark4/mark4.s @@ -55,7 +55,7 @@ init_hardware: jp z180_init_hardware ; ----------------------------------------------------------------------------- -; COMMON MEMORY BANK (0xF000 upwards) +; COMMON MEMORY BANK ; ----------------------------------------------------------------------------- .area _COMMONMEM diff --git a/Kernel/platform-p112/commonmem.s b/Kernel/platform-p112/commonmem.s index 522503a8..cd68577e 100644 --- a/Kernel/platform-p112/commonmem.s +++ b/Kernel/platform-p112/commonmem.s @@ -1,9 +1,3 @@ -; -; Common on z80pack is at 0xF000 as defined by hardware. -; - .module commonmem - .area _COMMONMEM - .include "../cpu-z80/std-commonmem.s" diff --git a/Kernel/platform-p112/config.h b/Kernel/platform-p112/config.h index 80ba5c69..c8afad4e 100644 --- a/Kernel/platform-p112/config.h +++ b/Kernel/platform-p112/config.h @@ -10,13 +10,13 @@ #undef CONFIG_SINGLETASK /* CP/M emulation */ #undef CONFIG_CPM_EMU -/* Fixed banking */ +/* Fixed banking: 8 x 64K banks, top 4KB is shared with kernel */ #define CONFIG_BANK_FIXED /* Permit large I/O requests to bypass cache and go direct to userspace */ #define CONFIG_LARGE_IO_DIRECT /* 8 60K banks, 1 is kernel */ #define MAX_MAPS 16 -#define MAP_SIZE 0xF000U +#define MAP_SIZE PROGTOP /* 0xF000 breaks pagemap_realloc() / exec() */ /* Banks as reported to user space */ #define CONFIG_BANKS 1 @@ -24,16 +24,9 @@ #define TICKSPERSEC 40U /* Ticks per second */ #define PROGBASE 0x0000 /* also data base */ #define PROGLOAD 0x0100 /* also data base */ -#define PROGTOP 0xF000 /* Top of program, base of U_DATA copy */ +#define PROGTOP 0xF800 /* Top of program, base of U_DATA copy */ #define PROC_SIZE 64 /* Memory needed per process */ -/* WRS: this is probably wrong -- we want to swap the full 64K minus the common code */ -/* For now let's just use something and fix this up later when we have a swap device */ -#define SWAP_SIZE 0x7F /* 63.5K in blocks (which is the wrong number) */ -#define SWAPBASE 0x0000 /* start at the base of user mem */ -#define SWAPTOP 0xFF00 /* can we stop at the top? not sure how. let's stop short. */ -#define MAX_SWAPS 10 /* Well, that depends really, hmmmmmm. Pick a number, any number. */ - #define BOOT_TTY (512 + 1)/* Set this to default device for stdio, stderr */ /* In this case, the default is the first TTY device */ @@ -45,7 +38,6 @@ #define NUM_DEV_TTY 4 #define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */ -//#define SWAPDEV (256 + 1) /* Device for swapping. (z80pack drive J) */ #define NBUFS 10 /* Number of block buffers */ #define NMOUNTS 4 /* Number of mounts at a time */ diff --git a/Kernel/platform-p112/fuzix.lnk b/Kernel/platform-p112/fuzix.lnk index cdd82824..38ad9a3e 100644 --- a/Kernel/platform-p112/fuzix.lnk +++ b/Kernel/platform-p112/fuzix.lnk @@ -1,7 +1,7 @@ -mwxuy -i fuzix.ihx -b _CODE=0x0088 --b _COMMONMEM=0xF000 +-b _COMMONMEM=0xF800 -b _DISCARD=0xE000 -l z180 platform-p112/crt0.rel diff --git a/Kernel/platform-p112/kernel.def b/Kernel/platform-p112/kernel.def index eaa84d0f..44c1dd9a 100644 --- a/Kernel/platform-p112/kernel.def +++ b/Kernel/platform-p112/kernel.def @@ -1,6 +1,6 @@ ; UZI mnemonics for memory addresses etc -U_DATA .equ 0xF000 ; (this is struct u_data from kernel.h) +U_DATA .equ 0xF800 ; (this is struct u_data from kernel.h) U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes. OS_BANK .equ 0x00 ; value from include/kernel.h diff --git a/Kernel/platform-p112/p112.s b/Kernel/platform-p112/p112.s index f95b4879..da4aa976 100644 --- a/Kernel/platform-p112/p112.s +++ b/Kernel/platform-p112/p112.s @@ -80,7 +80,7 @@ write_escc: ret ; ----------------------------------------------------------------------------- -; COMMON MEMORY BANK (0xF000 upwards) +; COMMON MEMORY BANK ; ----------------------------------------------------------------------------- .area _COMMONMEM -- 2.34.1