SCCS-vsn: sys/kern/init_main.c 7.35
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)init_main.c 7.34 (Berkeley) %G%
+ * @(#)init_main.c 7.35 (Berkeley) %G%
-#include "systm.h"
-#include "user.h"
#include "filedesc.h"
#include "kernel.h"
#include "mount.h"
#include "map.h"
#include "proc.h"
#include "filedesc.h"
#include "kernel.h"
#include "mount.h"
#include "map.h"
#include "proc.h"
+#include "resourcevar.h"
+#include "signalvar.h"
+#include "systm.h"
#include "vnode.h"
#include "seg.h"
#include "conf.h"
#include "vnode.h"
#include "seg.h"
#include "conf.h"
#include "malloc.h"
#include "protosw.h"
#include "reboot.h"
#include "malloc.h"
#include "protosw.h"
#include "reboot.h"
#include "machine/cpu.h"
#include "vm/vm.h"
#include "machine/cpu.h"
#include "vm/vm.h"
-#include "vm/vm_param.h"
-#include "vm/vm_map.h"
/*
* Components of process 0;
/*
* Components of process 0;
struct pgrp pgrp0;
struct proc proc0;
struct pcred cred0;
struct pgrp pgrp0;
struct proc proc0;
struct pcred cred0;
-struct filedesc filedesc0;
-struct file *fd0[NOEXTENT];
-char fdflags0[NOEXTENT];
+struct filedesc0 filedesc0;
struct plimit limit0;
struct vmspace vmspace0;
struct plimit limit0;
struct vmspace vmspace0;
+struct proc *curproc = &proc0;
struct proc *initproc, *pageproc;
int cmask = CMASK;
struct proc *initproc, *pageproc;
int cmask = CMASK;
{
register int i;
register struct proc *p;
{
register int i;
register struct proc *p;
- register struct filedesc *fdp;
+ register struct filedesc0 *fdp;
* Create the file descriptor table for process 0.
*/
fdp = &filedesc0;
* Create the file descriptor table for process 0.
*/
fdp = &filedesc0;
- p->p_fd = fdp;
- fdp->fd_refcnt = 1;
- fdp->fd_cmask = cmask;
- fdp->fd_ofiles = fd0;
- fdp->fd_ofileflags = fdflags0;
- fdp->fd_nfiles = NOEXTENT;
+ p->p_fd = &fdp->fd_fd;
+ fdp->fd_fd.fd_refcnt = 1;
+ fdp->fd_fd.fd_cmask = cmask;
+ fdp->fd_fd.fd_ofiles = fdp->fd_dfiles;
+ fdp->fd_fd.fd_ofileflags = fdp->fd_dfileflags;
+ fdp->fd_fd.fd_nfiles = NDFILE;
* We continue to place resource usage info
* and signal actions in the user struct so they're pageable.
*/
* We continue to place resource usage info
* and signal actions in the user struct so they're pageable.
*/
- p->p_stats = &u.u_stats;
- p->p_sigacts = &u.u_sigacts;
+ p->p_stats = &((struct user *)p->p_addr)->u_stats;
+ p->p_sigacts = &((struct user *)p->p_addr)->u_sigacts;
panic("cannot mount root");
/*
* Get vnode for '/'.
panic("cannot mount root");
/*
* Get vnode for '/'.
- * Setup rootdir and fdp->fd_cdir to point to it.
+ * Setup rootdir and fdp->fd_fd.fd_cdir to point to it.
*/
if (VFS_ROOT(rootfs, &rootdir))
panic("cannot find root vnode");
*/
if (VFS_ROOT(rootfs, &rootdir))
panic("cannot find root vnode");
- fdp->fd_cdir = rootdir;
- VREF(fdp->fd_cdir);
+ fdp->fd_fd.fd_cdir = rootdir;
+ VREF(fdp->fd_fd.fd_cdir);
+ fdp->fd_fd.fd_rdir = NULL;