From owner-freebsd-mobile@FreeBSD.ORG Sun Mar 21 18:52:06 2004 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id EF9B216A4D0; Sun, 21 Mar 2004 18:52:06 -0800 (PST) To: freebsd-current@FreeBSD.ORG, freebsd-mobile@FreeBSD.ORG, freebsd-hardware@FreeBSD.ORG Date: Sun, 21 Mar 2004 18:52:06 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20040322025206.EF9B216A4D0@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) Subject: For those with Intel Centrino 2200BG wireless... X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 02:52:07 -0000 If you are one of the people with a laptop that has an Intel Centrino 2200BG 802.11b/g miniPCI card, you can now use this card with the NDISulator. However, there is one big gotcha to be aware of. The w22n51.sys driver does an alloca() of approximately 5000 bytes when it associates with a network. This is a little unfriendly, but it works in Windows because the Windows kernel stack is large enough to accomodate it. The FreeBSD kernel stack is 2 pages (8192 bytes on i386) whic is smaller than the Windows kernel size. This means the alloca() will overflow the stack and kill the kernel. There's two ways to deal with this problem: one is to run the offending code in a kthread that has more than the default number of stack pages. You're supposed to be able to create such a thread by specifying a non-zero 'pages' argument to kthread_create(). The only problem is, vm_machdep.c is buggy and always initializes the stack pointer for a thread using the compile-time constant KTHREAD_PAGES rather than the dynamically selected pages value passed to kthread_create(), so no matter how many extra stack pages you try to allocate, the alloca() still smashes the stack. Long story short, if you want to use the Intel 2200BG card, you need to do one of the following: - If you use -current, then just make sure you sync up all of your sources, including all of the NDISulator code and sys/i386/i386/vm_machdep.c, which I fixed today. Or: - If you use 5.2-RELEASE or 5.2.1-RELEASE, grab the latest NDISulator code from -current _AND_ add compile a new kernel with the following line added to your kernel config file: options KSTACK_PAGES=8 The vm_machdep fix should get propagated to all the other arches soon. -Bill -- ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wpaul@windriver.com | Wind River Systems ============================================================================= you're just BEGGING to face the moose =============================================================================