From owner-freebsd-chat Sat Jun 23 22: 1:14 2001 Delivered-To: freebsd-chat@freebsd.org Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by hub.freebsd.org (Postfix) with ESMTP id B58C637B405 for ; Sat, 23 Jun 2001 22:01:07 -0700 (PDT) (envelope-from jcm@freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97] ident=root) by probity.mcc.ac.uk with esmtp (Exim 2.05 #7) id 15E21C-000HBG-00; Sun, 24 Jun 2001 06:01:06 +0100 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.3/8.11.1) id f5O515c12536; Sun, 24 Jun 2001 06:01:05 +0100 (BST) (envelope-from jcm) Date: Sun, 24 Jun 2001 06:01:05 +0100 From: j mckitrick To: "G. Adam Stanislav" Cc: freebsd-chat@freebsd.org Subject: Re: most complex code in BSD? Message-ID: <20010624060105.A12278@dogma.freebsd-uk.eu.org> References: <20010621233210.A37804@dogma.freebsd-uk.eu.org> <3.0.6.32.20010623205528.00e64210@mail85.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <3.0.6.32.20010623205528.00e64210@mail85.pair.com>; from adam@whizkidtech.net on Sat, Jun 23, 2001 at 08:55:28PM -0500 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 On Sat, Jun 23, 2001 at 08:55:28PM -0500, G. Adam Stanislav wrote: | At 23:32 2001-06-21 +0100, j mckitrick wrote: | > | >In everyone's opinion, what is the most complex code in the BSD codebase? | >Not including asm | | Is that supposed to imply that asm is complex or something? Because | I would have to strongly disagree with any such implication. Well, i guess i would have said that for 2 possible reasons: first, because asm is machine dependent, so what might required for one task under a cpu would not have the same implementation on others. Second, maybe cryptic is a better choice than complex. While asm works with the most primitive of operations and could not literally be complex, sometimes (a) the task being done leads to cryptic or confusing code or (b) a sequence of instructions used which has subtle implications not obvious on first glance, especially to someone who has only a surface level knowledge of asm. For example, the code previously posted that used an unusual characteristic of PDP-10 (IIRC) code to alter a return address. Someone who knows the basic instructions, but did not know about this idiosyncracy might spend hours trying to figure out the most simple of instructions because their full effect is not understood. I remember once when i was tracing some 6510 code that was trying to hide itself and cover its tracks. The code loaded into zero page, then suddenly ended up under the kernel above 0xFF00. It wasn't until i found out later that the code had overwritten the disk drive buffer pointer in zero page that it made sense how the code got there. The code was trivial. The effect was subtle, but extremely significant. Jonathon -- Microsoft complaining about the source license used by Linux is like the event horizon calling the kettle black. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message