From owner-freebsd-chat Fri Jun 22 5:28:18 2001 Delivered-To: freebsd-chat@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id 0F36037B401 for ; Fri, 22 Jun 2001 05:27:45 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 66835 invoked by uid 100); 22 Jun 2001 12:01:03 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15155.13183.377957.392221@guru.mired.org> Date: Fri, 22 Jun 2001 07:01:03 -0500 To: j mckitrick Cc: Michael Lucas , Dag-Erling Smorgrav , freebsd-chat@FreeBSD.ORG Subject: Re: most complex code in BSD? In-Reply-To: <20010622114548.A51977@dogma.freebsd-uk.eu.org> References: <20010621233210.A37804@dogma.freebsd-uk.eu.org> <20010622062238.A45123@blackhelicopters.org> <20010622114548.A51977@dogma.freebsd-uk.eu.org> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org j mckitrick types: > On Fri, Jun 22, 2001 at 06:22:38AM -0400, Michael Lucas wrote: > | When I took the two-day FreeBSD Internals course McKusick taught, he > | brought up the context-switching code. > | > | The original UNIX authors were not much on comments. When they put a > | comment, it was to explain something really, really, *really* difficult. > | > | Apparently there was a seven-word comment in the context switching > | code that gave him a bit of a start: "You are not expected to > | understand this." Don't know if it's still there, but it's still > | probably pretty scary. > > Is this supposed to be in C or asm? I thought context switches were among > the only asm/machine dependent code. For the v6 kernel, this is in C code. I never went looking for it in later code, so I don't know when it vanished. The comment in question is a couple of paragraphs, followed by that seven-word note. If I remember correctly - my copy of Lyons being in storage - the code was the context-switching code, and what was being explained was the mechanism that was used to start the first process, which involved very machine-dependent work so that that code would do the job. Since it's been a decade or two since I looked at that code, I may not remember correctly. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message