px4plus: update comments, remember to swap the uarea
authorAlan Cox <alan@etchedpixels.co.uk>
Sun, 2 Nov 2014 18:37:32 +0000 (18:37 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Sun, 2 Nov 2014 18:37:32 +0000 (18:37 +0000)
Kernel/platform-px4plus/README
Kernel/platform-px4plus/config.h
Kernel/platform-px4plus/main.c

index 6a79630..799b1f9 100644 (file)
@@ -1,4 +1,4 @@
-A FUZIX target for the PX4plus
+A FUZIX target for the PX4plus (and PX4 with 128K RAM disc)
 
 Just playing to see if we can make it fit.
 
@@ -14,7 +14,11 @@ Intended Memory Map
 
 
 0x0000-0x00FF          Vectors
-0x0100-0x???? (RAM)    User program (and discard area)
+0x0100-0x7CFF (RAM)    User program (and discard area)
+(could go to 0xBFFF for 48K but our swap is very limiting and might need
+ smarter algorithms for swap - eg 16K banking for swap alone)
+0x7D00-0xCFFF          Space for things we can bank under the ROM
+                       (secondary floppy cache ??)
 0xD000-0xDFFF          Framebuffer, font, video code
 0xE000-0xF7FFish       Data for kernel
 0xF800-0xFCFF          Common (currently ends FBCC)
@@ -39,3 +43,14 @@ In practice it appears the answer is
 2. But only if the linker is taught to do banking. In fact once the linker
 does its own banking there is plenty of space although the bootloader might
 be a bit odd to make it work.
+
+A better layout given the 128K total swap limit might appear to be
+
+0x0000-0x00FF          Vectors
+0x0100-0x7CFF          Application
+0x7D00-0x7FFF          Uarea
+
+but we actually can't do this because the 32K ROM is always mapped from
+0x6000-0xDFFF and needs to access the Uarea
+
+
index bf0b80e..1e074de 100644 (file)
 #define PROGBASE    ((char *)(0x0100))  /* also data base */
 #define PROGTOP     ((char *)(0x4000))  /* Top of program for debug */
 
-#define SWAP_SIZE   0x40       /* 32K in blocks (we actually don't need the low 256) */
-#define SWAPBASE    0x0000     /* We swap the lot in one, include the */
-#define SWAPTOP            0x8000      /* vectors so its a round number of sectors */
+#define SWAP_SIZE   0x40       /* 32K in blocks (with uarea means 31K max app size) */
+#define SWAPBASE    0x0100     /* We swap the lot in one, include the */
+#define SWAPTOP            0x7C00      /* vectors so its a round number of sectors */
 #define MAX_SWAPS      4       /* We have a whopping 128K of RAMDISC! */
 
+#define UDATA_SWAPSIZE 0x0400  /* Write udata plus 0-0x0100 */
+#define UDATA_BLOCKS 2
+
 #define BOOT_TTY (512 + 1)/* Set this to default device for stdio, stderr */
                           /* In this case, the default is the first TTY device */
 
index 6cb5ac5..185dc2d 100644 (file)
@@ -30,3 +30,13 @@ void platform_interrupt(void)
 void map_init(void)
 {
 }
+
+void *swapout_prepare_uarea(ptptr p)
+{
+ return &udata;
+}
+
+void *swapin_prepare_uarea(ptptr p)
+{
+ return &udata;
+}