From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 14 17:31:09 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A96F8CF; Thu, 14 Nov 2013 17:31:09 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 345032DD7; Thu, 14 Nov 2013 17:31:09 +0000 (UTC) Received: from Alfreds-MacBook-Air.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 565651A3C2C; Thu, 14 Nov 2013 09:31:03 -0800 (PST) Message-ID: <528508D6.7000508@freebsd.org> Date: Thu, 14 Nov 2013 09:31:02 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske Subject: Re: Loader forth changes for customization References: <5282E56F.4020307@freebsd.org> <52832003.8080406@freebsd.org> <09673101-DB54-4D25-9989-8C80D06E266B@fisglobal.com> <5283933E.30603@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: FreeBSD Hackers , "Teske, Devin" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2013 17:31:09 -0000 On 11/13/13, 11:54 PM, Teske, Devin wrote: > On Nov 13, 2013, at 6:57 AM, Alfred Perlstein wrote: > >> On 11/13/13, 12:18 AM, Teske, Devin wrote: >>> On Nov 12, 2013, at 10:45 PM, Alfred Perlstein wrote: >>> >>>> I added some hooks for menu.rc as well, you can see it via the github urls below. >>>> >>>> I've attached a sample menu.rc.local that provides additional menus. >>>> >>>> -Alfred >>>> >>>> On 11/12/13, 6:35 PM, Alfred Perlstein wrote: >>>>> Hey folks, >>>>> >>>>> I added some forth using Devin's help to make it easier to customize the FreeBSD boot loader graphics. >>>>> >>>>> Diffs are here: >>>>> https://github.com/alfredperlstein/freebsd/compare/loader_custom_rc >>>>> -or- >>>>> https://github.com/alfredperlstein/freebsd/compare/loader_custom_rc.diff >>>>> >>>>> >>>>> Diff attached. >>>>> >>>>> Also attached is a custom loader.rc file and loader.conf file that shows how to set the brand/logo. >>>>> >>>>> Please review. >>>>> >>> I signed up for a github account (thanks), and I started commenting on some lines. >> yay! :) >>>>> -Alfred >>>> >>> Hmmm, I hadn't realized that you could say: >>> >>> set foo=bar >>> >>> Along-side setting functions in the same file. >>> >>> I don't think you can set functions in an *.rc file, only in a *.4th file? >>> >>> No? Maybe it's a false misconception of mine. I've been keeping them >>> separate for years. (but probably rightfully so, to keep *.rc files clean). >> It seems to work although I will talk to the team about making separate files for the set commands. >> >> I've responded to your review comments here: >> >> https://github.com/alfredperlstein/freebsd/commit/0ca72dccd78b880b3e3ef4c2bb9ce025950a370b#commitcomment-4584862 >> >> The changes I made are now in the branch >> https://github.com/alfredperlstein/freebsd/tree/loader_custom_rc and you likely should see them in the updated pull request I sent you. >> > I improved on a few things... > > https://github.com/devinteske/freebsd/compare/freebsd:master...master > -or- > https://github.com/devinteske/freebsd/compare/freebsd:master...master.diff > -or- > Attached SVN patch.txt Hey this is really awesome. I'll try to spin it up today and hopefully get it into FreeNAS/TrueOS today! I really like the level of comments here! Having both the micro and macro explanation of what is going on is very helpful. +: try-include ( -- ) \ see loader.4th(8) + ['] include ( -- xt ) \ get the execution token of `include' + catch ( xt -- exception# | 0 ) if \ failed + LF parse ( c -- s-addr/u ) 2drop \ advance >in to EOL (drop data) + \ ... prevents words unused by `include' from being interpreted + then +; immediate \ interpret immediately for access to `source' (aka tib) + So a few questions here: If so when why are we clearing to EOL? Is "include" supposed to be alone on a line by itself? You can't do this: include file_that_exists.rc 5 6 + . and likewise you can't do: try-include file_that_exists.rc 5 6 + . try-include file_that_does_NOT_exists.rc 5 6 + . It's not that important, just interesting. I'm wondering though, with the exception of actually including the file or not, will both of these: try-include file_that_exists.rc 5 6 + . try-include file_that_does_NOT_exists.rc 5 6 + . print '11'? Or not? Also, are there certain errors we want to report like "EISDIR" ? I'm not concerned for my application, but it's an just academic question I have. Finally thank you so much for the tutoring in forth, it's very cool and thanks for putting up with my obvious frustration at learning a new lang! -Alfred