1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

Merge branch 'devel'

This commit is contained in:
Stefan Lankes 2019-06-01 09:45:48 +02:00
commit 63e67e1af1
21 changed files with 153 additions and 25 deletions

View file

@ -13,7 +13,7 @@
},
"version": {
"name": "0.2.9",
"name": "0.2.10",
"desc": "HermitCore's kernel as libOS",
"gpgSign": false
},

63
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,63 @@
variables:
IMAGE: ubuntu:with-hermitcore
GIT_SUBMODULE_STRATEGY: normal
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:
- ./build
# Stage: test
##############################################################################
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"
- 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
dependencies:
- build

View file

@ -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:

View file

@ -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 <slankes@eonerc.rwth-aachen.de>")

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
# Download base image ubuntu 18.04
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 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
# 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

View file

@ -47,16 +47,26 @@ 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

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);
}

2
caves

@ -1 +1 @@
Subproject commit 9f19fde7b78ea85d3f7ff06252316f75579df617
Subproject commit 30a805155ceece0ac744675defff4f6e02bd5d62

View file

@ -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

View file

@ -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;

View file

@ -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.

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -37,6 +37,7 @@
#define __VMA_H__
#include <hermit/stddef.h>
#include <hermit/memory.h>
#include <asm/page.h>
#ifdef __cplusplus

2
lwip

@ -1 +1 @@
Subproject commit e99a84c1814ae85c7d2826000a0a823fc11167d0
Subproject commit d4d77f78a667d9773a235b010027ce1ec7973daf

View file

@ -32,7 +32,10 @@
#include <hermit/spinlock.h>
#include <hermit/errno.h>
#include <hermit/logging.h>
#include <asm/io.h>
#include <asm/irq.h>
#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()

View file

@ -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