init_main.c (103367) | init_main.c (103767) |
---|---|
1/* 2 * Copyright (c) 1995 Terrence R. Lambert 3 * All rights reserved. 4 * 5 * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * (c) UNIX System Laboratories, Inc. 8 * All or some portions of this file are derived from material licensed --- 25 unchanged lines hidden (view full) --- 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39 * SUCH DAMAGE. 40 * 41 * @(#)init_main.c 8.9 (Berkeley) 1/21/94 | 1/* 2 * Copyright (c) 1995 Terrence R. Lambert 3 * All rights reserved. 4 * 5 * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * (c) UNIX System Laboratories, Inc. 8 * All or some portions of this file are derived from material licensed --- 25 unchanged lines hidden (view full) --- 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39 * SUCH DAMAGE. 40 * 41 * @(#)init_main.c 8.9 (Berkeley) 1/21/94 |
42 * $FreeBSD: head/sys/kern/init_main.c 103367 2002-09-15 23:52:25Z julian $ | 42 * $FreeBSD: head/sys/kern/init_main.c 103767 2002-09-21 22:07:17Z jake $ |
43 */ 44 45#include "opt_init_path.h" 46#include "opt_mac.h" 47 48#include <sys/param.h> 49#include <sys/kernel.h> 50#include <sys/exec.h> --- 379 unchanged lines hidden (view full) --- 430 limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3; 431 limit0.p_cpulimit = RLIM_INFINITY; 432 limit0.p_refcnt = 1; 433 434 /* Allocate a prototype map so we have something to fork. */ 435 pmap_pinit0(vmspace_pmap(&vmspace0)); 436 p->p_vmspace = &vmspace0; 437 vmspace0.vm_refcnt = 1; | 43 */ 44 45#include "opt_init_path.h" 46#include "opt_mac.h" 47 48#include <sys/param.h> 49#include <sys/kernel.h> 50#include <sys/exec.h> --- 379 unchanged lines hidden (view full) --- 430 limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3; 431 limit0.p_cpulimit = RLIM_INFINITY; 432 limit0.p_refcnt = 1; 433 434 /* Allocate a prototype map so we have something to fork. */ 435 pmap_pinit0(vmspace_pmap(&vmspace0)); 436 p->p_vmspace = &vmspace0; 437 vmspace0.vm_refcnt = 1; |
438 vm_map_init(&vmspace0.vm_map, round_page(VM_MIN_ADDRESS), 439 trunc_page(VM_MAXUSER_ADDRESS)); | 438 vm_map_init(&vmspace0.vm_map, p->p_sysent->sv_minuser, 439 p->p_sysent->sv_maxuser); |
440 vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0); 441 442 /* 443 * We continue to place resource usage info and signal 444 * actions in the user struct so they're pageable. 445 */ 446 p->p_stats = &p->p_uarea->u_stats; 447 p->p_sigacts = &p->p_uarea->u_sigacts; --- 118 unchanged lines hidden (view full) --- 566 "fspath", "/dev", NULL); 567 if (error != 0) 568 init_does_devfs = 1; 569 } 570 571 /* 572 * Need just enough stack to hold the faked-up "execve()" arguments. 573 */ | 440 vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0); 441 442 /* 443 * We continue to place resource usage info and signal 444 * actions in the user struct so they're pageable. 445 */ 446 p->p_stats = &p->p_uarea->u_stats; 447 p->p_sigacts = &p->p_uarea->u_sigacts; --- 118 unchanged lines hidden (view full) --- 566 "fspath", "/dev", NULL); 567 if (error != 0) 568 init_does_devfs = 1; 569 } 570 571 /* 572 * Need just enough stack to hold the faked-up "execve()" arguments. 573 */ |
574 addr = trunc_page(USRSTACK - PAGE_SIZE); | 574 addr = p->p_sysent->sv_usrstack - PAGE_SIZE; |
575 if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, 576 FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0) 577 panic("init: couldn't allocate argument space"); 578 p->p_vmspace->vm_maxsaddr = (caddr_t)addr; 579 p->p_vmspace->vm_ssize = 1; 580 581 if ((var = getenv("init_path")) != NULL) { 582 strncpy(init_path, var, sizeof init_path); --- 15 unchanged lines hidden (view full) --- 598 if (bootverbose) 599 printf("start_init: trying %.*s\n", (int)(next - path), 600 path); 601 602 /* 603 * Move out the boot flag argument. 604 */ 605 options = 0; | 575 if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, 576 FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0) 577 panic("init: couldn't allocate argument space"); 578 p->p_vmspace->vm_maxsaddr = (caddr_t)addr; 579 p->p_vmspace->vm_ssize = 1; 580 581 if ((var = getenv("init_path")) != NULL) { 582 strncpy(init_path, var, sizeof init_path); --- 15 unchanged lines hidden (view full) --- 598 if (bootverbose) 599 printf("start_init: trying %.*s\n", (int)(next - path), 600 path); 601 602 /* 603 * Move out the boot flag argument. 604 */ 605 options = 0; |
606 ucp = (char *)USRSTACK; | 606 ucp = (char *)p->p_sysent->sv_usrstack; |
607 (void)subyte(--ucp, 0); /* trailing zero */ 608 if (boothowto & RB_SINGLE) { 609 (void)subyte(--ucp, 's'); 610 options = 1; 611 } 612#ifdef notyet 613 if (boothowto & RB_FASTBOOT) { 614 (void)subyte(--ucp, 'f'); --- 111 unchanged lines hidden --- | 607 (void)subyte(--ucp, 0); /* trailing zero */ 608 if (boothowto & RB_SINGLE) { 609 (void)subyte(--ucp, 's'); 610 options = 1; 611 } 612#ifdef notyet 613 if (boothowto & RB_FASTBOOT) { 614 (void)subyte(--ucp, 'f'); --- 111 unchanged lines hidden --- |