kernel/muxx_memsvc.c
/*
** Initialize MMCBs and explicitly mark initial memory as used
** 
** This routine is used by the kernel to tell the memory manager about
** the memory it allocated during startup, before the memory manager was
** running.
** 
*/
Initialize MMCBs and explicitly mark initial memory as used
This routine is used by the kernel to tell the memory manager about
the memory it allocated during startup, before the memory manager was
running.
Initialize MMCBs and explicitly mark initial memory as used This routine is used by the kernel to tell the memory manager about the memory it allocated during startup before the memory manager was running .
int muxx_mem_init() {
  int i = 0, rc=0;
  PMMCBT pmmcbt = mmcbtaddr;
  memset((void *) pmmcbt ,0 ,sizeof(MMCBT));
  memcpy(pmmcbt->mcbeye, "MMCBT---",8);
  pmmcbt->numEntries = MEM_NMCBS;
  for (i=0; i<MEM_NMCBS; i++) {
    pmmcbt->mmcbt[i].ownerPID = -1; 
  }
  pmmcbt->mmcbt[0].blockAddr = 0;     
  pmmcbt->mmcbt[0].blockSize = 0200;
  pmmcbt->mmcbt[0].ownerPID = 1;
  pmmcbt->mmcbt[0].ownerPAR = 0;
  pmmcbt->mmcbt[0].prevBlock = NULL;
  pmmcbt->mmcbt[0].nextBlock = &(pmmcbt->mmcbt[1]);
  pmmcbt->mmcbt[0].mmcbFlags.flags.sharedBlock = 1;
  pmmcbt->mmcbt[0].mmcbFlags.flags.fixedBlock = 1;
  pmmcbt->mmcbt[0].mmcbFlags.flags.privBlock = 1;
  pmmcbt->mmcbt[0].mmcbFlags.flags.iopage = 0;
  pmmcbt->mmcbt[0].mmcbFlags.flags.stack = 0;
  pmmcbt->mmcbt[1].blockAddr = 0200;     
  pmmcbt->mmcbt[1].blockSize = 0200;
  pmmcbt->mmcbt[1].ownerPID = 1;
  pmmcbt->mmcbt[1].ownerPAR = 1;
  pmmcbt->mmcbt[1].prevBlock = &(pmmcbt->mmcbt[0]);
  pmmcbt->mmcbt[1].nextBlock = &(pmmcbt->mmcbt[2]);
  pmmcbt->mmcbt[1].mmcbFlags.flags.sharedBlock = 1;
  pmmcbt->mmcbt[1].mmcbFlags.flags.fixedBlock = 1;
  pmmcbt->mmcbt[1].mmcbFlags.flags.privBlock = 1;
  pmmcbt->mmcbt[1].mmcbFlags.flags.iopage = 0;
  pmmcbt->mmcbt[1].mmcbFlags.flags.stack = 0;
  pmmcbt->mmcbt[2].blockAddr = 0400;     
  pmmcbt->mmcbt[2].blockSize = 0200;
  pmmcbt->mmcbt[2].ownerPID = 1;
  pmmcbt->mmcbt[2].ownerPAR = 2;
  pmmcbt->mmcbt[2].prevBlock = &(pmmcbt->mmcbt[1]);
  pmmcbt->mmcbt[2].nextBlock = &(pmmcbt->mmcbt[3]);
  pmmcbt->mmcbt[2].mmcbFlags.flags.sharedBlock = 1;
  pmmcbt->mmcbt[2].mmcbFlags.flags.fixedBlock = 1;
  pmmcbt->mmcbt[2].mmcbFlags.flags.privBlock = 1;
  pmmcbt->mmcbt[2].mmcbFlags.flags.iopage = 0;
  pmmcbt->mmcbt[2].mmcbFlags.flags.stack = 0;
  pmmcbt->mmcbt[3].blockAddr = 0600;     
  pmmcbt->mmcbt[3].blockSize = 0100;     
  pmmcbt->mmcbt[3].ownerPID = 1;
  pmmcbt->mmcbt[3].ownerPAR = 6;         
  pmmcbt->mmcbt[3].prevBlock = &(pmmcbt->mmcbt[2]);
  pmmcbt->mmcbt[3].nextBlock = &(pmmcbt->mmcbt[4]);
  pmmcbt->mmcbt[3].mmcbFlags.flags.sharedBlock = 0;
  pmmcbt->mmcbt[3].mmcbFlags.flags.fixedBlock = 0;
  pmmcbt->mmcbt[3].mmcbFlags.flags.privBlock = 0;
  pmmcbt->mmcbt[3].mmcbFlags.flags.iopage = 0;
  pmmcbt->mmcbt[3].mmcbFlags.flags.stack = 1;
  pmmcbt->mmcbt[4].blockAddr = 00700;    
  pmmcbt->mmcbt[4].blockSize = 07100;    
  pmmcbt->mmcbt[4].ownerPID = 0;         
  pmmcbt->mmcbt[4].ownerPAR = 0;         
  pmmcbt->mmcbt[4].prevBlock = &(pmmcbt->mmcbt[3]);
  pmmcbt->mmcbt[4].nextBlock = &(pmmcbt->mmcbt[5]);
  pmmcbt->mmcbt[4].mmcbFlags.flags.sharedBlock = 0;
  pmmcbt->mmcbt[4].mmcbFlags.flags.fixedBlock = 0;
  pmmcbt->mmcbt[4].mmcbFlags.flags.privBlock = 0;
  pmmcbt->mmcbt[4].mmcbFlags.flags.iopage = 0;
  pmmcbt->mmcbt[4].mmcbFlags.flags.stack = 0;
  pmmcbt->mmcbt[5].blockAddr = 07600;     
  pmmcbt->mmcbt[5].blockSize = 00200;     
  pmmcbt->mmcbt[5].ownerPID = 1;
  pmmcbt->mmcbt[5].ownerPAR = 7;         
  pmmcbt->mmcbt[5].prevBlock = &(pmmcbt->mmcbt[4]);
  pmmcbt->mmcbt[5].nextBlock = NULL;
  pmmcbt->mmcbt[5].mmcbFlags.flags.sharedBlock = 1;
  pmmcbt->mmcbt[5].mmcbFlags.flags.fixedBlock = 1;
  pmmcbt->mmcbt[5].mmcbFlags.flags.privBlock = 0;
  pmmcbt->mmcbt[5].mmcbFlags.flags.iopage = 1; 
  return rc;
}
int muxx_mem_init ( ) { int i = 0 , rc = 0 ; PMMCBT pmmcbt = mmcbtaddr ; memset ( ( void * ) pmmcbt , 0 , sizeof ( MMCBT ) ) ; memcpy ( pmmcbt -> mcbeye , " " , 8 ) ; pmmcbt -> numEntries = MEM_NMCBS ; for ( i = 0 ; i < MEM_NMCBS ; i ++ ) { pmmcbt -> mmcbt [ i ] . ownerPID = -1 ; } pmmcbt -> mmcbt [ 0 ] . blockAddr = 0 ; pmmcbt -> mmcbt [ 0 ] . blockSize = 0200 ; pmmcbt -> mmcbt [ 0 ] . ownerPID = 1 ; pmmcbt -> mmcbt [ 0 ] . ownerPAR = 0 ; pmmcbt -> mmcbt [ 0 ] . prevBlock = NULL ; pmmcbt -> mmcbt [ 0 ] . nextBlock = & ( pmmcbt -> mmcbt [ 1 ] ) ; pmmcbt -> mmcbt [ 0 ] . mmcbFlags . flags . sharedBlock = 1 ; pmmcbt -> mmcbt [ 0 ] . mmcbFlags . flags . fixedBlock = 1 ; pmmcbt -> mmcbt [ 0 ] . mmcbFlags . flags . privBlock = 1 ; pmmcbt -> mmcbt [ 0 ] . mmcbFlags . flags . iopage = 0 ; pmmcbt -> mmcbt [ 0 ] . mmcbFlags . flags . stack = 0 ; pmmcbt -> mmcbt [ 1 ] . blockAddr = 0200 ; pmmcbt -> mmcbt [ 1 ] . blockSize = 0200 ; pmmcbt -> mmcbt [ 1 ] . ownerPID = 1 ; pmmcbt -> mmcbt [ 1 ] . ownerPAR = 1 ; pmmcbt -> mmcbt [ 1 ] . prevBlock = & ( pmmcbt -> mmcbt [ 0 ] ) ; pmmcbt -> mmcbt [ 1 ] . nextBlock = & ( pmmcbt -> mmcbt [ 2 ] ) ; pmmcbt -> mmcbt [ 1 ] . mmcbFlags . flags . sharedBlock = 1 ; pmmcbt -> mmcbt [ 1 ] . mmcbFlags . flags . fixedBlock = 1 ; pmmcbt -> mmcbt [ 1 ] . mmcbFlags . flags . privBlock = 1 ; pmmcbt -> mmcbt [ 1 ] . mmcbFlags . flags . iopage = 0 ; pmmcbt -> mmcbt [ 1 ] . mmcbFlags . flags . stack = 0 ; pmmcbt -> mmcbt [ 2 ] . blockAddr = 0400 ; pmmcbt -> mmcbt [ 2 ] . blockSize = 0200 ; pmmcbt -> mmcbt [ 2 ] . ownerPID = 1 ; pmmcbt -> mmcbt [ 2 ] . ownerPAR = 2 ; pmmcbt -> mmcbt [ 2 ] . prevBlock = & ( pmmcbt -> mmcbt [ 1 ] ) ; pmmcbt -> mmcbt [ 2 ] . nextBlock = & ( pmmcbt -> mmcbt [ 3 ] ) ; pmmcbt -> mmcbt [ 2 ] . mmcbFlags . flags . sharedBlock = 1 ; pmmcbt -> mmcbt [ 2 ] . mmcbFlags . flags . fixedBlock = 1 ; pmmcbt -> mmcbt [ 2 ] . mmcbFlags . flags . privBlock = 1 ; pmmcbt -> mmcbt [ 2 ] . mmcbFlags . flags . iopage = 0 ; pmmcbt -> mmcbt [ 2 ] . mmcbFlags . flags . stack = 0 ; pmmcbt -> mmcbt [ 3 ] . blockAddr = 0600 ; pmmcbt -> mmcbt [ 3 ] . blockSize = 0100 ; pmmcbt -> mmcbt [ 3 ] . ownerPID = 1 ; pmmcbt -> mmcbt [ 3 ] . ownerPAR = 6 ; pmmcbt -> mmcbt [ 3 ] . prevBlock = & ( pmmcbt -> mmcbt [ 2 ] ) ; pmmcbt -> mmcbt [ 3 ] . nextBlock = & ( pmmcbt -> mmcbt [ 4 ] ) ; pmmcbt -> mmcbt [ 3 ] . mmcbFlags . flags . sharedBlock = 0 ; pmmcbt -> mmcbt [ 3 ] . mmcbFlags . flags . fixedBlock = 0 ; pmmcbt -> mmcbt [ 3 ] . mmcbFlags . flags . privBlock = 0 ; pmmcbt -> mmcbt [ 3 ] . mmcbFlags . flags . iopage = 0 ; pmmcbt -> mmcbt [ 3 ] . mmcbFlags . flags . stack = 1 ; pmmcbt -> mmcbt [ 4 ] . blockAddr = 00700 ; pmmcbt -> mmcbt [ 4 ] . blockSize = 07100 ; pmmcbt -> mmcbt [ 4 ] . ownerPID = 0 ; pmmcbt -> mmcbt [ 4 ] . ownerPAR = 0 ; pmmcbt -> mmcbt [ 4 ] . prevBlock = & ( pmmcbt -> mmcbt [ 3 ] ) ; pmmcbt -> mmcbt [ 4 ] . nextBlock = & ( pmmcbt -> mmcbt [ 5 ] ) ; pmmcbt -> mmcbt [ 4 ] . mmcbFlags . flags . sharedBlock = 0 ; pmmcbt -> mmcbt [ 4 ] . mmcbFlags . flags . fixedBlock = 0 ; pmmcbt -> mmcbt [ 4 ] . mmcbFlags . flags . privBlock = 0 ; pmmcbt -> mmcbt [ 4 ] . mmcbFlags . flags . iopage = 0 ; pmmcbt -> mmcbt [ 4 ] . mmcbFlags . flags . stack = 0 ; pmmcbt -> mmcbt [ 5 ] . blockAddr = 07600 ; pmmcbt -> mmcbt [ 5 ] . blockSize = 00200 ; pmmcbt -> mmcbt [ 5 ] . ownerPID = 1 ; pmmcbt -> mmcbt [ 5 ] . ownerPAR = 7 ; pmmcbt -> mmcbt [ 5 ] . prevBlock = & ( pmmcbt -> mmcbt [ 4 ] ) ; pmmcbt -> mmcbt [ 5 ] . nextBlock = NULL ; pmmcbt -> mmcbt [ 5 ] . mmcbFlags . flags . sharedBlock = 1 ; pmmcbt -> mmcbt [ 5 ] . mmcbFlags . flags . fixedBlock = 1 ; pmmcbt -> mmcbt [ 5 ] . mmcbFlags . flags . privBlock = 0 ; pmmcbt -> mmcbt [ 5 ] . mmcbFlags . flags . iopage = 1 ; return rc ; }
Initialize MMCBs and explicitly mark initial memory as used
This routine is used by the kernel to tell the memory manager about
the memory it allocated during startup, before the memory manager was
running.
Initialize MMCBs and explicitly mark initial memory as used This routine is used by the kernel to tell the memory manager about the memory it allocated during startup before the memory manager was running .
// Unallocated MMCB /*
  ** First two memory chunks: physical blocks 0-255 mapped to the first two PARs
  */ // Base of physical memory // Next block of physical memory // Next block of physical memory /*
  ** Stack block 
  */ // Next block of physical memory // 4 KB for stack // Page 6, just below iospace /*
  ** Free space
  */ // Next block of physical memory // Rest of physical up to 256K // Unallocated          // Not mapped /*
  ** IOSPACE mapping
  */ // IOSPACE block // 8 KB, architecture defined // Page 7, IOSPACE mapping