[BACK]Return to init_main.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/init_main.c between version 1.188.2.20 and 1.188.2.21

version 1.188.2.20, 2002/11/11 22:13:31 version 1.188.2.21, 2002/12/11 06:43:01
Line 229  main(void)
Line 229  main(void)
         soinit();          soinit();
   
         /*          /*
          * The following 3 things must be done before autoconfiguration.           * The following things must be done before autoconfiguration.
          */           */
           evcnt_init();           /* initialize event counters */
         disk_init();            /* initialize disk list */          disk_init();            /* initialize disk list */
         tty_init();             /* initialize tty list */          tty_init();             /* initialize tty list */
 #if NRND > 0  #if NRND > 0
Line 538  main(void)
Line 539  main(void)
                 panic("fork syncer");                  panic("fork syncer");
   
         /* Create the aiodone daemon kernel thread. */          /* Create the aiodone daemon kernel thread. */
         if (kthread_create1(uvm_aiodone_daemon, NULL, NULL, "aiodoned"))          if (kthread_create1(uvm_aiodone_daemon, NULL, &uvm.aiodoned_proc,
               "aiodoned"))
                 panic("fork aiodoned");                  panic("fork aiodoned");
   
 #if defined(MULTIPROCESSOR)  #if defined(MULTIPROCESSOR)
Line 636  start_init(void *arg)
Line 638  start_init(void *arg)
         /*          /*
          * Need just enough stack to hold the faked-up "execve()" arguments.           * Need just enough stack to hold the faked-up "execve()" arguments.
          */           */
         addr = USRSTACK - PAGE_SIZE;          addr = (vaddr_t)STACK_ALLOC(USRSTACK, PAGE_SIZE);
         if (uvm_map(&p->p_vmspace->vm_map, &addr, PAGE_SIZE,          if (uvm_map(&p->p_vmspace->vm_map, &addr, PAGE_SIZE,
                     NULL, UVM_UNKNOWN_OFFSET, 0,                      NULL, UVM_UNKNOWN_OFFSET, 0,
                     UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,                      UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,
                     UVM_ADV_NORMAL,                      UVM_ADV_NORMAL,
                     UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)                      UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)
                 panic("init: couldn't allocate argument space");                  panic("init: couldn't allocate argument space");
         p->p_vmspace->vm_maxsaddr = (caddr_t)addr;          p->p_vmspace->vm_maxsaddr = (caddr_t)STACK_MAX(addr, PAGE_SIZE);
   
         ipx = 0;          ipx = 0;
         while (1) {          while (1) {
Line 667  start_init(void *arg)
Line 669  start_init(void *arg)
                                 break;                                  break;
                 }                  }
   
                 ucp = (char *)(addr + PAGE_SIZE);                  ucp = (char *)USRSTACK;
   
                 /*                  /*
                  * Construct the boot flag argument.                   * Construct the boot flag argument.
Line 696  start_init(void *arg)
Line 698  start_init(void *arg)
 #ifdef DEBUG  #ifdef DEBUG
                         printf("init: copying out flags `%s' %d\n", flags, i);                          printf("init: copying out flags `%s' %d\n", flags, i);
 #endif  #endif
                         (void)copyout((caddr_t)flags, (caddr_t)(ucp -= i), i);                          arg1 = STACK_ALLOC(ucp, i);
                         arg1 = ucp;                          ucp = STACK_MAX(arg1, i);
                           (void)copyout((caddr_t)flags, arg1, i);
                 }                  }
   
                 /*                  /*
Line 710  start_init(void *arg)
Line 713  start_init(void *arg)
                 if (boothowto & RB_ASKNAME || path != initpaths[0])                  if (boothowto & RB_ASKNAME || path != initpaths[0])
                         printf("init: trying %s\n", path);                          printf("init: trying %s\n", path);
 #endif  #endif
                 (void)copyout((caddr_t)path, (caddr_t)(ucp -= i), i);                  arg0 = STACK_ALLOC(ucp, i);
                 arg0 = ucp;                  ucp = STACK_MAX(arg0, i);
                   (void)copyout((caddr_t)path, arg0, i);
   
                 /*                  /*
                  * Move out the arg pointers.                   * Move out the arg pointers.
                  */                   */
                 uap = (char **)((long)ucp & ~ALIGNBYTES);                  ucp = (caddr_t)STACK_ALIGN(ucp, ALIGNBYTES);
                 (void)suword((caddr_t)--uap, 0);        /* terminator */                  uap = (char **)STACK_ALLOC(ucp, sizeof(char *) * 3);
                 if (options != 0)                  SCARG(&args, path) = arg0;
                         (void)suword((caddr_t)--uap, (long)arg1);                  SCARG(&args, argp) = uap;
                   SCARG(&args, envp) = NULL;
                 slash = strrchr(path, '/');                  slash = strrchr(path, '/');
                 if (slash)                  if (slash)
                         (void)suword((caddr_t)--uap,                          (void)suword((caddr_t)uap++,
                             (long)arg0 + (slash + 1 - path));                              (long)arg0 + (slash + 1 - path));
                 else                  else
                         (void)suword((caddr_t)--uap, (long)arg0);                          (void)suword((caddr_t)uap++, (long)arg0);
                   if (options != 0)
                 /*                          (void)suword((caddr_t)uap++, (long)arg1);
                  * Point at the arguments.                  (void)suword((caddr_t)uap++, 0);        /* terminator */
                  */  
                 SCARG(&args, path) = arg0;  
                 SCARG(&args, argp) = uap;  
                 SCARG(&args, envp) = NULL;  
   
                 /*                  /*
                  * Now try to exec the program.  If can't for any reason                   * Now try to exec the program.  If can't for any reason

Legend:
Removed from v.1.188.2.20  
changed lines
  Added in v.1.188.2.21

CVSweb <webmaster@jp.NetBSD.org>