From owner-freebsd-hackers@freebsd.org Mon Feb 27 13:31:46 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 B6D25CEDD43 for ; Mon, 27 Feb 2017 13:31:46 +0000 (UTC) (envelope-from sauravsachidanand@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (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 40D25F42 for ; Mon, 27 Feb 2017 13:31:46 +0000 (UTC) (envelope-from sauravsachidanand@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id u108so22323941wrb.3 for ; Mon, 27 Feb 2017 05:31:46 -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=F0pcIX/RreV0yKVd/G6lddgGPC/S6/9qTV9CmXLYJHo=; b=eyQizDgEw3UtmuM/5MYWSF1Q6c57jbbDOiiuFRMUO5WVdwSB0CpvIFXaVFysVY+7AN sZTjt52LyGdQCyCH+P5DU5SIriQyAZia9lsNS1Jk4vOFWKP6iquu0AOdaKsPIXEISaLe 0vPpd7Yt2i0zjGfU5IHzjTnXluWdLWLalQFbU+D83ysxm2VVfUSRLLyZmPT3ydULT0zw ZBVv00zzNZBu0T3TImMT4Uzd+D4tQpaiNnZyN1LJF3G+v6riaBvT+WAcehOYECbAZrFp Rq46coan0Hu9z8gWejjGnSKlhG3hgoQTeywPehZDQLqJMQcLbHIyZoz0vOOIO4UE8v7e bdDA== 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=F0pcIX/RreV0yKVd/G6lddgGPC/S6/9qTV9CmXLYJHo=; b=qX2fknvQrmvp6u8RLSjboSSSl0DWMu87yhv26Gc9FFfo53y0ezdmvJ6JoHd4f8Z4gA TyNmqTln8DTnFDmRM/JprOmiAbOD+yAr5YVmhla87QpN90MqIZ4Z7HmZMyOT4JvObjqt /Lt2rgHc//Mf5Ga0CeXn/a1c9uQiSzBzhY0ZXbMZcXC+ZxT7VkqylvzCBTOSXW5Vp1Mp dwHj+Ax0LWJgGQITH8LERHImC+sK/uPmerG9yD1jBm9pOQbgRqPKEMmqP5buD9lI+ct4 AHwCEmAGAq/YgUYqu+dMvD5SOI1uDKZPwoKj1gpVFulE9MHE1Es1YxrCg0+3UbIdQEHu 5Ctg== X-Gm-Message-State: AMke39kRDeGZ8Ez4HxW1vetjIoquMbfPaWH66mC9WWcNLBuah1Rqv/RAOfRbkZmFFdQpy1U6WigXMslSm1N34w== X-Received: by 10.223.178.205 with SMTP id g71mr13192331wrd.158.1488202304540; Mon, 27 Feb 2017 05:31:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.144.6 with HTTP; Mon, 27 Feb 2017 05:31:43 -0800 (PST) From: Saurav Sachidanand Date: Mon, 27 Feb 2017 19:01:43 +0530 Message-ID: Subject: [GSoC 2017] Original proposal: Port kernel Lua to FreeBSD To: freebsd-hackers@freebsd.org 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:31:46 -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