Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lkl fbsd #220

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7b03790
checkpatch: avoid showing uint*_t warnings for tools/ files
Sep 21, 2015
2daea04
checkpatch: avoid showing BIT_ULL warnings for tools/ files
Sep 21, 2015
d7f3cf0
asm-generic: atomic64: allow using generic atomic64 on 64bit platforms
Jul 23, 2015
0cc6fd2
kbuild: allow architectures to automatically define kconfig symbols
Nov 2, 2015
bdcd92b
lkl: architecture skeleton for Linux kernel library
Sep 15, 2015
c37082e
lkl: host interface
Nov 2, 2015
5456f35
lkl: memory handling
Sep 15, 2015
359c42b
lkl: kernel threads support
Sep 16, 2015
cbf0c57
lkl: interrupt support
Sep 16, 2015
f088db9
lkl: system call interface and application API
Sep 16, 2015
bba49f9
lkl: timers, time and delay support
Sep 16, 2015
ea4fda5
lkl: memory mapped I/O support
Sep 17, 2015
6e8fb31
lkl: basic kernel console support
Sep 17, 2015
47493a4
init: allow architecture code to overide run_init_process
Aug 19, 2015
1ee887e
lkl: initialization and cleanup
Sep 17, 2015
a7ef6b6
lkl: plug in the build system
Sep 17, 2015
4fc2010
lkl tools: skeleton for host side library, tests and tools
Sep 18, 2015
d72f515
lkl tools: host lib: add lkl_strerror and lkl_printf
Sep 18, 2015
1a8636c
lkl tools: host lib: memory mapped I/O helpers
Sep 18, 2015
da15a1b
lkl tools: host lib: virtio devices
Sep 18, 2015
059ac9c
lkl tools: host lib: virtio block device
Sep 18, 2015
5fd23ea
lkl tools: host lib: filesystem helpers
Sep 18, 2015
2cd5d37
lkl tools: host lib: posix host operations
Sep 18, 2015
461a58d
lkl tools: "boot" test
Sep 18, 2015
6c52ac5
lkl tools: tool that converts a filesystem image to tar
Sep 18, 2015
c8e0586
lkl tools: tool that reads/writes to/from a filesystem image
Sep 18, 2015
e2b0cf0
signal: use CONFIG_X86_32 instead of __i386__
Sep 29, 2015
4145718
asm-generic: vmlinux.lds.h: allow customized rodata section name
Oct 27, 2015
c9411ed
lkl: add support for Windows hosts
Nov 3, 2015
d5bc73f
lkl tools: add support for Windows host
Nov 3, 2015
90814da
lkl: add documentation
Sep 28, 2015
8ec7b89
lkl: fix zero page implementation
Nov 8, 2015
fe49079
lkl: add more filesystem related system calls
Nov 8, 2015
d88e0bd
lkl tools: git .gitignore
Nov 8, 2015
c4591a9
lkl tools: add a new lkl_dirfd API
Nov 8, 2015
2a3cf55
lkl tools: add lklfuse
Nov 8, 2015
5ee93e6
lkl: sys_statfs64 takes a middle size parameter
cemeyer Nov 9, 2015
69259d8
lkl: headers_install: Use env(1) to locate python binary
cemeyer Nov 9, 2015
40ce53e
lkl tools: Makefile: Drop lkl.o:lkl.o circular dependency
cemeyer Nov 9, 2015
4efe442
lkl: convert makefile echo \t to inline tab
cemeyer Nov 9, 2015
ed4362d
lkl tools: Add kernel clean to clean target
cemeyer Nov 9, 2015
2bd6dca
tools lkl: Use OUTPUT_FORMAT variable instead of duplicating LD invoc…
cemeyer Nov 9, 2015
5b51c31
lkl tools: build with GCC, turn on the optimizer and more warnings
cemeyer Nov 9, 2015
ce68a0c
lkl tools: Fix compiler warnings
cemeyer Nov 9, 2015
3aa8768
lkl: add support for 64bit FreeBSD
cemeyer Nov 9, 2015
dc4223e
lkl: On FreeBSD, use hw.ncpu sysctl instead of Linux nproc(1)
cemeyer Nov 9, 2015
12f7c73
lkl tools: add support for 64bit FreeBSD
cemeyer Nov 11, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lkl tools: add support for 64bit FreeBSD
Signed-off-by: Conrad Meyer <cem@FreeBSD.org>
[Octavian: squash commits]
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
  • Loading branch information
