From owner-freebsd-questions Mon Mar 18 19:08:23 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA26212 for questions-outgoing; Mon, 18 Mar 1996 19:08:23 -0800 (PST) Received: from garfield.cs.mun.ca (root@garfield.cs.mun.ca [134.153.1.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA26201 for ; Mon, 18 Mar 1996 19:08:15 -0800 (PST) Received: from maple.cs.mun.ca (amigus@maple.cs.mun.ca [134.153.1.12]) by garfield.cs.mun.ca (8.6.13/8.6.12) with ESMTP id XAA20541 for ; Mon, 18 Mar 1996 23:38:12 -0330 Received: (from amigus@localhost) by maple.cs.mun.ca (8.6.13/8.6.12) id XAA00862 for questions@freebsd.org; Mon, 18 Mar 1996 23:38:10 -0330 From: Adam Migus Message-Id: <199603190308.XAA00862@maple.cs.mun.ca> Subject: Diskless FreeBSD To: questions@freebsd.org Date: Mon, 18 Mar 1996 23:38:10 -0330 (NST) X-Mailer: ELM [version 2.4 PL13] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, I have been trying with some success to implement diskless freebsd over the local campus network and have had to patch numerous files to get any results here are the patches so far: nfs_vfsops.c: --- ./nfs/nfs_vfsops.c.orig Sat Mar 16 23:12:36 1996 +++ ./nfs/nfs_vfsops.c Sat Mar 16 23:13:00 1996 @@ -96,7 +96,13 @@ * server for a diskless/dataless machine. It is initialized below just * to ensure that it is allocated to initialized data (.data not .bss). */ -struct nfs_diskless nfs_diskless = { 0 }; + +#ifdef DISKLESS_CLIENT +extern struct nfs_diskless nfs_diskless; +#else +struct nfs_diskless nfsdiskless = { 0 }; +#endif /* DISKLESS_CLIENT */ + int nfs_diskless_valid = 0; extern u_long nfs_procids[NFS_NPROCS]; vm_swap.c: --- ./vm/vm_swap.c.orig Sat Mar 16 23:12:36 1996 +++ ./vm/vm_swap.c Sat Mar 16 23:13:00 1996 @@ -53,11 +53,17 @@ * Indirect driver for multi-controller paging. */ +#ifndef DISKLESS_CLIENT #ifndef NSWAPDEV #define NSWAPDEV 4 -#endif +#endif /* NSWAPDEV */ static struct swdevt should_be_malloced[NSWAPDEV]; struct swdevt *swdevt = should_be_malloced; +#else +#undef NSWAPDEV +#define NSWAPDEV 1 +#endif /* DISKLESS_CLIENT */ + struct vnode *swapdev_vp; int nswap; /* first block after the interleaved devs */ int nswdev = NSWAPDEV; swapkernel.c: --- compile/DISKLESS/swapkernel.c.orig Mon Mar 18 20:17:44 1996 +++ compile/DISKLESS/swapkernel.c Mon Mar 18 23:32:46 1996 @@ -1,8 +1,57 @@ +#ifndef DISKLESS_CLIENT +#define DISKLESS_CLIENT +#endif /* DISKLESS_CLIENT */ + +#ifndef NFS +#define NFS +#endif /* NFS */ + +#ifndef KERNEL +#define KERNEL +#endif /* KERNEL */ + +#ifndef NSWAPDEV +#define NSWAPDEV 1 +#endif /* NSWAPDEV */ + #include #include +#include +#include + +#include +#include +#include +#include + +extern int nfs_mountroot(); +int (*mountroot)() = nfs_mountroot; + +dev_t rootdev = NODEV; +dev_t argdev = NODEV; +dev_t dumpdev = NODEV; + +static struct swdevt swdevt_real[NSWAPDEV] = { + { (dev_t)NODEV, 0, 20000 }, +}; + +struct swdevt *swdevt = swdevt_real; + +/* this is not enough seems i need to fill the ifaliasreq structure */ +/* struct nfs_diskless nfs_diskless = { 0 }; */ + +#define MYADDRESS 0x86,0x99,0x52,0x2 /* 134.153.82.2 */ +#define MYBROADCAST 0x86,0x99,0x52,0xff /* 134.153.82.255 */ +#define MYNETMASK 0xff,0xff,0xff,0x0 /* 255.255.255.0 */ -dev_t rootdev = makedev(0, 0x00000000); /* wd0a */ -dev_t dumpdev = NODEV; /* unconfigured */ +/* do enough ifconfiging to talk to the card */ +struct nfs_diskless nfs_diskless = { + { { 'e', 'd', '0', '\0', }, + { 0x10, 0x2, { 0x0, 0x0, MYADDRESS }, }, + { 0x10, 0x2, { 0x0, 0x0, MYBROADCAST }, }, + { 0x10, 0x2, MYNETMASK, }, + }, +}; void setconf() After all this i do have a kerenl that will boot, mount the root and swap filesystems and run but reboots the machine without warning after the swap file have filled to 69632 bytes everytime. I have debugging enabled but the kernel doesnt even panic it just reboots! I guess i am asking is all this nessesary and if it isn't what to do and if it is what I should and shouldn't do to cure this problem and avoid anymore. PS. if i do get this figured out and can deduce a sain way to organize this i don't mind submitting any code for future releases. Let me know, thanks -- _______________________________________________ | Adam Migus amigus@cs.mun.ca | | Computer Science, Memorial University | -----------------------------------------------