From: Octavian Purdila <octavian.purdila@intel.com>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, thehajime@gmail.com,
Octavian Purdila <octavian.purdila@intel.com>
Subject: [RFC PATCH 00/28] Linux Kernel Library
Date: Tue, 3 Nov 2015 22:20:31 +0200 [thread overview]
Message-ID: <1446582059-17355-1-git-send-email-octavian.purdila@intel.com> (raw)
LKL (Linux Kernel Library) is aiming to allow reusing the Linux kernel code
as extensively as possible with minimal effort and reduced maintenance
overhead.
Examples of how LKL can be used are: creating userspace applications
(running on Linux and other operating systems) that can read or write Linux
filesystems or can use the Linux networking stack, creating kernel drivers
for other operating systems that can read Linux filesystems, bootloaders
support for reading/writing Linux filesystems, etc.
With LKL, the kernel code is compiled into an object file that can be
directly linked by applications. The API offered by LKL is based on the
Linux system call interface.
LKL is implemented as an architecture port in arch/lkl. It relies on host
operations defined by the application or a host library (tools/lkl/lib).
The latest LKL version can be found at git@github.com:lkl/linux.git
FAQ
===
Q: How is LKL different from UML?
A: UML provides a full OS environment (e.g. user/kernel separation, user
processes) and also has requirements (a filesystem, processes, etc.) that
makes it hard to use it for standalone applications. UML also relies
heavily on Linux hosts. On the other hand LKL is designed to be linked
directly with the application and hence does not have user/kernel
separation which makes it easier to use it in standalone applications.
Q: How is LKL different from LibOS?
A: LibOS re-implements high-level kernel APIs for timers, softirqs,
scheduling, sysctl, SLAB/SLUB, etc. LKL behaves like any arch port,
implementing the arch level operations requested by the Linux kernel. LKL
also offers a host interface so that support for multiple hosts can be
easily implemented.
Building LKL the host library and LKL applications
==================================================
% cd tools/lkl
% make
will build LKL as a object file, it will install it in tools/lkl/lib together
with the headers files in tools/lkl/include then will build the host library,
tests and a few of application examples:
* tests/boot - a simple applications that uses LKL and exercises the basic
LKL APIs
* fs2tar - a tool that converts a filesystem image to a tar archive
* cptofs/cpfromfs - a tool that copies files to/from a filesystem image
Supported hosts
===============
Currently LKL supports POSIX and Windows userspace applications. New hosts
can be added relatively easy if the host supports gcc and GNU ld. Previous
versions of LKL supported Windows kernel and Haiku kernel hosts.
Octavian Purdila (28):
asm-generic: atomic64: allow using generic atomic64 on 64bit platforms
kbuild: allow architectures to automatically define kconfig symbols
lkl: architecture skeleton for Linux kernel library
lkl: host interface
lkl: memory handling
lkl: kernel threads support
lkl: interrupt support
lkl: system call interface and application API
lkl: timers, time and delay support
lkl: memory mapped I/O support
lkl: basic kernel console support
init: allow architecture code to overide run_init_process
lkl: initialization and cleanup
lkl: plug in the build system
lkl tools: skeleton for host side library, tests and tools
lkl tools: host lib: add lkl_strerror and lkl_printf
lkl tools: host lib: memory mapped I/O helpers
lkl tools: host lib: virtio devices
lkl tools: host lib: virtio block device
lkl tools: host lib: filesystem helpers
lkl tools: host lib: posix host operations
lkl tools: "boot" test
lkl tools: tool that converts a filesystem image to tar
lkl tools: tool that reads/writes to/from a filesystem image
signal: use CONFIG_X86_32 instead of __i386__
asm-generic: vmlinux.lds.h: allow customized rodata section name
lkl: add support for Windows hosts
lkl tools: add support for Windows host
MAINTAINERS | 6 +
Makefile | 1 +
arch/lkl/.gitignore | 1 +
arch/lkl/Kconfig | 83 ++++++
arch/lkl/Makefile | 39 +++
arch/lkl/auto.conf | 1 +
arch/lkl/defconfig | 35 +++
arch/lkl/include/asm/Kbuild | 77 +++++
arch/lkl/include/asm/bitsperlong.h | 11 +
arch/lkl/include/asm/byteorder.h | 10 +
arch/lkl/include/asm/dma-mapping.h | 6 +
arch/lkl/include/asm/elf.h | 13 +
arch/lkl/include/asm/host_ops.h | 9 +
arch/lkl/include/asm/io.h | 104 +++++++
arch/lkl/include/asm/irq.h | 10 +
arch/lkl/include/asm/mutex.h | 7 +
arch/lkl/include/asm/page.h | 13 +
arch/lkl/include/asm/pgtable.h | 60 ++++
arch/lkl/include/asm/processor.h | 53 ++++
arch/lkl/include/asm/ptrace.h | 23 ++
arch/lkl/include/asm/setup.h | 12 +
arch/lkl/include/asm/thread_info.h | 82 +++++
arch/lkl/include/asm/unistd.h | 93 ++++++
arch/lkl/include/asm/vmlinux.lds.h | 10 +
arch/lkl/include/system/stdarg.h | 1 +
arch/lkl/include/uapi/asm/Kbuild | 38 +++
arch/lkl/include/uapi/asm/bitsperlong.h | 12 +
arch/lkl/include/uapi/asm/host_ops.h | 81 +++++
arch/lkl/include/uapi/asm/irq.h | 37 +++
arch/lkl/include/uapi/asm/sigcontext.h | 15 +
arch/lkl/include/uapi/asm/unistd.h | 256 ++++++++++++++++
arch/lkl/kernel/Makefile | 3 +
arch/lkl/kernel/asm-offsets.c | 1 +
arch/lkl/kernel/console.c | 41 +++
arch/lkl/kernel/irq.c | 131 ++++++++
arch/lkl/kernel/mem.c | 67 +++++
arch/lkl/kernel/misc.c | 57 ++++
arch/lkl/kernel/setup.c | 176 +++++++++++
arch/lkl/kernel/syscalls.c | 213 +++++++++++++
arch/lkl/kernel/threads.c | 235 +++++++++++++++
arch/lkl/kernel/time.c | 125 ++++++++
arch/lkl/kernel/vmlinux.lds.S | 45 +++
arch/lkl/scripts/headers_install.py | 117 ++++++++
include/asm-generic/atomic64.h | 2 +
include/asm-generic/vmlinux.lds.h | 9 +-
include/linux/atomic.h | 2 +-
include/linux/compiler-gcc.h | 4 +
init/main.c | 4 +-
kernel/signal.c | 2 +-
scripts/Makefile | 2 +
scripts/link-vmlinux.sh | 12 +-
tools/lkl/.gitignore | 4 +
tools/lkl/Makefile | 47 +++
tools/lkl/cptofs.c | 467 +++++++++++++++++++++++++++++
tools/lkl/fs2tar.c | 397 ++++++++++++++++++++++++
tools/lkl/include/.gitignore | 1 +
tools/lkl/include/lkl.h | 110 +++++++
tools/lkl/include/lkl_host.h | 44 +++
tools/lkl/lib/.gitignore | 3 +
tools/lkl/lib/fs.c | 218 ++++++++++++++
tools/lkl/lib/iomem.c | 119 ++++++++
tools/lkl/lib/iomem.h | 14 +
tools/lkl/lib/nt-host.c | 227 ++++++++++++++
tools/lkl/lib/posix-host.c | 206 +++++++++++++
tools/lkl/lib/utils.c | 177 +++++++++++
tools/lkl/lib/virtio.c | 365 +++++++++++++++++++++++
tools/lkl/lib/virtio.h | 94 ++++++
tools/lkl/lib/virtio_blk.c | 116 +++++++
tools/lkl/tests/boot.c | 514 ++++++++++++++++++++++++++++++++
tools/lkl/tests/boot.sh | 10 +
70 files changed, 5570 insertions(+), 10 deletions(-)
create mode 100644 arch/lkl/.gitignore
create mode 100644 arch/lkl/Kconfig
create mode 100644 arch/lkl/Makefile
create mode 100644 arch/lkl/auto.conf
create mode 100644 arch/lkl/defconfig
create mode 100644 arch/lkl/include/asm/Kbuild
create mode 100644 arch/lkl/include/asm/bitsperlong.h
create mode 100644 arch/lkl/include/asm/byteorder.h
create mode 100644 arch/lkl/include/asm/dma-mapping.h
create mode 100644 arch/lkl/include/asm/elf.h
create mode 100644 arch/lkl/include/asm/host_ops.h
create mode 100644 arch/lkl/include/asm/io.h
create mode 100644 arch/lkl/include/asm/irq.h
create mode 100644 arch/lkl/include/asm/mutex.h
create mode 100644 arch/lkl/include/asm/page.h
create mode 100644 arch/lkl/include/asm/pgtable.h
create mode 100644 arch/lkl/include/asm/processor.h
create mode 100644 arch/lkl/include/asm/ptrace.h
create mode 100644 arch/lkl/include/asm/setup.h
create mode 100644 arch/lkl/include/asm/thread_info.h
create mode 100644 arch/lkl/include/asm/unistd.h
create mode 100644 arch/lkl/include/asm/vmlinux.lds.h
create mode 100644 arch/lkl/include/system/stdarg.h
create mode 100644 arch/lkl/include/uapi/asm/Kbuild
create mode 100644 arch/lkl/include/uapi/asm/bitsperlong.h
create mode 100644 arch/lkl/include/uapi/asm/host_ops.h
create mode 100644 arch/lkl/include/uapi/asm/irq.h
create mode 100644 arch/lkl/include/uapi/asm/sigcontext.h
create mode 100644 arch/lkl/include/uapi/asm/unistd.h
create mode 100644 arch/lkl/kernel/Makefile
create mode 100644 arch/lkl/kernel/asm-offsets.c
create mode 100644 arch/lkl/kernel/console.c
create mode 100644 arch/lkl/kernel/irq.c
create mode 100644 arch/lkl/kernel/mem.c
create mode 100644 arch/lkl/kernel/misc.c
create mode 100644 arch/lkl/kernel/setup.c
create mode 100644 arch/lkl/kernel/syscalls.c
create mode 100644 arch/lkl/kernel/threads.c
create mode 100644 arch/lkl/kernel/time.c
create mode 100644 arch/lkl/kernel/vmlinux.lds.S
create mode 100755 arch/lkl/scripts/headers_install.py
create mode 100644 tools/lkl/.gitignore
create mode 100644 tools/lkl/Makefile
create mode 100644 tools/lkl/cptofs.c
create mode 100644 tools/lkl/fs2tar.c
create mode 100644 tools/lkl/include/.gitignore
create mode 100644 tools/lkl/include/lkl.h
create mode 100644 tools/lkl/include/lkl_host.h
create mode 100644 tools/lkl/lib/.gitignore
create mode 100644 tools/lkl/lib/fs.c
create mode 100644 tools/lkl/lib/iomem.c
create mode 100644 tools/lkl/lib/iomem.h
create mode 100644 tools/lkl/lib/nt-host.c
create mode 100644 tools/lkl/lib/posix-host.c
create mode 100644 tools/lkl/lib/utils.c
create mode 100644 tools/lkl/lib/virtio.c
create mode 100644 tools/lkl/lib/virtio.h
create mode 100644 tools/lkl/lib/virtio_blk.c
create mode 100644 tools/lkl/tests/boot.c
create mode 100755 tools/lkl/tests/boot.sh
--
2.1.0
next reply other threads:[~2015-11-03 20:23 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 20:20 Octavian Purdila [this message]
2015-11-03 20:20 ` [RFC PATCH 01/28] asm-generic: atomic64: allow using generic atomic64 on 64bit platforms Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 02/28] kbuild: allow architectures to automatically define kconfig symbols Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 03/28] lkl: architecture skeleton for Linux kernel library Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 04/28] lkl: host interface Octavian Purdila
2015-11-03 23:30 ` Hajime Tazaki
2015-11-03 20:20 ` [RFC PATCH 05/28] lkl: memory handling Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 06/28] lkl: kernel threads support Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 07/28] lkl: interrupt support Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 08/28] lkl: system call interface and application API Octavian Purdila
2015-11-07 23:24 ` Arnd Bergmann
2015-11-08 3:49 ` Octavian Purdila
2015-11-08 10:26 ` Arnd Bergmann
2015-11-03 20:20 ` [RFC PATCH 09/28] lkl: timers, time and delay support Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 10/28] lkl: memory mapped I/O support Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 11/28] lkl: basic kernel console support Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 12/28] init: allow architecture code to overide run_init_process Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 13/28] lkl: initialization and cleanup Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 14/28] lkl: plug in the build system Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 15/28] lkl tools: skeleton for host side library, tests and tools Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 16/28] lkl tools: host lib: add lkl_strerror and lkl_printf Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 17/28] lkl tools: host lib: memory mapped I/O helpers Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 18/28] lkl tools: host lib: virtio devices Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 19/28] lkl tools: host lib: virtio block device Octavian Purdila
2015-11-07 12:24 ` Richard Weinberger
2015-11-08 4:15 ` Octavian Purdila
2015-11-08 13:30 ` Richard Weinberger
2015-11-03 20:20 ` [RFC PATCH 20/28] lkl tools: host lib: filesystem helpers Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 21/28] lkl tools: host lib: posix host operations Octavian Purdila
2015-11-07 23:16 ` Arnd Bergmann
2015-11-08 4:01 ` Octavian Purdila
2015-11-08 10:35 ` Arnd Bergmann
2015-11-03 20:20 ` [RFC PATCH 22/28] lkl tools: "boot" test Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 23/28] lkl tools: tool that converts a filesystem image to tar Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 24/28] lkl tools: tool that reads/writes to/from a filesystem image Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 25/28] signal: use CONFIG_X86_32 instead of __i386__ Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 26/28] asm-generic: vmlinux.lds.h: allow customized rodata section name Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 27/28] lkl: add support for Windows hosts Octavian Purdila
2015-11-03 20:20 ` [RFC PATCH 28/28] lkl tools: add support for Windows host Octavian Purdila
2015-11-03 21:40 ` [RFC PATCH 00/28] Linux Kernel Library Richard Weinberger
2015-11-03 22:45 ` Richard W.M. Jones
2015-11-03 23:23 ` Hajime Tazaki
2015-11-03 23:24 ` Octavian Purdila
2015-11-04 13:22 ` Austin S Hemmelgarn
2015-11-04 13:50 ` Richard W.M. Jones
2015-11-04 14:15 ` Octavian Purdila
2015-11-07 0:35 ` Richard Weinberger
2015-11-07 7:19 ` Richard W.M. Jones
2015-11-07 10:48 ` Richard W.M. Jones
2015-11-09 16:35 ` Octavian Purdila
2015-11-08 4:16 ` Octavian Purdila
2015-11-08 4:36 ` Octavian Purdila
2015-11-03 23:06 ` Octavian Purdila
[not found] ` <1670BE0E-C0E0-4D45-BF16-1FF60C298149@gmail.com>
2015-11-09 15:11 ` Octavian Purdila
2015-11-08 13:45 ` Hajime Tazaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1446582059-17355-1-git-send-email-octavian.purdila@intel.com \
--to=octavian.purdila@intel.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thehajime@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.