From: Ben Gras Date: Tue, 16 Aug 2005 11:37:33 +0000 (+0000) Subject: Al's patch sent mon 15 aug. X-Git-Tag: v3.1.0~326 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=b4d4450d2dcdd03662456ff559df591e5ee84b8c;p=minix.git Al's patch sent mon 15 aug. --- diff --git a/servers/pm/main.c b/servers/pm/main.c index d4e83baa0..2634843e7 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -136,7 +136,18 @@ int result; /* result of call (usually OK or error #) */ *===========================================================================*/ PRIVATE void pm_init() { -/* Initialize the process manager. */ +/* Initialize the process manager. + * Memory use info is collected from the boot monitor, the kernel, and + * all processes compiled into the system image. Initially this information + * is put into an array mem_chunks. Elements of mem_chunks are struct memory, + * and hold base, size pairs in units of clicks. This array is small, there + * should be no more than 8 chunks. After the array of chunks has been built + * the contents are used to initialize the hole list. Space for the hole list + * is reserved as an array with twice as many elements as the maximum number + * of processes allowed. It is managed as a linked list, and elements of the + * array are struct hole, which, in addition to storage for a base and size in + * click units also contain space for a link, a pointer to another element. +*/ int key, i, s; static struct boot_image image[NR_BOOT_PROCS]; register struct boot_image *ip; @@ -171,9 +182,9 @@ PRIVATE void pm_init() */ if ((s=sys_getmonparams(monitor_params, sizeof(monitor_params))) != OK) panic(__FILE__,"get monitor params failed",s); + get_mem_chunks(mem_chunks); if ((s=sys_getkinfo(&kinfo)) != OK) panic(__FILE__,"get kernel info failed",s); - get_mem_chunks(mem_chunks); /* Get the memory map of the kernel to see how much memory it uses. */ if ((s=get_mem_map(SYSTASK, mem_map)) != OK)