-
-
- ba = PE_boot_args(); /* Get the boot arguments */
- lp = ba + 256; /* Point to the end */
-
- while(1) { /* Step through, looking for our keywords */
- phys = 0; /* Assume virtual memory device */
- ba = nonspace(ba, lp); /* Find non-space */
- if(ba >= lp) return; /* We are done if no more... */
- if(((ba[0] != 'v') && (ba[0] != 'p'))
- || (ba[1] != 'm') || (ba[2] != 'd') || (ba[4] != '=')
- || (ba[3] < '0') || (ba[3] > 'f')
- || ((ba[3] > '9') && (ba[3] < 'a'))) { /* Is this of form "vmdx=" or "pmdx=" where x is hex digit? */
-
- ba = getspace(ba, lp); /* Find next white space or end */
- continue; /* Start looking for the next one */
- }
-
- if(ba[0] == 'p') phys = 1; /* Set physical memory disk */
-
- devid = ba[3] & 0xF; /* Assume digit */
- if(ba[3] > '9') devid += 9; /* Adjust for hex digits */
-
- ba = &ba[5]; /* Step past keyword */
- ba = cvtnum(ba, lp, &base); /* Convert base of memory disk */
- if(ba >= lp) return; /* Malformed one at the end, leave */
- if(ba[0] != '.') continue; /* If not length separater, try next... */
- if(base & 0xFFF) continue; /* Only allow page aligned stuff */
-
- ba++; /* Step past '.' */
- ba = cvtnum(ba, lp, &size); /* Try to convert it */
- if(!size || (size & 0xFFF)) continue; /* Allow only non-zer page size multiples */
- if(ba < lp) { /* If we are not at end, check end character */
- if((ba[0] != ' ') && (ba[0] != 0)) continue; /* End must be null or space */
- }
-
- dev = mdevadd(devid, base >> 12, size >> 12, phys); /* Go add the device */
- }