cemeyer authored and Octavian Purdila committed Nov 11, 2015

Verified

This commit was signed with the committer’s verified signature. The key has expired.
333fred Fred Silberberg
commit 12f7c7375d8c212590edfb42acdf821f3e507169
15 changes: 15 additions & 0 deletions Documentation/lkl.txt
Original file line number Diff line number Diff line change
@@ -19,6 +19,21 @@ LKL is implemented as an architecture port in arch/lkl. It uses host operations
defined by the application or a host library (tools/lkl/lib).


Building LKL on FreeBSD
-----------------------

$ pkg install binutils gcc49

If you don't have a gcc binary:
$ ln -sf /usr/local/bin/gcc49 /usr/local/bin/gcc

Prefer ports binutils:
$ export PATH=/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib64/ccache

$ cd tools/lkl
$ gmake


Building LKL the host library and LKL applications
--------------------------------------------------

8 changes: 6 additions & 2 deletions tools/lkl/Makefile
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ OUTPUT_FORMAT=$(shell $(LD) -r -print-output-format)

lib_source = $(filter-out %-host.c,$(wildcard lib/*.c))
source = $(wildcard tests/*.c)
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf32-i386))
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf32-i386 elf64-x86-64-freebsd))
source += $(wildcard *.c)
lib_source += lib/posix-host.c
LDFLAGS += -lpthread -lrt
@@ -26,7 +26,7 @@ else
$(error Unrecognized platform: $(OUTPUT_FORMAT))
endif

ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64))
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf64-x86-64-freebsd))
CFLAGS += -D_FILE_OFFSET_BITS=64
endif

@@ -56,5 +56,9 @@ clean:

fs2tar: LDFLAGS += -larchive
lklfuse: LDFLAGS += -lfuse
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64-freebsd))
cptofs: LDFLAGS += -largp
fs2tar: LDFLAGS += -largp
endif
cpfromfs: cptofs
if ! [ -e $@ ]; then ln -s $< $@; fi
4 changes: 4 additions & 0 deletions tools/lkl/cptofs.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifdef __FreeBSD__
#include <sys/param.h>
#endif

#include <stdio.h>
#include <time.h>
#include <argp.h>
6 changes: 5 additions & 1 deletion tools/lkl/lib/posix-host.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <pthread.h>
#include <malloc.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <signal.h>
@@ -189,7 +189,11 @@ void fd_do_rw(union lkl_disk_backstore bs, unsigned int type, unsigned int prio,
break;
case LKL_DEV_BLK_TYPE_FLUSH:
case LKL_DEV_BLK_TYPE_FLUSH_OUT:
#ifdef __linux__
err = fdatasync(bs.fd);
#else
err = fsync(bs.fd);
#endif
break;
default:
lkl_dev_blk_complete(bufs, LKL_DEV_BLK_STATUS_UNSUP, 0);
8 changes: 6 additions & 2 deletions tools/lkl/lib/virtio.h
Original file line number Diff line number Diff line change
@@ -82,13 +82,17 @@ void virtio_dev_complete(struct virtio_dev_req *req, uint32_t len);
(type *)((char *)(ptr) - __builtin_offsetof(type, member))

#ifndef __MINGW32__
#include <endian.h>
#ifdef __FreeBSD__
#include <sys/endian.h>
#else
#include <endian.h>
#endif /* __FreeBSD__ */
#else /* !__MINGW32__ */
#define le32toh(x) (x)
#define le16toh(x) (x)
#define htole32(x) (x)
#define htole16(x) (x)
#define le64toh(x) (x)
#endif
#endif /* __MINGW32__ */

#endif /* _LKL_LIB_VIRTIO_H */