From owner-freebsd-hackers Tue Jan 19 10:15:04 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA18949 for freebsd-hackers-outgoing; Tue, 19 Jan 1999 10:15:04 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bingsun2.cc.binghamton.edu (bingsun2.cc.binghamton.edu [128.226.1.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA18935 for ; Tue, 19 Jan 1999 10:15:02 -0800 (PST) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun2.cc.binghamton.edu (8.8.7/8.6.9) with SMTP id NAA11509; Tue, 19 Jan 1999 13:14:46 -0500 (EST) Date: Tue, 19 Jan 1999 13:14:45 -0500 (EST) From: zhihuizhang X-Sender: bf20761@bingsun2 To: Sabrina Minshall cc: hackers Subject: Re: stack info In-Reply-To: <199901190433.UAA13330@shell.accesscom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 18 Jan 1999, Sabrina Minshall wrote: > Hi Zhihui, > > Since you're hot off this topic, I have a question. > > 1. When a process enters kernel mode (via system call) what > stack is used (in the top half)? is it a common stack to all > processes or is it per process? Where is it located? I have not read that part of the source code. As I understand it, the stack you use when you enter into kernel mode is the kernel stack. It is a per-process resource. It should be at the top of the u-area. In FreeBSD, I think the size of the u-area is two pages. > > 2. When the kernel is executing in the botton half, what stack is used? > is it kstack, or tmpstk? kstack is the kernel stack. tmpstk is used when the CPU is idle (see swtch.s). I am not sure what stack is used when an interrupt happens (the kernel is executing in the bottom half). However, since the interrupt handler does not have a process context, it should not use kstack. Maybe there is a third stack reserved for it or it could use tmpstk? > > 3. Does the kernel have multiple stacks for in the bottom half? Like > interrupt stack, etc? > I am not sure about this. See above. Zhihui Zhang ------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message