Kernel: p112, n8vem-mark4: Push the base of common memory up to F800
authorWill Sowerbutts <will@sowerbutts.com>
Tue, 3 Feb 2015 00:28:22 +0000 (00:28 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Sun, 15 Feb 2015 12:34:35 +0000 (12:34 +0000)
When the kernel is mapped in, the memory at F000-F800 now belongs to the
current process.

Kernel/cpu-z180/z180.s
Kernel/platform-n8vem-mark4/commonmem.s
Kernel/platform-n8vem-mark4/config.h
Kernel/platform-n8vem-mark4/fuzix.lnk
Kernel/platform-n8vem-mark4/kernel.def
Kernel/platform-n8vem-mark4/mark4.s
Kernel/platform-p112/commonmem.s
Kernel/platform-p112/config.h
Kernel/platform-p112/fuzix.lnk
Kernel/platform-p112/kernel.def
Kernel/platform-p112/p112.s

index f23812c..edee00d 100644 (file)
@@ -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
 
index 522503a..cd68577 100644 (file)
@@ -1,9 +1,3 @@
-;
-;      Common on z80pack is at 0xF000 as defined by hardware.
-;
-
         .module commonmem
-
         .area _COMMONMEM
-
        .include "../cpu-z80/std-commonmem.s"
index 351b96c..43f605d 100644 (file)
 #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
 #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 */
 
index 9efea4e..477f255 100644 (file)
@@ -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
index 634dbfe..7596dce 100644 (file)
@@ -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
 
index 7043e8d..8fe12a1 100644 (file)
@@ -55,7 +55,7 @@ init_hardware:
         jp z180_init_hardware
 
 ; -----------------------------------------------------------------------------
-; COMMON MEMORY BANK (0xF000 upwards)
+; COMMON MEMORY BANK
 ; -----------------------------------------------------------------------------
         .area _COMMONMEM
 
index 522503a..cd68577 100644 (file)
@@ -1,9 +1,3 @@
-;
-;      Common on z80pack is at 0xF000 as defined by hardware.
-;
-
         .module commonmem
-
         .area _COMMONMEM
-
        .include "../cpu-z80/std-commonmem.s"
index 80ba5c6..c8afad4 100644 (file)
 #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
 #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 */
 
index cdd8282..38ad9a3 100644 (file)
@@ -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
index eaa84d0..44c1dd9 100644 (file)
@@ -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
index f95b487..da4aa97 100644 (file)
@@ -80,7 +80,7 @@ write_escc:
         ret
 
 ; -----------------------------------------------------------------------------
-; COMMON MEMORY BANK (0xF000 upwards)
+; COMMON MEMORY BANK
 ; -----------------------------------------------------------------------------
         .area _COMMONMEM