diff --git a/apps/tests.h b/apps/tests.h index 7e431b87..19cf416f 100644 --- a/apps/tests.h +++ b/apps/tests.h @@ -39,8 +39,8 @@ //#define START_JOIN_TEST //#define START_PI //#define START_MEASURE_CTX_SWITCH -//#define START_HELLO -#define START_TESTS +#define START_HELLO +//#define START_TESTS //#define START_JACOBI // does our demos require GFX support? diff --git a/arch/x86/kernel/gdt.c b/arch/x86/kernel/gdt.c index c31797bb..8bb3b827 100644 --- a/arch/x86/kernel/gdt.c +++ b/arch/x86/kernel/gdt.c @@ -29,7 +29,7 @@ gdt_ptr_t gp; tss_t task_state_segments[MAX_CORES] __attribute__ ((aligned (PAGE_SIZE))); -static unsigned char kstacks[MAX_TASKS][KERNEL_STACK_SIZE] __attribute__ ((aligned (PAGE_SIZE))) = {[0][0 ... KERNEL_STACK_SIZE-1] = 0xCD}; +static unsigned char kstacks[MAX_TASKS][KERNEL_STACK_SIZE] __attribute__ ((aligned (PAGE_SIZE))) = {[0 ... MAX_TASKS-1][0 ... KERNEL_STACK_SIZE-1] = 0xCD}; size_t default_stack_pointer = (size_t) kstacks[0] + KERNEL_STACK_SIZE - 16; // => stack is 16byte aligned // currently, our kernel has full access to the ioports static gdt_entry_t gdt[GDT_ENTRIES] = {[0 ... GDT_ENTRIES-1] = {0, 0, 0, 0, 0, 0}}; diff --git a/include/metalsvm/tasks.h b/include/metalsvm/tasks.h index 47c3c3f5..d1e70627 100644 --- a/include/metalsvm/tasks.h +++ b/include/metalsvm/tasks.h @@ -82,11 +82,15 @@ int create_kernel_task_on_core(tid_t* id, entry_point_t ep, void* arg, uint8_t p */ static inline int create_kernel_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio) { - uint32_t core_id, flags; + uint32_t core_id; - flags = irq_nested_disable(); +#if MAX_CORES > 1 + uint32_t flags = irq_nested_disable(); core_id = CORE_ID; irq_nested_enable(flags); +#else + core_id = 0; +#endif return create_kernel_task_on_core(id, ep, arg, prio, core_id); } @@ -116,11 +120,15 @@ int create_user_task_on_core(tid_t* id, const char* fame, char** argv, uint32_t */ static inline int create_user_task(tid_t* id, const char* fame, char** argv) { - uint32_t core_id, flags; + uint32_t core_id; - flags = irq_nested_disable(); +#if MAX_CORES > 1 + uint32_t flags = irq_nested_disable(); core_id = CORE_ID; irq_nested_enable(flags); +#else + core_id = 0; +#endif return create_user_task_on_core(id, fame, argv, core_id); }