From owner-freebsd-current@freebsd.org Sat Feb 10 09:36:45 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EE94F0BFF3 for ; Sat, 10 Feb 2018 09:36:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B50F27557F for ; Sat, 10 Feb 2018 09:36:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id l17so12401247ioc.3 for ; Sat, 10 Feb 2018 01:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=c7pvXEdYum4RfoeXxB8uITV9WpGlEYMhuNAAD9bpiP8=; b=dja3dGPh8NdCY+7rtUocgZMkBiI54QYTz1XlijRpVEFxgyCZgYeD4NeG6lpXPCgftL hlCZ8Oo9dIjLEZQkg0/NvmhdjRIn5pM+53hzK5dvVV1eUOt4jMySZt1x6nwOkuRabYU8 DmhZo+nv55eMBruVPgSxTdoahsaNxtdCaQvMXJx7n9nO1B9AMNi+gH+bLYNGJCK2RnSG 2u3cH7IHUP1GoS/jlsU2WmZcmC3sKv54Qy8FtyvURjXJIwwD829NGAM9K8X0cWP0/GPc 7HpwR89yDDBnW+dQ5YYC6kGqAi34rU//pDhWSFs8qytCp20sgKiqJeXgR0FrEhCCmkti XalQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=c7pvXEdYum4RfoeXxB8uITV9WpGlEYMhuNAAD9bpiP8=; b=ntMFHAUrFeiHHsFso5WbceTXblBxYA/sNmmZ3sb2nzvx9SlycZ7t8Uw8+yyJivsyJi 4/z+TzNT77ZT9CiVJzpFlT3H9uOC5HiYemNA0aD5+uY0rILrsS7JTd8ZgDPomiMMuMBJ YE5wEp5rieUsrKfPnOwwklWH38AyZgyRQZrxAjX3ZTIeFo4LXV+V/dzGFCi0GkP/tM5z VQAdS8Ex9v+11RBeFW6ys/3ENzN2z0EHYwctspfm6hznUS/JTDDMPyfdcDV1u766YERi CylC+1WllU7vuUs+C8GDfv8/8v5IBLihP4PTbrHWkeA0Gl4Uai5c8h/Zg5fZT/QUywY+ 28NQ== X-Gm-Message-State: APf1xPAKf277Fv1odFLezXNDyCpKuzWQi3VFWavbeWD888pB0dxnkZmx kmFA/lAfBbE9vFuGovuraY3lf0hcWYPkGQDvzvseCg== X-Google-Smtp-Source: AH8x225PaIkTietnozGop5QhkGJ40NzfKdl/rFOLr7ODWDkHh3UW0/mjp+uuEzavJDhsOC/BpMEfOyusTYOhBwjR3c0= X-Received: by 10.107.107.1 with SMTP id g1mr6107939ioc.63.1518255403198; Sat, 10 Feb 2018 01:36:43 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 10 Feb 2018 01:36:42 -0800 (PST) X-Originating-IP: [50.253.99.174] From: Warner Losh Date: Sat, 10 Feb 2018 02:36:42 -0700 X-Google-Sender-Auth: pcUM35GIi8k-hJR3AYTAbMPg98E Message-ID: Subject: Lua Loader changes posted To: FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Feb 2018 09:36:45 -0000 I'm at a good point in the lua loader, so I've posted changed to https://reviews.freebsd.org/D14295 for review. It works great in the userboot.so loader test harness, but I've not booted this on real hardware yet, so anyone wanting to take it for a spin be sure you have an old-working loader or some other way to recover your machine / VM. It's purely opt-in right now. You must build WITHOUT_FORTH=yes and WITH_LOADER_LUA=yes. The good news is you don't need a full buildworld. You can just build stand (but don't forget the above options on both the build and the install). It's getting close. But there's no man page (it will be committed without one unless someone else writes it). I've done a lot of cleanup of the original GSoC code that was then cleaned up a bit by Rui, etc (all the names of the contributors are in the review and will be in the commit message). However, I'm sure the lua code could use some more cleanup. The menu code is especially inefficient at drawing boxes and could likely use some additional cleanup. Despite the slight roughness around the edges, I'm grateful to Zakary Nafziger's menu changes from this past fall. They look a lot better than the final GSoC state. I arbitrarily decided to follow the same conventions we do with style(9) for the lua code. The loader and os module code (the C code in lutil.c) could also use some close scrutiny. I've cleaned up the LUA code to match the new lua modules stuff, but haven't done this code at all and it likely could benefit from a final pass there. The original code was written before you could have integers, so there may be a couple of stray places that still use numbers. If anyone with a lot of Lua embedding experience could look, that would be great. Please let me know what you think. It's been a long road to get /stand into decent enough shape to allow us to build lua w/o changes to lua (OK, only 1 change to lua since there was a format that was forced to be floating point that couldn't change with a #define). It's also quite a bit different than either the final GSoC code, or the Rui branch, or the cleaned up, forward ported Rui branch. Most of my changes have been to the C glue code, though I did some tweaks to the lua code. Warner