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:
commit
0d60d2aaf8
14 changed files with 30 additions and 23 deletions
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
|
||||
"version": {
|
||||
"name": "0.2.1",
|
||||
"name": "0.2.2",
|
||||
"desc": "HermitCore's kernel as libOS",
|
||||
"gpgSign": false
|
||||
},
|
||||
|
|
|
@ -199,7 +199,7 @@ set(CPACK_SYSTEM_NAME all)
|
|||
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR 0)
|
||||
set(CPACK_PACKAGE_VERSION_MINOR 2)
|
||||
set(CPACK_PACKAGE_VERSION_PATCH 1)
|
||||
set(CPACK_PACKAGE_VERSION_PATCH 2)
|
||||
|
||||
set(CPACK_PACKAGE_CONTACT "Stefan Lankes <slankes@eonerc.rwth-aachen.de>")
|
||||
|
||||
|
|
|
@ -905,12 +905,7 @@ extern int set_idle_task(void);
|
|||
#if MAX_CORES > 1
|
||||
int smp_start(void)
|
||||
{
|
||||
x2apic_enable();
|
||||
|
||||
// reset APIC and set id
|
||||
lapic_reset();
|
||||
|
||||
LOG_DEBUG("Processor %d (local id %d) is entering its idle task\n", apic_cpu_id(), atomic_int32_read(¤t_boot_id));
|
||||
LOG_DEBUG("Try to initialize processor (local id %d)\n", atomic_int32_read(¤t_boot_id));
|
||||
|
||||
// use the same gdt like the boot processors
|
||||
gdt_flush();
|
||||
|
@ -921,6 +916,12 @@ int smp_start(void)
|
|||
// enable additional cpu features
|
||||
cpu_detection();
|
||||
|
||||
x2apic_enable();
|
||||
|
||||
// reset APIC
|
||||
lapic_reset();
|
||||
|
||||
LOG_DEBUG("Processor %d (local id %d) is entering its idle task\n", apic_cpu_id(), atomic_int32_read(¤t_boot_id));
|
||||
LOG_DEBUG("CR0 of core %u: 0x%x\n", atomic_int32_read(¤t_boot_id), read_cr0());
|
||||
online[atomic_int32_read(¤t_boot_id)] = 1;
|
||||
|
||||
|
|
|
@ -202,9 +202,9 @@ Lremap:
|
|||
add rdi, 8
|
||||
; note: the whole code segement has to fit in the first pgd
|
||||
cmp rcx, rsi
|
||||
jnb Lno_pml4_init
|
||||
jnl Lno_pml4_init
|
||||
cmp rcx, r11
|
||||
jb Lremap
|
||||
jl Lremap
|
||||
|
||||
Lno_pml4_init:
|
||||
; Set CR3
|
||||
|
@ -416,7 +416,6 @@ extern irq_handler
|
|||
extern get_current_stack
|
||||
extern finish_task_switch
|
||||
extern syscall_handler
|
||||
extern kernel_stack
|
||||
|
||||
global getcontext
|
||||
align 64
|
||||
|
|
|
@ -126,7 +126,6 @@ size_t* get_current_stack(void)
|
|||
else
|
||||
stptr = (stptr + DEFAULT_STACK_SIZE - sizeof(size_t)) & ~0x1F;
|
||||
|
||||
set_per_core(kernel_stack, stptr);
|
||||
set_tss(stptr, (size_t) curr_task->ist_addr + KERNEL_STACK_SIZE - 0x10);
|
||||
|
||||
return curr_task->last_stack_pointer;
|
||||
|
@ -193,9 +192,11 @@ int create_default_frame(task_t* task, entry_point_t ep, void* arg, uint32_t cor
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define USE_MWAIT
|
||||
|
||||
void wait_for_task(void)
|
||||
{
|
||||
#if 1
|
||||
#ifndef USE_MWAIT
|
||||
HALT;
|
||||
#else
|
||||
if (!has_mwait()) {
|
||||
|
@ -214,7 +215,7 @@ void wait_for_task(void)
|
|||
|
||||
void wakeup_core(uint32_t core_id)
|
||||
{
|
||||
#if 0
|
||||
#ifdef USE_MWAIT
|
||||
// if mwait is available, an IPI isn't required to wakeup the core
|
||||
if (has_mwait())
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set(PACKAGE_VERSION "0.2.1" CACHE STRING
|
||||
set(PACKAGE_VERSION "0.2.2" CACHE STRING
|
||||
"HermitCore current version")
|
||||
|
||||
set(MAX_CORES "512" CACHE STRING
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
#include <netif/etharp.h>
|
||||
#include <net/e1000.h>
|
||||
|
||||
#if USE_E1000
|
||||
|
||||
#define RX_BUF_LEN (2048)
|
||||
#define TX_BUF_LEN (1792)
|
||||
|
||||
|
@ -603,3 +605,5 @@ oom:
|
|||
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include <hermit/stddef.h>
|
||||
#include <hermit/spinlock.h>
|
||||
|
||||
#ifdef USE_E1000
|
||||
|
||||
#define NUM_RX_DESCRIPTORS 64
|
||||
#define NUM_TX_DESCRIPTORS 64
|
||||
|
||||
|
@ -324,3 +326,5 @@ typedef struct e1000if {
|
|||
err_t e1000if_init(struct netif* netif);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -83,9 +83,6 @@ typedef unsigned int tid_t;
|
|||
struct task;
|
||||
DECLARE_PER_CORE(struct task*, current_task);
|
||||
|
||||
/* allows fast access to the kernel stack */
|
||||
DECLARE_PER_CORE(char*, kernel_stack);
|
||||
|
||||
#if MAX_CORES > 1
|
||||
/* allows fast access to the core id */
|
||||
DECLARE_PER_CORE(uint32_t, __core_id);
|
||||
|
|
|
@ -206,8 +206,10 @@ static int init_netifs(void)
|
|||
goto success;
|
||||
if ((err = netifapi_netif_add(&default_netif, ip_2_ip4(&ipaddr), ip_2_ip4(&netmask), ip_2_ip4(&gw), NULL, rtl8139if_init, ethernet_input)) == ERR_OK)
|
||||
goto success;
|
||||
#ifdef USE_E1000
|
||||
if ((err = netifapi_netif_add(&default_netif, ip_2_ip4(&ipaddr), ip_2_ip4(&netmask), ip_2_ip4(&gw), NULL, e1000if_init, ethernet_input)) == ERR_OK)
|
||||
goto success;
|
||||
#endif
|
||||
|
||||
LOG_ERROR("Unable to add the network interface: err = %d\n", err);
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ static readyqueues_t readyqueues[1] = {[0] = {task_table+0, NULL, 0, 0, 0, {[0 .
|
|||
#endif
|
||||
|
||||
DEFINE_PER_CORE(task_t*, current_task, task_table+0);
|
||||
DEFINE_PER_CORE(char*, kernel_stack, NULL);
|
||||
|
||||
#if MAX_CORES > 1
|
||||
DEFINE_PER_CORE(uint32_t, __core_id, 0);
|
||||
|
@ -282,7 +281,6 @@ int multitasking_init(void)
|
|||
task_table[0].prio = IDLE_PRIO;
|
||||
task_table[0].stack = (char*) ((size_t)&boot_stack + core_id * KERNEL_STACK_SIZE);
|
||||
task_table[0].ist_addr = (char*)&boot_ist;
|
||||
set_per_core(kernel_stack, task_table[0].stack + KERNEL_STACK_SIZE - 0x10);
|
||||
set_per_core(current_task, task_table+0);
|
||||
arch_init_task(task_table+0);
|
||||
|
||||
|
@ -307,7 +305,6 @@ int set_idle_task(void)
|
|||
task_table[i].last_stack_pointer = NULL;
|
||||
task_table[i].stack = (char*) ((size_t)&boot_stack + core_id * KERNEL_STACK_SIZE);
|
||||
task_table[i].ist_addr = create_stack(KERNEL_STACK_SIZE);
|
||||
set_per_core(kernel_stack, task_table[i].stack + KERNEL_STACK_SIZE - 0x10);
|
||||
task_table[i].prio = IDLE_PRIO;
|
||||
task_table[i].heap = NULL;
|
||||
readyqueues[core_id].idle = task_table+i;
|
||||
|
|
2
lwip
2
lwip
|
@ -1 +1 @@
|
|||
Subproject commit 51d48fe0c67131da346c9ef280b2019c77f6e607
|
||||
Subproject commit c21d911aa4f178563dc102f595d1d97dd8471458
|
2
tests.sh
2
tests.sh
|
@ -9,6 +9,8 @@ PROXY=build/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
|
||||
|
||||
# test echo server at port 8000
|
||||
HERMIT_ISLE=qemu HERMIT_CPUS=1 HERMIT_KVM=0 HERMIT_VERBOSE=1 HERMIT_APP_PORT=8000 $PROXY $TDIR/tests/server &
|
||||
sleep 10
|
||||
|
|
|
@ -522,7 +522,7 @@ static int multi_init(char *path)
|
|||
free(result);
|
||||
|
||||
// wait until HermitCore is sucessfully booted
|
||||
wait_hermit_available();
|
||||
//wait_hermit_available();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue