From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hajime Tazaki Subject: [RFC v4 21/25] um lkl: add documentation Date: Mon, 30 Mar 2020 23:45:53 +0900 Message-ID: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: Received: from mail-pl1-f193.google.com ([209.85.214.193]:45803 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgC3OtQ (ORCPT ); Mon, 30 Mar 2020 10:49:16 -0400 Received: by mail-pl1-f193.google.com with SMTP id t4so853436plq.12 for ; Mon, 30 Mar 2020 07:49:15 -0700 (PDT) In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-um@lists.infradead.org Cc: Octavian Purdila , Akira Moroo , linux-kernel-library@freelists.org, linux-arch@vger.kernel.org, Chenyang Zhong , Conrad Meyer , Gustavo Bittencourt , Motomu Utsumi , Patrick Collins , Thomas Liebetraut , Yuan Liu From: Octavian Purdila A document describing brief introduction of LKL, why it is needed, and how it is used is added. The document is located under uml/ directory. Cc: Chenyang Zhong Cc: Conrad Meyer Cc: Gustavo Bittencourt Cc: H.K. Jerry Chu Cc: Motomu Utsumi Cc: Patrick Collins Cc: Thomas Liebetraut Cc: Yuan Liu Signed-off-by: Octavian Purdila --- Documentation/virt/uml/lkl.txt | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/virt/uml/lkl.txt diff --git a/Documentation/virt/uml/lkl.txt b/Documentation/virt/uml/lkl.txt new file mode 100644 index 000000000000..f6d581092331 --- /dev/null +++ b/Documentation/virt/uml/lkl.txt @@ -0,0 +1,64 @@ + +Introduction +============ + +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 one of the mode of UML (arch/um). It uses host operations +defined by the application or a host library (tools/lkl/lib). + + +Supported hosts +=============== + +The supported host for now is Linux (x86 architecture) userspace applications. + + +Building LKL the host library and LKL applications +================================================== + + $ make -C tools/lkl + +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 + +* tests/net-test - a simple applications that uses network feature of LKL and + exercises the basic network-related 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 + +* lklfuse - a tool that can mount a filesystem image in userspace, + without root privileges, using FUSE + + +Building LKL on Ubuntu +----------------------- + + $ sudo apt-get install libfuse-dev libarchive-dev xfsprogs + + # Optional, if you would like to be able to run tests + $ sudo apt-get install btrfs-tools + $ pip install yamlish junit_xml + + $ make -C tools/lkl + + # To check that everything works: + $ cd tools/lkl + $ make run-tests -- 2.21.0 (Apple Git-122.2)