+/*
+ * This module manages a system with flexible 16K sized banks. It assumes
+ * that the udata and kernel common/stacks/other overheads are mapped at the
+ * very top of available memory. (PROGTOP to 0xFFFF)
+ *
+ * If the memory is mapped with the common at the bottom (16K banks for 6502
+ * for example) then use bank16k_low.c
+ *
+ * Other requirements:
+ * - If you are using swap your swap driver must know how to remap and access
+ * any process memory for the other processes
+ * - 16bit address space (under 64K is fine, over is not)
+ *
+ * Set:
+ * CONFIG_BANK16
+ * MAX_MAPS to the largest number of free pages there can be
+ * SWAPDEV if using swap
+ * PROGTOP first byte above process space
+ *
+ * Page numbers must not include 0 (0 is taken as swapped)
+ */
#include <kernel.h>
#include <kdata.h>
#include <printf.h>
#include <printf.h>
/*
- * 16K memory banks with the common in the bottom bank. Currently only used
- * for the 6502 CPU.
+ * This module manages a system with flexible 16K sized banks. It assumes
+ * that the udata and kernel common/stacks/other overheads are mapped at the
+ * bottom of available memory. (0 to PROGBASE - 1)
+ *
+ * If the memory is mapped with the common at the top (16K banks for Z80
+ * for example) then use bank16k.c
+ *
+ * Other requirements:
+ * - If you are using swap your swap driver must know how to remap and access
+ * any process memory for the other processes
+ * - 16bit address space (under 64K is fine, over is not)
+ *
+ * Set:
+ * CONFIG_BANK16_LOW
+ * MAX_MAPS to the largest number of free pages there can be
+ * SWAPDEV if using swap
+ *
+ * Page numbers must not include 0 (0 is taken as swapped)
*/
unchanged at the top */
if (want - have > pfptr)
return ENOMEM;
- /* We don't want to take an interrupt here while our page mappings are
- incomplete. We may restore bogus mappings and then take a second IRQ
- into hyperspace */
- irq = di();
/* We have common low so we must only touch the higher pages. This is
different from the high common case */
/* Copy the updated allocation into the ptab */
udata.u_ptab->p_page = udata.u_page;
udata.u_ptab->p_page2 = udata.u_page2;
- /* Now fix the vectors up - they've potentially teleported up to 48K up
- the user address space, we need to put a copy back in low memory before
- we switch to this memory map */
- program_vectors(&udata.u_page);
- irqrestore(irq);
return 0;
}
+/*
+ * This module manages a system with fixed sized banking where all but one
+ * area of memory is pinned and the other area can be set to multiple
+ * different banks.
+ *
+ * FFFF +-----------------------------------+
+ * | Common Memory |
+ * MAPBASE+MAP_SIZE +-----------------------------------+
+ * | Banked Memory |
+ * MAPBASE +-----------------------------------+
+ * | Common Memory |
+ * 0000 +-----------------------------------+
+ *
+ *
+ * Other requirements:
+ * - 16bit address space (under 64K is fine, over is not) [Wants fixing]
+ *
+ * Set:
+ * CONFIG_BANK_FIXED
+ * MAX_MAPS to the number of banks available for user programs
+ * SWAPDEV if using swap
+ * MAP_SIZE the size of the bankable area
+ *
+ * Most platforms using this module can use the standard lib/ tricks.s for
+ * their processor.
+ *
+ * Bank numbers must not include 0 (0 is taken as swapped)
+ */
+
#include <kernel.h>
#include <kdata.h>
#include <printf.h>
/*
- * Simple swap only system
+ * This module manages a system with no user banking.
+ *
+ * User memory lies between PROGBASE and PROGTOP which does not overlap
+ * common memory. The kernel may be banked over user memory areas if needed.
+ *
+ * All task switching occurs by swapping the existing process out to storage
+ * and reading in the new one. This can be done for either single tasking or
+ * (with a hard disk) multitasking.
+ *
+ * Other requirements:
+ * - 16bit address space (FIXME: should be made 32bit clean)
+ *
+ * Set:
+ * CONFIG_SWAP_ONLY
+ *
+ * Zero is used as swapped, 1 is used as in memory.
*/
#include <kernel.h>
/*
* Support for single tasking systems where there is not enough memory for
- * multiple tasks and where there is no suitable swap device. This configuration
- * is suitable for systems with over about 96K of RAM and nothing but a floppy
- * drive.
+ * multiple tasks and where there is no suitable swap device. This
+ * configuration can be useful for boot disks/standalone tools or to run
+ * apps on boxes otherwise incapable of running Fuzix code.
*
* To use this method of operation you should do the following
*
*
* If you don't have a "true" common area then your code that calls swap
* helpers while banked will need to copy ramtop between the banks
+ *
+ * Set:
+ * SWAPDEV to provide your own swap routines (eg to high memory) rather
+ * than use the simple (slow) ones provided as reference.
+ *
+ * Note:
+ * Unlike most other ports ramtop moves as processes are squashed up in
+ * high memory.
+ * This is actually not the simplest way to bring up a platform. If you
+ * have real banking then start with bankfixed.c
*/
* For 8086 we actually want two holes in some cases, one for cs: and one
* for ds: but we don't have all the vector hassle as we have a vaguely
* real notion of user/supervisor state.
+ *
+ * Set:
+ * CONFIG_BANKED_LINEAR
+ * COMMON_BANKS - number of 256 byte pages of udata etc needed
+ * with each process
+ *
*/
#include <kernel.h>