From owner-freebsd-hackers@freebsd.org Mon Feb 27 13:28:44 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C948CEDBBA for ; Mon, 27 Feb 2017 13:28:44 +0000 (UTC) (envelope-from sauravsachidanand@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 29EB7D13; Mon, 27 Feb 2017 13:28:44 +0000 (UTC) (envelope-from sauravsachidanand@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id v77so62521207wmv.0; Mon, 27 Feb 2017 05:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=IYzC8mYtEgChgpdkUDJCAzJe2n3eyF6ANb5Ue8xbMiI=; b=ujd+78SlWaQA1BZCeawch4eCJKpEhXUxml5W/tC3EwpwCaul6rU8U3N+BWZVrYa1tC hOYkOu3axRGQRsYav8zRJHJVbqzPvZVjn8q4AZVdargeplzH7LZFeIOVuB9Aq5KEFQLL fkAj2pZc6M2gBmqf45HxomA2AvZzfwusau6Hj2jFR1g+7cdtnWcH4YRzA2jSZQCpr7L2 bd3s00HICH/9VQ48ltxOsYRWhtELhljBIFEG7G0NaFzLUuyQcSEIUPjyEBuadXZ2rROn sN2lRIhky9x85Z92J+myxjdA7hru2qTLpuisSas4LJL5c7iVR5zanS/6zyUFMVzlDbvF JuIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IYzC8mYtEgChgpdkUDJCAzJe2n3eyF6ANb5Ue8xbMiI=; b=DUSbq97k5IIgT2rUSCwgqLnEyU7RdwYFlFsdATfAwP1wy3QpnHVvhzkUm06WMp2wbD xulRvCGoZL1aUf/0hxTgphL4UfKuTh1bz4zoR+8XRbbocQ4WCdRYEozWtu0bf4+QfvmS aQ2QL4wcw7BL40GoSfK6MbmfWASHujxjdh7u2/6MYL74xBAIkeNVfZDgc2sopct2UoLH LZoMWRp5nLNYl/3qy9eDldL3K627gJl9DSsx0dIon0TaqI6piqUN7oqQGsEmK/5OdMk8 utlChggzfaGDlkZM1Pwj30iD+R+TKOm5cv3ii56DUS1kDxU/1ETCjnvoWPvFoMCqYXvJ sySg== X-Gm-Message-State: AMke39n9SjA7bYB/mVTnKj91CkGqT6O1omQFkuVvLnQlnz7dPK5YBMlf2Y8H8gYFtSJLUENM1J9aUfeiVlYZog== X-Received: by 10.28.98.194 with SMTP id w185mr14447609wmb.84.1488202122055; Mon, 27 Feb 2017 05:28:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.144.6 with HTTP; Mon, 27 Feb 2017 05:28:41 -0800 (PST) From: Saurav Sachidanand Date: Mon, 27 Feb 2017 18:58:41 +0530 Message-ID: Subject: [GSoC 2017] Original proposal: Port kernel Lua to FreeBSD To: soc-admins@freebsd.org, freebsd-hackers@freebsd.org X-Mailman-Approved-At: Mon, 27 Feb 2017 13:32:37 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 13:28:44 -0000 Hello FreeBSD community, I'm =E2=80=8B Saurav Sachidanand, and I'm=E2=80=8B a CS sophomore studying in India =E2=80=8B. I have an interest in operating systems development and wish to contribute to the FreeBSD community. I'm proficient with C and have some experience in kernel programming. Hence, I'd like to propose an original project for GSoC 2017 that I feel would benefit this community. In past years, the Lua interpreter was ported to run inside the Linux and NetBSD kernel [1]. Lua was chosen because it's interpreter is very small (~= 240 KB) compared to that of Python or Ruby, it's MIT licensed, and is almost freestanding. A working demonstration of it is a packet filtering algorithm written entirely in kernel Lua [2]. Specifically, my proposal would be to port the following that are currently written for NetBSD: - the modified Lua VM source code with _KERNEL preprocessor directives to exclude user-space functionality like floating point, the io and os module in the standard library, etc. [3] - the kernel module device driver for /dev/lua, to which Lua scripts are fed to be executed [4], [5] - the luactl user-space program to control the Lua device and a couple of sysctl variables which serve similar purpose [6], [7] And then: - run the Lua test suite targeting whatever we support in the kernel to make sure it works [8] - and write Lua bindings to the kernel interfaces that would interest the FreeBSD community Since NetBSD and FreeBSD have similar kernel interfaces (mutexes, linked lists, device switch interface), the porting shouldn't involve too much code refactoring. Also, this would all be an experiment in that we don't fully know what the real world use cases might be, but it would attract more people to writing kernel code who otherwise wouldn't because of having to do everything in C. And it would be interesting to carry out it out in FreeBSD as well since it has a larger community than NetBSD. I humbly request anyone who is interested in this project to be my potential mentor(s) for GSoC. More slides on kernel Lua in NetBSD - [9], [10]. Thanks, Saurav [1] - http://www.netbsd.org/~lneto/dls14.pdf [2] - https://www.netbsd.org/~lneto/eurobsdcon14.pdf [3] - https://github.com/jsonn/src/tree/trunk/external/mit/lua/dist/src [4] - https://github.com/IIJ-NetBSD/netbsd-src/tree/master/sys/modules/lua [5] - https://github.com/IIJ-NetBSD/netbsd-src/tree/master/sys/modules/luasystm [6] - https://github.com/IIJ-NetBSD/netbsd-src/tree/master/sbin/luactl [7] - http://netbsd.gw.com/cgi-bin/man-cgi?lua+4+NetBSD-current [8] - http://www.lua.org/tests/ [9] - https://www.netbsd.org/gallery/presentations/mbalmer/fosdem2012/kernel_mode= _lua.pdf [10] - https://www.lua.org/wshop13/Cormack.pdf