Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!cbmvax!carolyn From: carolyn@cbmvax.UUCP Newsgroups: comp.sys.amiga Subject: Re: Help! I can't seem to run a program > 2meg in my 4meg Amiga Message-ID: <1329@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 2-Feb-87 17:04:10 EST Article-I.D.: cbmvax.1329 Posted: Mon Feb 2 17:04:10 1987 Date-Received: Tue, 3-Feb-87 18:39:41 EST References: <12032@lanl.ARPA> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner) Organization: Commodore Technology, West Chester, PA Lines: 110 In article <12032@lanl.ARPA> jtw@lanl.ARPA (James West) writes: >Could someone please explain why an AMIGA with a 4 megabyte memory expansion >will only run tasks that total to 2 megabytes or less??? > >Recently I added an AMERISTAR expansion bus with two 2 megabyte memory boards >and a hard disk. I am running the new Amiga 1.2 operating system with the >Absoft Fortran compiler. AmigaDos 1.2 auto configures memory, and >automatically sees the 4 megabytes. I can easily copy 4 megabytes of files >into the memory without any problems. It appears part of the operating system >sees the 4 megabytes, but part does not. To be exact, the part of the >operating system dictating memory available for running processes, appears >to be seeing only 2 megabytes! >... Separate memory boards (such as Jim's 2 2-meg boards) are configured as separate entities, each with its own entry in the system MemList and its own MemHeader in its first 32 bytes. Jim's programs apparently need a contiguous chunk of memory larger than what is available in either individual board. The following program "MergeMem.c" attempts to merge the MemList entries of sequentially configured ram boards. I tested it with a 1/2 meg Alegra plugged into the pass-thru of a 2-meg StarBoard. It successfully merged the MemList entries of these two boards. After the merge, I was able to AllocMem() a 2.1 megabyte chunk. ------------------------------------------------------------------------ /* MergeMem.c - by Carolyn Scheppner CBM 02/87 * Attempts to merge the memlists of sequentially configged ram boards * which have the same Attributes (for contiguous expansion ram) * * Note: This program has been tested with an Alegra plugged into * a Microbotics Starboard' pass-thru. The program makes * the assumption that sequentially configged ram boards * have sequential entries in the MemHeader list. If this * is not always true, then this program may not work for * some expansion configurations. Works fine for me though. */ #include "exec/types.h" #include "exec/exec.h" #include "exec/execbase.h" extern struct ExecBase *SysBase; main() { struct MemChunk *chunk; struct MemHeader *mem, *firstmem, *prevmem = 0; struct ExecBase *eb = SysBase; ULONG memsize; /* Temps */ struct MemChunk *oldFirst; APTR oldLower, oldUpper; ULONG oldFree; Forbid(); firstmem = (struct MemHeader *)eb->MemList.lh_Head; /* Go to end of MemHeader list */ for (mem = firstmem; mem->mh_Node.ln_Succ; mem = (struct MemHeader *)mem->mh_Node.ln_Succ) printf("Found memory type $%lx at $%lx\n",mem->mh_Attributes,mem); /* Back up from terminal node to point at last MemHeader */ mem = (struct MemHeader *)mem->mh_Node.ln_Pred; /* Backwards, for each except first */ for ( ; (ULONG)mem != (ULONG)firstmem; mem = prevmem) { prevmem = (struct MemHeader *)mem->mh_Node.ln_Pred; /* If prev MemHeader describes neighboring ram of same Attributes */ if(((ULONG)prevmem->mh_Upper == (ULONG)mem->mh_Lower - 32)&& (prevmem->mh_Attributes == mem->mh_Attributes)) { printf("Merging $%lx with $%lx\n",prevmem,mem); /* Save needed stuff from MemHeader before Remove()ing it */ oldFirst = mem->mh_First; oldLower = mem->mh_Lower; oldUpper = mem->mh_Upper; oldFree = mem->mh_Free; Remove(mem); /* Adjust Upper and Free in prev MemHeader to include this mem */ memsize = (ULONG)oldUpper - (ULONG)oldLower +32L; prevmem->mh_Upper = (APTR)((ULONG)prevmem->mh_Upper + memsize); prevmem->mh_Free += oldFree; /* Link last free chunk of prevmem to first free of mem */ for (chunk = prevmem->mh_First; chunk->mc_Next; chunk = chunk->mc_Next); chunk->mc_Next = oldFirst; /* Now FreeMem() the old MemHeader as a 32 byte chunk */ FreeMem(mem,32); } } Permit(); } -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CBM >>Amiga Technical Support<< UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=