#include <arch/x86/start_aps.h>
#include <arch/x86/ipi_notify.h>
#include <barrelfish_kpi/cpu_arch.h>
-#include <target/k1om/barrelfish_kpi/cpu_target.h>
+#include <target/x86_64/barrelfish_kpi/cpu_target.h>
#include <barrelfish_kpi/asm_inlines_arch.h>
-
#include <coreboot.h>
#include <kcb.h>
panic("error while mapping physical memory!");
}
- kcb_current = (struct kcb *)
- local_phys_to_mem((lpaddr_t) kcb_current);
-
/*
* Also reset the global descriptor table (GDT), so we get
* segmentation again and can catch interrupts/exceptions (the IDT
if (kernel_ticks_enabled) {
timing_calibrate();
bool periodic = true;
-#ifdef CONFIG_ONESHOT_TIMER
+ #ifdef CONFIG_ONESHOT_TIMER
// we probably need a global variable like kernel_ticks_enabled
periodic = false;
-#endif
+ #endif
apic_timer_init(false, periodic);
timing_apic_timer_set_ms(kernel_timeslice);
} else {
dest += BASE_PAGE_SIZE;
}
+ apic_bsp = magic == K1OM_BOOT_MAGIC;
+
// XXX: print kernel address for debugging with gdb
printf("Kernel starting at address 0x%"PRIxLVADDR"\n", local_phys_to_mem(dest));
* If magic value does not match what we expect, we cannot proceed safely.
*/
switch (magic) {
- case MULTIBOOT_INFO_MAGIC:
- /* kernel is started with multiboot information available */
- mb = (struct multiboot_info *) pointer;
-
- // Construct the global structure and store its address to retrieve it
- // across relocation
- memset(&global->locks, 0, sizeof(global->locks));
- addr_global = (uint64_t) global;
-
- printf("Barrelfish (with multiboot )\n");
- break;
-
case KERNEL_BOOT_MAGIC:
/* kernel is started by another kernel */
global = (struct global*) pointer;
glbl_core_data->start_free_ram =
ROUND_UP(max(multiboot_end_addr(mb), (uintptr_t)&_end_kernel),
BASE_PAGE_SIZE);
-
printf("Start Free RAM at 0x%x (%i MB)\n",
glbl_core_data->start_free_ram,
glbl_core_data->start_free_ram >> 20);
/// Pointer to bootinfo structure for init
static struct bootinfo *bootinfo = (struct bootinfo *)BOOTINFO_BASE;
-static struct spawn_state spawn_state;
+struct spawn_state spawn_state;
/**
* Page map level 4 table for init user address space.
// we run out of root cnode slots by aligning the memory we declare free
// to 1MB.
lpaddr_t init_alloc_end = alloc_phys(0);
- lpaddr_t align = 1UL << 20; // 1MB
+ lpaddr_t align = 4UL << 20; // 4MB
// XXX: No checks are in place to make sure that init_alloc_end_aligned
// is actually a valid physical memory address (e.g. a location at which
// RAM exists.
// Urpc frame cap
struct cte *urpc_frame_cte = caps_locate_slot(CNODE(spawn_state.taskcn),
TASKCN_SLOT_MON_URPC);
- // XXX: Create as devframe so the memory is not zeroed out
- err = caps_create_new(ObjType_DevFrame, core_data->urpc_frame_base,
- core_data->urpc_frame_bits, my_core_id,
- core_data->urpc_frame_bits, urpc_frame_cte);
+ // use fact that cap is foreign to avoid zeroing it
+ assert(core_data->src_core_id != my_core_id);
+ err = caps_create_new(ObjType_Frame, core_data->urpc_frame_base,
+ core_data->urpc_frame_bits,
+ core_data->urpc_frame_bits, core_data->src_core_id,
+ urpc_frame_cte);
assert(err_is_ok(err));
- urpc_frame_cte->cap.type = ObjType_Frame;
lpaddr_t urpc_ptr = gen_phys_to_local_phys(urpc_frame_cte->cap.u.frame.base);
/* Map urpc frame at MON_URPC_BASE */