From 468dde6ca98852fc3684ecc41fe48753d8f06607 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 12 Aug 2018 09:01:15 +0200 Subject: [PATCH 01/28] guarantee that _start is at the beginning of the kernel --- arch/x86_64/kernel/entry.asm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/kernel/entry.asm b/arch/x86_64/kernel/entry.asm index b635f6f6b..0a65f135a 100644 --- a/arch/x86_64/kernel/entry.asm +++ b/arch/x86_64/kernel/entry.asm @@ -41,6 +41,11 @@ MSR_KERNEL_GS_BASE equ 0xc0000102 ; We use a special name to map this section at the begin of our kernel ; => Multiboot expects its magic number at the beginning of the kernel. SECTION .mboot +global _start +_start: + jmp start64 + +align 4 global base global limit global cpu_freq @@ -71,7 +76,6 @@ SECTION .mboot global hcgateway global hcmask global host_logical_addr - magic db "hermit " base dq 0 limit dq 0 cpu_freq dd 0 @@ -121,8 +125,7 @@ boot_pgt: SECTION .ktext align 4 -global _start -_start: +start64: ; do we run in ring 0? mov eax, cs cmp eax, 0x8 From 04688f4a245a7690fd81be99ed9c9aecd8db48c1 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 12 Aug 2018 09:30:39 +0200 Subject: [PATCH 02/28] add libomp-hermit to the packet list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 135c93bfb..ff1776f63 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ toolchain, which can be installed as follows: ```bash $ echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/ubuntu bionic main" | sudo tee -a /etc/apt/sources.list $ sudo apt-get -qq update -$ sudo apt-get install binutils-hermit newlib-hermit pte-hermit gcc-hermit libhermit +$ sudo apt-get install binutils-hermit newlib-hermit pte-hermit gcc-hermit libomp-hermit libhermit ``` For non-Debian based systems, a docker image with the complete toolchain is provided and can be installed as follows: From 939e484031462b87ff27a381bc3be5286417ef6f Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 16 Aug 2018 08:55:16 +0200 Subject: [PATCH 03/28] set migration parameters via configuration file --- caves | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caves b/caves index e7c1d301d..9f19fde7b 160000 --- a/caves +++ b/caves @@ -1 +1 @@ -Subproject commit e7c1d301d210e083e3279bb3cdac1408b52178f2 +Subproject commit 9f19fde7b78ea85d3f7ff06252316f75579df617 From 3c262a505dd3fe821015beb2dc2f8e3903196f4c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 25 Aug 2018 00:44:47 +0200 Subject: [PATCH 04/28] add howto to install toolchain on Debian 9 --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff1776f63..32789599f 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,25 @@ the HermitCore kernel and applications you need: ### HermitCore cross-toolchain -We provide prebuilt packages (currently Ubuntu 18.04 only) of the HermitCore +We provide prebuilt packages for Ubuntu 18.04 and Debian 9 of the HermitCore toolchain, which can be installed as follows: +**Ubuntu 18.04** + ```bash $ echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/ubuntu bionic main" | sudo tee -a /etc/apt/sources.list $ sudo apt-get -qq update $ sudo apt-get install binutils-hermit newlib-hermit pte-hermit gcc-hermit libomp-hermit libhermit ``` -For non-Debian based systems, a docker image with the complete toolchain is provided and can be installed as follows: +**Debian 9** + +```bash +$ echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/debian stretch main" | sudo tee -a /etc/apt/sources.list +$ sudo apt-get -qq update +$ sudo apt-get install binutils-hermit newlib-hermit pte-hermit gcc-hermit libomp-hermit libhermit + +For unsupported systems, a docker image with the complete toolchain is provided and can be installed as follows: ```bash $ docker pull rwthos/hermitcore From 04f0a001e08a4454208cdd376b70daa6d5bb7934 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 25 Aug 2018 00:48:03 +0200 Subject: [PATCH 05/28] remove typo --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 32789599f..7948c8040 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ $ sudo apt-get install binutils-hermit newlib-hermit pte-hermit gcc-hermit libom $ echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/debian stretch main" | sudo tee -a /etc/apt/sources.list $ sudo apt-get -qq update $ sudo apt-get install binutils-hermit newlib-hermit pte-hermit gcc-hermit libomp-hermit libhermit +``` For unsupported systems, a docker image with the complete toolchain is provided and can be installed as follows: From 1a8e06a365bebd238409eb8562c505e05438107f Mon Sep 17 00:00:00 2001 From: Simon Pickartz Date: Tue, 4 Sep 2018 13:09:23 +0200 Subject: [PATCH 06/28] add interface providing the free list to the hypervisor (#101) Add an interface for sharing the free list with the hypervisor. This can be used to accelerate the cold migration of guests. --- arch/aarch64/mm/memory.c | 5 +++++ arch/x86_64/mm/memory.c | 5 +++++ caves | 2 +- drivers/net/uhyve-net.c | 6 +++--- include/hermit/memory.h | 5 +++++ include/hermit/stddef.h | 2 ++ include/hermit/vma.h | 1 + mm/vma.c | 16 +++++++++++++++- 8 files changed, 37 insertions(+), 5 deletions(-) diff --git a/arch/aarch64/mm/memory.c b/arch/aarch64/mm/memory.c index 9649d1643..a9c5d5a15 100644 --- a/arch/aarch64/mm/memory.c +++ b/arch/aarch64/mm/memory.c @@ -64,6 +64,11 @@ atomic_int64_t total_pages = ATOMIC_INIT(0); atomic_int64_t total_allocated_pages = ATOMIC_INIT(0); atomic_int64_t total_available_pages = ATOMIC_INIT(0); +free_list_t *get_free_list(void) +{ + return free_start; +} + size_t get_pages(size_t npages) { size_t i, ret = 0; diff --git a/arch/x86_64/mm/memory.c b/arch/x86_64/mm/memory.c index 0786057f9..9d997acc6 100644 --- a/arch/x86_64/mm/memory.c +++ b/arch/x86_64/mm/memory.c @@ -134,6 +134,11 @@ out: return ret; } +free_list_t *get_free_list(void) +{ + return free_start; +} + size_t get_pages(size_t npages) { return __get_pages(npages, PAGE_SIZE); diff --git a/caves b/caves index 9f19fde7b..1e1a23bc8 160000 --- a/caves +++ b/caves @@ -1 +1 @@ -Subproject commit 9f19fde7b78ea85d3f7ff06252316f75579df617 +Subproject commit 1e1a23bc82a71c5326b1cc0a76883ee2a52a7f3f diff --git a/drivers/net/uhyve-net.c b/drivers/net/uhyve-net.c index d77760eed..108789eb1 100755 --- a/drivers/net/uhyve-net.c +++ b/drivers/net/uhyve-net.c @@ -58,7 +58,7 @@ #include "uhyve-net.h" -#define UHYVE_IRQ 11 +#define UHYVE_IRQ_NET 11 static int8_t uhyve_net_init_ok = 0; static struct netif* mynetif = NULL; @@ -257,8 +257,8 @@ err_t uhyve_netif_init (struct netif* netif) LWIP_DEBUGF(NETIF_DEBUG, ("\n")); uhyve_netif->ethaddr = (struct eth_addr *)netif->hwaddr; - LOG_INFO("uhye_netif uses irq %d\n", UHYVE_IRQ); - irq_install_handler(32+UHYVE_IRQ, uhyve_irqhandler); + LOG_INFO("uhye_netif uses irq %d\n", UHYVE_IRQ_NET); + irq_install_handler(32+UHYVE_IRQ_NET, uhyve_irqhandler); /* * Initialize the snmp variables and counters inside the struct netif. diff --git a/include/hermit/memory.h b/include/hermit/memory.h index 7a3a828a5..cd0fd95e6 100644 --- a/include/hermit/memory.h +++ b/include/hermit/memory.h @@ -36,12 +36,17 @@ #ifndef __MEMORY_H__ #define __MEMORY_H__ +typedef struct free_list free_list_t; + /** @brief Initialize the memory subsystem */ int memory_init(void); /** @brief Request physical page frames */ size_t get_pages(size_t npages); +/** @brief Returns a pointer to the free_list */ +free_list_t *get_free_list(void); + /** @brief Get a single page * * Convenience function: uses get_pages(1); diff --git a/include/hermit/stddef.h b/include/hermit/stddef.h index 11166ed2b..4681baec0 100644 --- a/include/hermit/stddef.h +++ b/include/hermit/stddef.h @@ -74,6 +74,8 @@ extern size_t image_size; #define UHYVE_PORT_NETREAD 0x680 #define UHYVE_PORT_NETSTAT 0x700 +#define UHYVE_PORT_FREELIST 0x720 + /* Ports and data structures for uhyve command line arguments and envp * forwarding */ #define UHYVE_PORT_CMDSIZE 0x740 diff --git a/include/hermit/vma.h b/include/hermit/vma.h index 5e465112b..5d9a0d458 100644 --- a/include/hermit/vma.h +++ b/include/hermit/vma.h @@ -37,6 +37,7 @@ #define __VMA_H__ #include +#include #include #ifdef __cplusplus diff --git a/mm/vma.c b/mm/vma.c index fd388222c..ad0f84d37 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -32,7 +32,10 @@ #include #include #include +#include +#include +#define UHYVE_IRQ_FREELIST 12 /* * Note that linker symbols are not variables, they have no memory allocated for * maintaining a value, rather their address is their value. @@ -49,6 +52,13 @@ static vma_t vma_boot = { VMA_MIN, VMA_MIN, VMA_HEAP }; static vma_t* vma_list = &vma_boot; spinlock_irqsave_t hermit_mm_lock = SPINLOCK_IRQSAVE_INIT; +typedef struct free_list free_list_t; + +static void uhyve_irq_freelist_handler(struct state* s) +{ + outportl(UHYVE_PORT_FREELIST, (unsigned)virt_to_phys((size_t)get_free_list())); +} + int vma_init(void) { int ret; @@ -68,7 +78,11 @@ int vma_init(void) ret = vma_add(HEAP_START, HEAP_START+HEAP_SIZE, VMA_NO_ACCESS); if (BUILTIN_EXPECT(ret, 0)) goto out; - LOG_INFO("Reserve space for the heap: 0x%llx - 0x%llx\n", HEAP_START, HEAP_START+HEAP_SIZE-1); + LOG_INFO("Reserve space for the heap: 0x%llx - 0x%llx\n", HEAP_START, HEAP_START+HEAP_SIZE-1); + + // install IRQ handler for the migration interface + LOG_INFO("freelist channel uses irq %d\n", UHYVE_IRQ_FREELIST); + irq_install_handler(32+UHYVE_IRQ_FREELIST, uhyve_irq_freelist_handler); // we might move the architecture specific VMA regions to a // seperate function vma_arch_init() From e4e5412f4cf275493093d4be141c1de2f14b493a Mon Sep 17 00:00:00 2001 From: Simon Pickartz Date: Wed, 5 Sep 2018 12:58:47 +0200 Subject: [PATCH 07/28] update within submodule --- caves | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caves b/caves index 1e1a23bc8..13e016bc4 160000 --- a/caves +++ b/caves @@ -1 +1 @@ -Subproject commit 1e1a23bc82a71c5326b1cc0a76883ee2a52a7f3f +Subproject commit 13e016bc42cc33875963086352eecb56be4994e2 From 9553b9a284bedfea73c6d81fd499e53a2c3c893a Mon Sep 17 00:00:00 2001 From: Simon Pickartz Date: Thu, 13 Sep 2018 08:56:22 +0200 Subject: [PATCH 08/28] update caves submodule --- caves | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caves b/caves index 13e016bc4..30a805155 160000 --- a/caves +++ b/caves @@ -1 +1 @@ -Subproject commit 13e016bc42cc33875963086352eecb56be4994e2 +Subproject commit 30a805155ceece0ac744675defff4f6e02bd5d62 From 564ccbfe8cc92d96f7f382673110396deb5d3e3a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 15 Sep 2018 16:45:20 +0200 Subject: [PATCH 09/28] remove identical expression see issue #103 --- drivers/net/mmnif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mmnif.c b/drivers/net/mmnif.c index cecf5c773..0dd907fe7 100644 --- a/drivers/net/mmnif.c +++ b/drivers/net/mmnif.c @@ -583,7 +583,7 @@ err_t mmnif_init(struct netif *netif) } LOG_INFO("mmnif_init() : size of mm_rx_buffer_t : %d\n", sizeof(mm_rx_buffer_t)); - if (BUILTIN_EXPECT(!header_phy_start_address || !header_phy_start_address || !phy_isle_locks, 0)) + if (BUILTIN_EXPECT(!header_phy_start_address || !phy_isle_locks, 0)) { LOG_ERROR("mmnif init(): invalid heap or header address\n"); goto out; From 0a322e8591c4d2d083d74f045f1d09409c77c618 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 17 Oct 2018 08:23:25 +0200 Subject: [PATCH 10/28] use LwIP 2.1 as IP stack - add basic support of the system call "poll" --- lwip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lwip b/lwip index e99a84c18..d4d77f78a 160000 --- a/lwip +++ b/lwip @@ -1 +1 @@ -Subproject commit e99a84c1814ae85c7d2826000a0a823fc11167d0 +Subproject commit d4d77f78a667d9773a235b010027ce1ec7973daf From 58d2d3120ab7faf4b9941eca3414ce58aeece62a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 15 Jan 2019 23:26:20 +0100 Subject: [PATCH 11/28] remove obsolete call of apic_eoi --- arch/x86_64/kernel/irq.c | 6 ++++-- arch/x86_64/mm/page.c | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index de109c989..3d05d8b1c 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86_64/kernel/irq.c @@ -310,6 +310,10 @@ size_t** irq_handler(struct state *s) // Check if timers have expired that would unblock tasks check_workqueues_in_irqhandler((int) s->int_no); + if (s->int_no >= 32) { + apic_eoi(s->int_no); + } + if ((s->int_no == 32) || (s->int_no == 123)) { // a timer interrupt may have caused unblocking of tasks ret = scheduler(); @@ -318,8 +322,6 @@ size_t** irq_handler(struct state *s) ret = scheduler(); } - apic_eoi(s->int_no); - #ifdef MEASURE_IRQ if (go) { diff = rdtsc() - diff; diff --git a/arch/x86_64/mm/page.c b/arch/x86_64/mm/page.c index be0f34830..c6bf87a51 100644 --- a/arch/x86_64/mm/page.c +++ b/arch/x86_64/mm/page.c @@ -310,7 +310,6 @@ default_handler: // clear cr2 to signalize that the pagefault is solved by the pagefault handler write_cr2(0); - apic_eoi(s->int_no); //do_abort(); sys_exit(-EFAULT); } From b771ad7b3c32be3f02481bf41f9ad5c470d8dd5f Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 19 Mar 2019 15:14:31 +0100 Subject: [PATCH 12/28] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7948c8040..612c86770 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ After a reboot of the system, register the HermitCore loader at your system with following command: ```bash -$ sudo -c sh 'echo ":hermit:M:7:\\x42::/opt/hermit/bin/proxy:" > /proc/sys/fs/binfmt_misc/register' +$ sudo -c sh 'echo ":hermit:M:7:\\xff::/opt/hermit/bin/proxy:" > /proc/sys/fs/binfmt_misc/register' ``` The IP device between HermitCore and Linux currently does not support IPv6. From 7a4652daa41d0cabc8632cf0a8df6702cd6f9267 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 3 May 2019 12:23:45 +0200 Subject: [PATCH 13/28] remove typos --- drivers/net/vioif.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/vioif.c b/drivers/net/vioif.c index 68c6a345f..5225d575a 100644 --- a/drivers/net/vioif.c +++ b/drivers/net/vioif.c @@ -365,7 +365,7 @@ err_t vioif_init(struct netif* netif) uint32_t required = (1UL << VIRTIO_NET_F_MAC) | (1UL << VIRTIO_NET_F_STATUS); if ((features & required) != required) { - LOG_ERROR("Host isn't able to fulfill HermireCore's requirements\n"); + LOG_ERROR("Host isn't able to fulfill HermitCore's requirements\n"); outportb(vioif->iobase + VIRTIO_PCI_STATUS, VIRTIO_CONFIG_S_FAILED); kfree(vioif); return ERR_ARG; @@ -373,11 +373,11 @@ err_t vioif_init(struct netif* netif) required = features; required &= ~(1UL << VIRTIO_NET_F_CTRL_VQ); - required &= ~(1UL << VIRTIO_NET_F_GUEST_TSO4); - required &= ~(1UL << VIRTIO_NET_F_GUEST_TSO6); - required &= ~(1UL << VIRTIO_NET_F_GUEST_UFO); - required &= ~(1UL << VIRTIO_RING_F_EVENT_IDX); - required &= ~(1UL << VIRTIO_NET_F_MRG_RXBUF); + required &= ~(1UL << VIRTIO_NET_F_GUEST_TSO4); + required &= ~(1UL << VIRTIO_NET_F_GUEST_TSO6); + required &= ~(1UL << VIRTIO_NET_F_GUEST_UFO); + required &= ~(1UL << VIRTIO_RING_F_EVENT_IDX); + required &= ~(1UL << VIRTIO_NET_F_MRG_RXBUF); required &= ~(1UL << VIRTIO_NET_F_MQ); LOG_INFO("wanted guest features 0x%x\n", required); From cf36fe039c0a797c2cc9d0ac0fc3019eb5882525 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:04:23 +0200 Subject: [PATCH 14/28] configure initial CI script to build HermitCore on GitLab --- .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++ Dockerfile | 19 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..f12c52ff2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +variables: + IMAGE: ubuntu:with-hermitcore + +stages: + - prepare + - build + #- test + +# Stage: prepare +############################################################################## + +docker: + stage: prepare + script: + - docker build -t ${IMAGE} . + tags: + - shell + - linux + +# Stage: build +############################################################################## + +build: + stage: build + script: + - mkdir -p build + - cd build + - cmake -DTOOLCHAIN_BIN_DIR=/opt/hermit/bin -DCMAKE_INSTALL_PREFIX=/opt/hermit .. + - make + image: ${IMAGE} + tags: + - docker + artifacts: + untracked: true + expire_in: 1 week + paths: + - ./ + +# Stage: test +############################################################################## + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..de6f05fe9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Download base image ubuntu 18.04 +FROM ubuntu:18.04 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packets from ubuntu repository +RUN apt-get install -y apt-transport-https curl cmake bsdmainutils wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ ca-certificates build-essential libtool + +# add path to hermitcore packets +RUN echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/ubuntu bionic main" | tee -a /etc/apt/sources.list + +# Update Software repository +RUN apt-get -qq update + +# Install required packets from ubuntu repository +RUN apt-get install -y --allow-unauthenticated binutils-hermit newlib-hermit pte-hermit gcc-hermit libhermit libomp-hermit + +ENV PATH="/opt/hermit/bin:${PATH}" +ENV EDITOR=vim From 8144b9c575e5adf4284ff7bed53d46773b7cb1a6 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:09:37 +0200 Subject: [PATCH 15/28] remove dependency to bsdmainutils --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index de6f05fe9..9a90e104d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive # Install required packets from ubuntu repository -RUN apt-get install -y apt-transport-https curl cmake bsdmainutils wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ ca-certificates build-essential libtool +RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ ca-certificates build-essential libtool # add path to hermitcore packets RUN echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/ubuntu bionic main" | tee -a /etc/apt/sources.list From a6275e22a276b290f7321329b6bbbb58907fdd27 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:11:23 +0200 Subject: [PATCH 16/28] remove dependency from ca-certificates --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9a90e104d..e9d8db935 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive # Install required packets from ubuntu repository -RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ ca-certificates build-essential libtool +RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ build-essential libtool # add path to hermitcore packets RUN echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/ubuntu bionic main" | tee -a /etc/apt/sources.list From f7cd7d10dd1ebe07fc6f0d8c4f9d0e3581fcc3a2 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:14:19 +0200 Subject: [PATCH 17/28] update repository before installing packages --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index e9d8db935..2ba7366cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive +# Update Software repository +RUN apt-get -qq update + # Install required packets from ubuntu repository RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ build-essential libtool From ff5b8133b818c941e9a4fa4817fc5c4c38f0cfb5 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:21:42 +0200 Subject: [PATCH 18/28] fetch also submodules --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f12c52ff2..55b3eed3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ variables: IMAGE: ubuntu:with-hermitcore + GIT_SUBMODULE_STRATEGY: normal stages: - prepare From 59ba65154eb46fefdcf770e5b61cad078b0555ad Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:25:08 +0200 Subject: [PATCH 19/28] install also hexdump within the docker image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2ba7366cf..039ff21ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -qq update # Install required packets from ubuntu repository -RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ build-essential libtool +RUN apt-get install -y apt-transport-https curl wget vim nano git binutils autoconf automake make cmake qemu-kvm qemu-system-x86 nasm gcc g++ build-essential libtool bsdmainutils # add path to hermitcore packets RUN echo "deb [trusted=yes] https://dl.bintray.com/hermitcore/ubuntu bionic main" | tee -a /etc/apt/sources.list From 3a74531fffd4e96c04ed263fe070f849e499ef81 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:36:50 +0200 Subject: [PATCH 20/28] build artifacts only for the build directory --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55b3eed3e..e4134d67c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,7 @@ build: untracked: true expire_in: 1 week paths: - - ./ + - ./build # Stage: test ############################################################################## From 57369539dac98fa4150af8267f8a545b1447bd38 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:45:45 +0200 Subject: [PATCH 21/28] add basic tests --- .gitlab-ci.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4134d67c..7b77e2379 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: stages: - prepare - build - #- test + - test # Stage: prepare ############################################################################## @@ -39,4 +39,18 @@ build: # Stage: test ############################################################################## - +test: + stage: test + script: + - cd build + - export TDIR=./local_prefix/opt/hermit/x86_64-hermit/extra + - export FILES="$TDIR/tests/hello + - export PROXY=./local_prefix/opt/hermit/bin/proxy + - for f in $FILES; do echo "check $f..."; HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 timeout --kill-after=5m 5m $PROXY $f || exit 1; done + image: ${IMAGE} + tags: + - docker + only: + - merge_requests + dependencies: + - build From 8ab724c63e07441bc20cf6495ab4647a3194d043 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:47:02 +0200 Subject: [PATCH 22/28] remove typos --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b77e2379..d38e8a132 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,13 +44,11 @@ test: script: - cd build - export TDIR=./local_prefix/opt/hermit/x86_64-hermit/extra - - export FILES="$TDIR/tests/hello + - export FILES="$TDIR/tests/hello" - export PROXY=./local_prefix/opt/hermit/bin/proxy - for f in $FILES; do echo "check $f..."; HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 timeout --kill-after=5m 5m $PROXY $f || exit 1; done image: ${IMAGE} tags: - docker - only: - - merge_requests dependencies: - build From 7baeecb5355d22c5db8f4260ccb9496472145274 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 21:52:06 +0200 Subject: [PATCH 23/28] add SMP tests --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d38e8a132..b73a47c31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,9 +44,10 @@ test: script: - cd build - export TDIR=./local_prefix/opt/hermit/x86_64-hermit/extra - - export FILES="$TDIR/tests/hello" + - export FILES="$TDIR/tests/hello $TDIR/tests/hellof $TDIR/tests/hello++ $TDIR/tests/thr_hello $TDIR/tests/pi $TDIR/benchmarks/stream $TDIR/benchmarks/basic $TDIR/tests/signals $TDIR/tests/test-malloc $TDIR/tests/test-malloc-mt $TDIR/tests/argv_envp" - export PROXY=./local_prefix/opt/hermit/bin/proxy - for f in $FILES; do echo "check $f..."; HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 timeout --kill-after=5m 5m $PROXY $f || exit 1; done + - for f in $FILES; do echo "check $f..."; HERMIT_ISLE=qemu HERMIT_CPUS=2 HERMIT_KVM=0 HERMIT_VERBOSE=1 timeout --kill-after=5m 5m $PROXY $f || exit 1; done image: ${IMAGE} tags: - docker From a3e6ff5eb7b141166ae2018c2430e5b407cd0e5c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 22:03:50 +0200 Subject: [PATCH 24/28] add network test --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b73a47c31..2a7912967 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,6 +48,13 @@ test: - export PROXY=./local_prefix/opt/hermit/bin/proxy - for f in $FILES; do echo "check $f..."; HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 timeout --kill-after=5m 5m $PROXY $f || exit 1; done - for f in $FILES; do echo "check $f..."; HERMIT_ISLE=qemu HERMIT_CPUS=2 HERMIT_KVM=0 HERMIT_VERBOSE=1 timeout --kill-after=5m 5m $PROXY $f || exit 1; done + - HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 HERMIT_APP_PORT=8000 $PROXY $TDIR/tests/server & + - sleep 10 + - curl http://127.0.0.1:8000/help + - sleep 1 + - curl http://127.0.0.1:8000/hello + - sleep 1 + - kill $! image: ${IMAGE} tags: - docker From 44c796303415687a29187c219bb6f84d4491de39 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 17 May 2019 23:33:25 +0200 Subject: [PATCH 25/28] print also cpu information --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a7912967..40c2b6afe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,7 @@ build: test: stage: test script: + - lscpu - cd build - export TDIR=./local_prefix/opt/hermit/x86_64-hermit/extra - export FILES="$TDIR/tests/hello $TDIR/tests/hellof $TDIR/tests/hello++ $TDIR/tests/thr_hello $TDIR/tests/pi $TDIR/benchmarks/stream $TDIR/benchmarks/basic $TDIR/tests/signals $TDIR/tests/test-malloc $TDIR/tests/test-malloc-mt $TDIR/tests/argv_envp" From 5b02bc429e9c6bcd641c5cef6952f887280354f5 Mon Sep 17 00:00:00 2001 From: Jonathan Klimt Date: Sun, 31 Mar 2019 10:29:08 +0200 Subject: [PATCH 26/28] Improve readme (#105) * Fixed "magic number" from x42 to xff * Improved README (proxy set up) --- README.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 612c86770..58d7a530e 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ HTTP request sent, awaiting response... 200 OK Length: 30681434 (29M) [application/x-gzip] Saving to: ‘cmake-3.7.2-Linux-x86_64.tar.gz’ -cmake-3.7.2-Linux-x86_64.tar.gz 100%[===================>] 29,26M 3,74MB/s in 12s +cmake-3.7.2-Linux-x86_64.tar.gz 100%[===================>] 29,26M 3,74MB/s in 12s 2017-03-28 16:13:50 (2,48 MB/s) - ‘cmake-3.7.2-Linux-x86_64.tar.gz’ saved [30681434/30681434] @@ -159,22 +159,27 @@ $ make install **Note:** If you use the cross compiler outside of this repository, the compiler uses per default the library operating systems located by the toolchain (e.g. `/opt/hermit/x86_64-hermit/lib/libhermit.a`). -## Proxy +## Starting Applications with the Proxy tool -Part of HermitCore is a small helper tool, which is called *proxy*. -This tool helps to start HermitCore applications within a virtual machine or bare-metal on a NUMA node. -In principle it is a bridge to the Linux system. -If the proxy is register as loader to the Linux system, HermitCore applications can be started like common Linux applications. -The proxy can be registered with following command. +HermitCore applications are currently started with a small helper tool called `proxy`. +This tool is sets up a virtual machine or bare-metal on a NUMA node and bridges certain functionality from the application to the Linux host. + +To start a HermitCore application, hand the executable to the proxy: +```bash +/opt/hermit/bin/proxy myHermiCoreApplication +``` + +*Optional:* The proxy can be registered as loader for HermitCore _elf_ files to the Linux system via [binfmt_misc](https://en.wikipedia.org/wiki/Binfmt_misc), so that HermitCore applications can be started like common Linux applications. ```bash $ sudo -c sh 'echo ":hermit:M:7:\\xff::/opt/hermit/bin/proxy:" > /proc/sys/fs/binfmt_misc/register' $ # dirct call of a HermitCore application $ /opt/hermit/x86_64-hermit/extra/tests/hello +Hello World!!! ``` -Otherwise the proxy must be started directly and get the path to HermitCore application as argument. -Afterwards, the proxy start the HermitCore applications within a VM ore bare-metal on a NUMA node. +The proxy starts the HermitCore applications within a VM. +The application host (QEMU, Uhyve or bare-metal on a NUMA node as multi-kernel) can be set via the environment variable `$HERMIT_ISLE`. ```bash $ # using QEMU From b65e7333956d32aadb8c382084e2cd579a54944c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Dre=C3=9Fen?= Date: Sat, 1 Jun 2019 09:17:34 +0200 Subject: [PATCH 27/28] Fixed #109 - sys_write() (#110) removes incorrect use of arguments --- kernel/syscall.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 2b5c7ac05..86d5865de 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -282,7 +282,13 @@ ssize_t sys_write(int fd, const char* buf, size_t len) } if (fd > 2) - i = socket_recv(s, &i, sizeof(i)); + { + int temp = socket_recv(s, &i, sizeof(i)); + if (temp < 0) + { + return (ssize_t) temp; + } + } spinlock_irqsave_unlock(&lwip_lock); From 0ed7b7399fcbf9f440d6c6f5cc93906a7a75e005 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 1 Jun 2019 09:21:21 +0200 Subject: [PATCH 28/28] bump version number to 0.2.10 --- .bintray_descriptor.json | 2 +- .travis.yml | 2 +- CMakeLists.txt | 2 +- cmake/HermitCore-Configuration.cmake | 2 +- tests.sh | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.bintray_descriptor.json b/.bintray_descriptor.json index d97dfb644..8b00534c0 100644 --- a/.bintray_descriptor.json +++ b/.bintray_descriptor.json @@ -13,7 +13,7 @@ }, "version": { - "name": "0.2.9", + "name": "0.2.10", "desc": "HermitCore's kernel as libOS", "gpgSign": false }, diff --git a/.travis.yml b/.travis.yml index 186a27279..2da31d31d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ script: -c "cd /work; ./tests.sh ${OS_TYPE} ${OS_NAME}" before_deploy: - cd ${TRAVIS_BUILD_DIR} -- dpkg-deb -b tmp libhermit-0.2.9-all.deb +- dpkg-deb -b tmp libhermit-0.2.10-all.deb - sed -i "s/REPLACE_REPO/$OS_TYPE/" .bintray_descriptor.json - sed -i "s/REPLACE_OS/$OS_NAME/" .bintray_descriptor.json deploy: diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ff8bb9d6..b2fab232b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,7 +217,7 @@ set(CPACK_SYSTEM_NAME all) set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 2) -set(CPACK_PACKAGE_VERSION_PATCH 9) +set(CPACK_PACKAGE_VERSION_PATCH 10) set(CPACK_PACKAGE_CONTACT "Stefan Lankes ") diff --git a/cmake/HermitCore-Configuration.cmake b/cmake/HermitCore-Configuration.cmake index e2d85c08f..f93a2e5c7 100644 --- a/cmake/HermitCore-Configuration.cmake +++ b/cmake/HermitCore-Configuration.cmake @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION "0.2.9" CACHE STRING +set(PACKAGE_VERSION "0.2.10" CACHE STRING "HermitCore current version") set(MAX_CORES "512" CACHE STRING diff --git a/tests.sh b/tests.sh index 066ecf54d..a6804e771 100755 --- a/tests.sh +++ b/tests.sh @@ -44,7 +44,7 @@ mkdir -p build cd build cmake -DTOOLCHAIN_BIN_DIR=/opt/hermit/bin -DCMAKE_INSTALL_PREFIX=/opt/hermit -DBOOTSTRAP=true .. make hermit-bootstrap -#checkinstall -D -y --exclude=build --pkggroup=main --maintainer=stefan@eonerc.rwth-aachen.de --pkgsource=https://hermitcore.org --pkgname=libhermit --pkgversion=0.2.9 --pkglicense=BSD make hermit-bootstrap-install +#checkinstall -D -y --exclude=build --pkggroup=main --maintainer=stefan@eonerc.rwth-aachen.de --pkgsource=https://hermitcore.org --pkgname=libhermit --pkgversion=0.2.10 --pkglicense=BSD make hermit-bootstrap-install make hermit-bootstrap-install rm -rf * cmake -DTOOLCHAIN_BIN_DIR=/opt/hermit/bin -DCMAKE_INSTALL_PREFIX=/opt/hermit .. @@ -52,8 +52,8 @@ make -j1 package cd .. mkdir -p tmp -dpkg-deb -R build/libhermit-0.2.9-all.deb tmp -#dpkg-deb -R build/libhermit_0.2.9-1_amd64.deb tmp +dpkg-deb -R build/libhermit-0.2.10-all.deb tmp +#dpkg-deb -R build/libhermit_0.2.10-1_amd64.deb tmp rm -rf build/*.deb build/_CPack_Packages #exit 0