From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 25 06:27:32 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B61BC944; Mon, 25 Aug 2014 06:27:32 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "*.ixsystems.com", Issuer "Go Daddy Secure Certification Authority" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81788347D; Mon, 25 Aug 2014 06:27:31 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 3452E7D580; Sun, 24 Aug 2014 23:27:31 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 08535-02; Sun, 24 Aug 2014 23:27:31 -0700 (PDT) Received: from [10.8.0.22] (unknown [10.8.0.22]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id D45587D578; Sun, 24 Aug 2014 23:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1408948050; bh=HeWO1YsKWPjh9XfNuuhVCuzEHssD2JtXtXSWYX8OVPs=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=UDg1BwlKLuzp/LlJPIZbM7L5+eJzpvMUNSI2K0chlqTx/xRyydQYbbzhK/fsF0B8k M+oRt7uq9vBvKOe2xA5roHaOw3004h2avHQFrHNQPU/E07egyL6v41jqB9gzLAJpVI ztMoNTlVY42t5grHu/ER3ihZiSzV2sRHsnMaABiw= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Lua in the bootloader From: Jordan Hubbard In-Reply-To: <236878C4-2C3E-4744-A04B-736C91032BFC@felyko.com> Date: Sun, 24 Aug 2014 23:27:28 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <96E32478-5450-4A35-B68A-4791668AA701@ixsystems.com> References: <3D62F4F4-ECCF-4622-BB57-D028160F3451@freebsd.org> <157901cfbe83$6cbf18d0$463d4a70$@FreeBSD.org> <16e101cfbfee$42b3b930$c81b2b90$@FreeBSD.org> <5FE57E4E-A627-4ABA-AB73-F0D60A3602D5@ixsystems.com> <236878C4-2C3E-4744-A04B-736C91032BFC@felyko.com> To: Rui Paulo X-Mailer: Apple Mail (2.1878.6) Cc: "Wojciech A. Koszek" , "" , "" , Pedro Giffuni , Pedro Arthur X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2014 06:27:32 -0000 On Aug 24, 2014, at 9:07 PM, Rui Paulo wrote: > No, it's worse than that. There's not a really limit on the size and = the stack can overflow easily on real hardware while at the same time it = works fine on bhyve at the same time. userboot vs real hardware. I=92m not sure I understand why there would be a difference in behavior = on =93real hardware=94 vs bhyve unless bhyve is initializing ficl = differently and causing it to change its allocation parameters. In some = ways, we lost out for not having gone with =93a real forth=94 = implementation in the most traditional and compact sense. In a = traditional Forth system, the dictionary starts at the bottom of the = available address space and the stack starts at the top - they grow = towards one another, which is how I implemented the PC-532 boot loader = (also in forth, but in assembly language); if you want to keep them out = of their hair, you just put the stack base further away in memory. Ficl is a higher-level C implementation and simply allocates a = fixed-sized chunk of space for the dictionary and for the stack. Our = version of ficl is a bit ancient and I=92m still looking through it to = even see where the dictionary size is chosen. I suspect we simply made = some bogus assumptions early on and never caught them until the FreeBSD = boot environment grew so many logos and menus that it hit the limit. Not that I disagree with any of the other arguments, mind you. I think = a new boot environment language would be fine. I agree that Forth is = largely only attractive to people with grey beard hair (though its value = for torturing Alfred should not be underestimated). I just think that = it=92s also going to be awhile before the new hotness is at full = feature-parity with the current boot loader, and if fixing the amount of = headroom can buy us a little time, why not? We hit the limit with = FreeNAS too (I=92ve seen the same dreaded boot-time crash you did) so = it=92s not just an academic point for me. > The limitation of the dictionary and the size of the stack isn't the = main reason why I would prefer lua over forth. Why do we need to = subject ourselves to a stack based language in 2014? The very limited = number of people hacking on the Forth boot loader on FreeBSD might have = a different opinion, but the language is so arcane that I fail to see = why we shouldn't replace it. Again, no disagreement, though I do wonder how many Lua programmers = FreeBSD has that will be able to hit the ground running as a result of = this evolution. Anyone? Raise your hands! I can=92t raise mine - = I=92ve never used Lua. :) - Jordan=