Exemplo n.º 1
0
Arquivo: head32.c Projeto: E-LLP/n900
void __init i386_start_kernel(void)
{
	reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");

#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		u64 ramdisk_image = boot_params.hdr.ramdisk_image;
		u64 ramdisk_size  = boot_params.hdr.ramdisk_size;
		u64 ramdisk_end   = ramdisk_image + ramdisk_size;
		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
	}
#endif
	reserve_early(init_pg_tables_start, init_pg_tables_end,
			"INIT_PG_TABLE");

	reserve_ebda_region();

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 */

	start_kernel();
}
Exemplo n.º 2
0
asmlinkage void __init
init_arch(int argc, char **argv, char **envp, int *prom_vec)
{
	unsigned int s;

	/* Determine which MIPS variant we are running on. */
	cpu_probe();

	prom_init(argc, argv, envp, prom_vec);

#ifdef CONFIG_SGI_IP22
	sgi_sysinit();
#endif

	cpu_report();

	/*
	 * Determine the mmu/cache attached to this machine,
	 * then flush the tlb and caches.  On the r4xx0
	 * variants this also sets CP0_WIRED to zero.
	 */
	loadmmu();

	/* Disable coprocessors and set FPU for 16/32 FPR register model */
	clear_cp0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
	set_cp0_status(ST0_CU0);

	start_kernel();
}
Exemplo n.º 3
0
void __init x86_64_start_reservations(char *real_mode_data)
{
	copy_bootdata(__va(real_mode_data)); /* &boot_params에 복사 */

	/* text부터 bss까지의 커널 영역을 memblock에 예약한다. */
	memblock_reserve(__pa_symbol(&_text),
			 __pa_symbol(&__bss_stop) - __pa_symbol(&_text));

#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	/* 같이 로드한 INITRD(init ramdisk) 영역도 예약한다. */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		/* Assume only end is not page aligned */
		unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
		unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
		unsigned long ramdisk_end   = PAGE_ALIGN(ramdisk_image + ramdisk_size);
		memblock_reserve(ramdisk_image, ramdisk_end - ramdisk_image);
	}
#endif

	reserve_ebda_region();		/* EBDA 메모리 영역을 예약해놓았다. */

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 /* int 15h 서 예약된 부분과 커널/바이오스/부트로더 코드영역
	  * 외의 메모리 공간은 예약되어있지 않다. */
	start_kernel();
}
Exemplo n.º 4
0
void __init x86_64_start_kernel(char * real_mode_data)
{
	int i;

	/* clear bss before set_intr_gate with early_idt_handler */
	clear_bss();

	/* Make NULL pointers segfault */
	zap_identity_mappings();

	for (i = 0; i < IDT_ENTRIES; i++)
		set_intr_gate(i, early_idt_handler);
	load_idt((const struct desc_ptr *)&idt_descr);

	early_printk("Kernel alive\n");

 	for (i = 0; i < NR_CPUS; i++)
 		cpu_pda(i) = &boot_cpu_pda[i];

	pda_init(0);
	copy_bootdata(__va(real_mode_data));
#ifdef CONFIG_SMP
	cpu_set(0, cpu_online_map);
#endif
	start_kernel();
}
Exemplo n.º 5
0
void __init
pisces_init(char *real_mode_data) 
{
      
	pisces_boot_params = (struct pisces_boot_params *)__va((u64)real_mode_data << PAGE_SHIFT);


	if (pisces_boot_params->magic != PISCES_MAGIC) {
		return;
	}


	// Emulate the necessary x86_boot_params provided by bootloader
	// See: include/arch-x86_64/bootsetup.h
	// This is ugly....
	INITRD_START = pisces_boot_params->initrd_addr;
	INITRD_SIZE  = pisces_boot_params->initrd_size;
	KERNEL_START = pisces_boot_params->kernel_addr;
	LOADER_TYPE  = 'P'; // For now it just needs to be set to something

	memcpy(lwk_command_line, pisces_boot_params->cmd_line, sizeof(lwk_command_line));


	start_kernel();
}
Exemplo n.º 6
0
void __init x86_64_start_reservations(char *real_mode_data)
{
	copy_bootdata(__va(real_mode_data));

	reserve_trampoline_memory();

	reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");

#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
		unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
		unsigned long ramdisk_end   = ramdisk_image + ramdisk_size;
		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
	}
#endif

	reserve_ebda_region();

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 */

	start_kernel();
}
Exemplo n.º 7
0
void __init i386_start_kernel(void)
{
	reserve_trampoline_memory();

	reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");

#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		u64 ramdisk_image = boot_params.hdr.ramdisk_image;
		u64 ramdisk_size  = boot_params.hdr.ramdisk_size;
		u64 ramdisk_end   = ramdisk_image + ramdisk_size;
		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
	}
#endif

	/* Call the subarch specific early setup function */
	switch (boot_params.hdr.hardware_subarch) {
	case X86_SUBARCH_MRST:
		x86_mrst_early_setup();
		break;
	default:
		i386_default_early_setup();
		break;
	}

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 */

	start_kernel();
}
Exemplo n.º 8
0
void __init x86_64_start_kernel(char * real_mode_data)
{
	char *s;

	clear_bss();
	pda_init(0);
	copy_bootdata(real_mode_data);
	/* default console: */
	if (!strstr(saved_command_line, "console="))
		strcat(saved_command_line, " console=tty0"); 
	s = strstr(saved_command_line, "earlyprintk="); 
	if (s != NULL)
		setup_early_printk(s+12); 
#ifdef CONFIG_DISCONTIGMEM
	s = strstr(saved_command_line, "numa=");
	if (s != NULL)
		numa_setup(s+5);
#endif
#ifdef CONFIG_X86_IO_APIC
	if (strstr(saved_command_line, "disableapic"))
		disable_apic = 1;
#endif
	setup_boot_cpu_data();
	start_kernel();
}
Exemplo n.º 9
0
void __init x86_64_start_reservations(char *real_mode_data)
{
	copy_bootdata(__va(real_mode_data));

	memblock_reserve(__pa_symbol(&_text),
			 __pa_symbol(&__bss_stop) - __pa_symbol(&_text));

#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		/* Assume only end is not page aligned */
		unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
		unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
		unsigned long ramdisk_end   = PAGE_ALIGN(ramdisk_image + ramdisk_size);
		memblock_reserve(ramdisk_image, ramdisk_end - ramdisk_image);
	}
#endif

	reserve_ebda_region();

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 */

	start_kernel();
}
Exemplo n.º 10
0
void __init x86_64_start_kernel(char * real_mode_data)
{
	char *s;

	clear_bss();
	pda_init(0);
	copy_bootdata(real_mode_data);
#ifdef CONFIG_SMP
	cpu_set(0, cpu_online_map);
#endif
	/* default console: */
	if (!strstr(saved_command_line, "console="))
		strcat(saved_command_line, " console=tty0"); 
	s = strstr(saved_command_line, "earlyprintk=");
	if (s != NULL)
		setup_early_printk(s);
#ifdef CONFIG_DISCONTIGMEM
	s = strstr(saved_command_line, "numa=");
	if (s != NULL)
		numa_setup(s+5);
#endif
#ifdef CONFIG_X86_IO_APIC
	if (strstr(saved_command_line, "disableapic"))
		disable_apic = 1;
#endif
	/* You need early console to see that */
	if (__pa_symbol(&_end) >= KERNEL_TEXT_SIZE)
		panic("Kernel too big for kernel mapping\n");

	setup_boot_cpu_data();
	start_kernel();
}
Exemplo n.º 11
0
asmlinkage void __init init_arch(int argc, char **argv, char **envp,
	int *prom_vec)
{
	/* Determine which MIPS variant we are running on. */
	cpu_probe();

	prom_init(argc, argv, envp, prom_vec);

	cpu_report();

	/*
	 * Determine the mmu/cache attached to this machine, then flush the
	 * tlb and caches.  On the r4xx0 variants this also sets CP0_WIRED to
	 * zero.
	 */
	load_mmu();

	/*
	 * On IP27, I am seeing the TS bit set when the kernel is loaded.
	 * Maybe because the kernel is in ckseg0 and not xkphys? Clear it
	 * anyway ...
	 */
	clear_c0_status(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3);
	set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);

	start_kernel();
}
Exemplo n.º 12
0
int main(int argc, char *argv[])
{
#if 1
    unsigned long src_addr   = (unsigned long) vmlrd_lzma;
    unsigned long src_len    = vmlrd_lzmaSize;
    unsigned long dst_addr   = P2_UNCOMP_LOAD_ADDR;
    unsigned long dst_len    = P2_UNCOMP_LOAD_LEN;
    unsigned long tmp_addr   = P2_TEMP_BUF_ADDR;
    unsigned long tmp_len    = P2_TEMP_BUF_LEN;

    /* HW related initializing */
    serial_init();
    disable_usb_intr();

    /* Decompress LZMA */
    printf("Lzma decompressing(addr: %x len: %d)...\n", src_addr, src_len);

    if (lzma_inflate((unsigned char *) src_addr, src_len, 
        (unsigned char *) dst_addr, dst_len, 
        (unsigned char *) tmp_addr, tmp_len)) {
        printf("failed to decompress kernel\n");
        goto hang;
    }

    printf("Jump to kernel(addr: %x)...\n", vmlrd_lzma_entry);

    start_kernel = (void *) vmlrd_lzma_entry;
    start_kernel();

    printf("return from kernel...\n");

hang:
    while(1);
#else
    #define UNCOMP_LOAD_LEN 0x400000
    #define TEMP_BUF_ADDR 0x100000
    unsigned long src_addr   = (unsigned long) vmlrd;
    unsigned long src_len    = vmlrdSize;
    char *dst_addr, *tmp_addr;
    unsigned long dst_len   = UNCOMP_LOAD_LEN;
    unsigned long tmp_len   = TEMP_BUF_ADDR;
    dst_addr = malloc(dst_len);
    tmp_addr = malloc(tmp_len);
    if (!dst_addr || !tmp_addr) {
        printf("out of memory!\n");
        return 0;
    }
    printf("%d %d %d\n", src_len, dst_len, tmp_len);
    lzma_inflate((unsigned char *) src_addr, src_len,
        (unsigned char *) dst_addr, dst_len,
        (unsigned char *) tmp_addr, tmp_len);
    free(dst_addr);
    free(tmp_addr);
#endif

    return 0;
}
Exemplo n.º 13
0
/* the kernel main func */
int pretty_main()
{
    start_kernel();

    move_to_user_mode();

    /* from kernel mode to user mode and scheduler process */
    return 0;
}
Exemplo n.º 14
0
int main()
{
        extern unsigned long __data_rom_start;
        extern unsigned long __data_start;
        extern unsigned long __data_end;
        extern unsigned long __bss_start;
        extern unsigned long __bss_end;
 
        unsigned long *src;
        unsigned long *dest;
	unsigned long tmp;
 
	struct lregs *regs = (struct lregs *) 0x80000000;
#if 0     
        puts("Testing RAM\n");

        puts("Write...\n");
        for (dest = (unsigned long *)0x40000000; dest < (unsigned long *)0x40080000; dest++) {
                *dest = (unsigned long)0x5a5a5a5a ^ (unsigned long)dest;
        }
 
        puts("Read...\n");
        for (dest = (unsigned long *)0x40000000; dest < (unsigned long *)0x40080000; dest++) {
                tmp = (unsigned long)0x5a5a5a5a ^ (unsigned long)dest;
                if (*dest != tmp) {
                        puts("Failed.");
			outhex32((unsigned long)dest);
			puts("is");
			outhex32(*dest);
			puts("wrote");
			outhex32(tmp);
                        while(1);
                }
        }
#endif 
        puts("512k RAM\n");
        if (testvar == 0xdeadbeef) puts("Found my key\n");
        else puts("My keys are missing!\n");
#if 0 
        src = &__data_rom_start;
        dest = &__data_start;
        while (dest < &__data_end) *(dest++) = *(src++);
#endif
 
        dest = &__bss_start;
        while (dest < &__bss_end) *(dest++) = 0;
 
        puts("Moved .data\n");

        if (testvar == 0xdeadbeef) puts("Found my key\n");
        else puts("My keys are missing!\n");
 
        testvar = 0;

	start_kernel();
}
Exemplo n.º 15
0
void __init x86_64_start_reservations(char *real_mode_data)
{
	/* version is always not zero if it is copied */
	if (!boot_params.hdr.version)
		copy_bootdata(__va(real_mode_data));

	reserve_ebda_region();

	start_kernel();
}
Exemplo n.º 16
0
asmlinkage void init_arch(int argc, char **argv, char **envp, int *prom_vec)
{
	unsigned int s;
	/* Disable coprocessors */
	s = read_32bit_cp0_register(CP0_STATUS);
	s &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX);
	s |= ST0_CU0;
	write_32bit_cp0_register(CP0_STATUS, s);
	s = read_32bit_cp0_register(CP0_STATUS);

        start_kernel();
}
Exemplo n.º 17
0
void kmain()
{
	init_kernel();
	
	create_process(&process);
	
	start_kernel();
	
	__asm("cps 0x10"); // CPU to USER mode
	
	while (1) ;
}
Exemplo n.º 18
0
static int start_nfs_kernel(void)
{
	char target[PATH_MAX];

	if (!mount_nfs())
		start_kernel("kernel");
	else
		tboot_ui_error("Mount rootfs failed.");

	/* start kernel failed. */
	snprintf(target, sizeof(target), "/mnt/%s", g_2ndstageboot_part);
	return umount(target);
}
Exemplo n.º 19
0
void kmain()
{
	init_kernel();
	int ret;
	
	ret = sys_setscheduler(ROUND_ROBIN_SCHED); // returns 0
	create_process(&process1);
	create_process(&process2);
	create_process(&process3);
	
	start_kernel();
	
	while (current_process != current_process->next || current_process != current_process->previous) ;
	
	DISABLE_IRQ();
	
	ret = sys_setscheduler(RANDOM_SCHED);
	create_process(&process1);
	create_process(&process2);
	create_process(&process3);
	
	ENABLE_IRQ();
	
	while (current_process != current_process->next || current_process != current_process->previous) ;
	
	DISABLE_IRQ();
	
	ret = sys_setscheduler(FIXED_PRIORITY_SCHED);
	create_process_with_fix_priority(&process1, 5);
	create_process_with_fix_priority(&process2, 2);
	create_process_with_fix_priority(&process3, 4);
	
	ENABLE_IRQ();
	
	while (current_process != current_process->next || current_process != current_process->previous) ;
	
	DISABLE_IRQ();
	
	ret = sys_setscheduler(DYNAMIC_PRIORITY_SCHED);
	create_process(&process1);
	create_process(&process2);
	create_process(&process3);
	
	ENABLE_IRQ();
	
	while (current_process != current_process->next || current_process != current_process->previous) ;
	
	
	ret = sys_setscheduler(-50); // fail (returns -1)
	ret++;
}
Exemplo n.º 20
0
static int start_kernel_proc(void *unused)
{
	int pid;

	block_signals();
	pid = os_getpid();

	cpu_tasks[0].pid = pid;
	cpu_tasks[0].task = current;
#ifdef CONFIG_SMP
 	cpu_online_map = cpumask_of_cpu(0);
#endif
	start_kernel();
	return(0);
}
Exemplo n.º 21
0
void __init i386_start_kernel(void)
{
	reserve_trampoline_memory();

	reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");

#ifndef CONFIG_XEN
#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		u64 ramdisk_image = boot_params.hdr.ramdisk_image;
		u64 ramdisk_size  = boot_params.hdr.ramdisk_size;
		u64 ramdisk_end   = ramdisk_image + ramdisk_size;
		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
	}
#endif

	/* Call the subarch specific early setup function */
	switch (boot_params.hdr.hardware_subarch) {
	case X86_SUBARCH_MRST:
		x86_mrst_early_setup();
		break;
	default:
		i386_default_early_setup();
		break;
	}
#else
	{
		int max_cmdline;

		if ((max_cmdline = MAX_GUEST_CMDLINE) > COMMAND_LINE_SIZE)
			max_cmdline = COMMAND_LINE_SIZE;
		memcpy(boot_command_line, xen_start_info->cmd_line, max_cmdline);
		boot_command_line[max_cmdline-1] = '\0';
	}

	i386_default_early_setup();
	xen_start_kernel();
#endif

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 */

	start_kernel();
}
Exemplo n.º 22
0
void linsched_init(void)
{
	/* Initialize platform. For now, this does nothing, since
	 * the number of CPUs is known, and we do not yet support
	 * MC/SMT/NUMA. Scheduling decisions are not dependent on
	 * asymmetries yet, either, but that could change.
	 */
	linsched_init_cpus();

	/* Initialize random number generator. */
	linsched_random_init(LINSCHED_RAND_SEED);

	/* Change context to "boot" cpu and boot kernel. */
	linsched_change_cpu(0);
	start_kernel();
}
Exemplo n.º 23
0
void kmain()
{
	init_kernel();
	
	create_process(&process1);
	create_process(&process2);
	create_process(&process3);
	create_process(&process4);
	
	start_kernel();
	
	__asm("cps 0x10"); // CPU to USER mode
	
	sem_init(&sem, 2);
	
	sem_wait_for(&sem, 3);
}
Exemplo n.º 24
0
void __init x86_64_start_reservations(char *real_mode_data)
{
	/* version is always not zero if it is copied */
	if (!boot_params.hdr.version)
		copy_bootdata(__va(real_mode_data));

	reserve_ebda_region();

	switch (boot_params.hdr.hardware_subarch) {
	case X86_SUBARCH_INTEL_MID:
		x86_intel_mid_early_setup();
		break;
	default:
		break;
	}

	start_kernel();
}
Exemplo n.º 25
0
asmlinkage void __init init_arch(int argc, char **argv, char **envp,
	int *prom_vec)
{
	/* Determine which MIPS variant we are running on. */
	cpu_probe();

	prom_init(argc, argv, envp, prom_vec);

	cpu_report();

	/*
	 * Determine the mmu/cache attached to this machine, then flush the
	 * tlb and caches.  On the r4xx0 variants this also sets CP0_WIRED to
	 * zero.
	 */
	load_mmu();

	start_kernel();
}
Exemplo n.º 26
0
void __init i386_start_kernel(void)
{
#ifdef CONFIG_X86_TRAMPOLINE
	/*
	 * But first pinch a few for the stack/trampoline stuff
	 * FIXME: Don't need the extra page at 4K, but need to fix
	 * trampoline before removing it. (see the GDT stuff)
	 */
	reserve_early_overlap_ok(PAGE_SIZE, PAGE_SIZE + PAGE_SIZE,
					 "EX TRAMPOLINE");
#endif

	reserve_early(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");

#ifdef CONFIG_BLK_DEV_INITRD
	/* Reserve INITRD */
	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
		/* Assume only end is not page aligned */
		u64 ramdisk_image = boot_params.hdr.ramdisk_image;
		u64 ramdisk_size  = boot_params.hdr.ramdisk_size;
		u64 ramdisk_end   = PAGE_ALIGN(ramdisk_image + ramdisk_size);
		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
	}
#endif

	/* Call the subarch specific early setup function */
	switch (boot_params.hdr.hardware_subarch) {
	case X86_SUBARCH_MRST:
		x86_mrst_early_setup();
		break;
	default:
		i386_default_early_setup();
		break;
	}

	/*
	 * At this point everything still needed from the boot loader
	 * or BIOS or kernel text should be early reserved or marked not
	 * RAM in e820. All other memory is free game.
	 */

	start_kernel();
}
Exemplo n.º 27
0
void __init i386_start_kernel(void)
{
	sanitize_boot_params(&boot_params);

	/* Call the subarch specific early setup function */
	switch (boot_params.hdr.hardware_subarch) {
	case X86_SUBARCH_MRST:
		x86_mrst_early_setup();
		break;
	case X86_SUBARCH_CE4100:
		x86_ce4100_early_setup();
		break;
	default:
		i386_default_early_setup();
		break;
	}

	start_kernel();
}
Exemplo n.º 28
0
asmlinkage void __init
init_arch(int argc, char **argv, char **envp, int *prom_vec)
{
	/* Determine which MIPS variant we are running on. */
	unsigned int s;
#ifdef CONFIG_RTL865X
	char chipVersion[16]={0};
	int rev;
	GetChipVersion(chipVersion,sizeof(chipVersion), &rev);
	printk("************************************\n");
	printk("Powered by Realtek RTL%s SoC, rev %d\n",chipVersion, rev);
	printk("************************************\n");
#endif

#ifdef CONFIG_RTL8186
	printk("************************************\n");
	printk("Powered by Realtek RTL8186 SoC\n");
	printk("************************************\n");
#endif

	cpu_probe();

	prom_init(argc, argv, envp, prom_vec);

	cpu_report();

	/*
	 * Determine the mmu/cache attached to this machine,
	 * then flush the tlb and caches.  On the r4xx0
	 * variants this also sets CP0_WIRED to zero.
	 */
#ifdef CONFIG_RTL865X
	printk("Init MMU (16 entries)\n");
#endif
	load_mmu();

	/* Disable coprocessors and set FPU for 16/32 FPR register model */
	clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
	set_c0_status(ST0_CU0);

	start_kernel();
}
Exemplo n.º 29
0
void setup_kernel (multiboot_info_t *info, unsigned long magic)
{
	serial_early_init();

	assert(magic == MULTIBOOT_BOOTLOADER_MAGIC);

	init_early_pagination ();

	cpu_init ();

	trap_init ();

	init_IRQ ();

	sti();

	size_t cmdline_len = strlen((char *)info->cmdline);
	cmdline_parse((char *)info->cmdline, cmdline_len);

	/* okay, this is a *ugly* hack, but it works if there is only 1 module */
	if (info->mods_count != 0)
	{
		boot_module.addr = 0x4000;
		boot_module.len =
			((module_t *)info->mods_addr)->mod_end -
			((module_t *)info->mods_addr)->mod_start;
		/* set name to buf */
		boot_module.name = (char *)&boot_module.buf;

		memcpy(&boot_module.buf,(void *)(((module_t *)info->mods_addr)->string + sizeof(long)),64);

		memcpy((void*)0x4000,(void *)((module_t *)info->mods_addr)->mod_start, PAGE_SIZE);
	}

	u32 nr_frames = frame_allocator_init(info->mem_upper * 1024);

	//  load_stack_info(); // FIXME

	/* NOTE: stack reset, do nothing here */

	return start_kernel (info);
}
Exemplo n.º 30
0
void __init x86_64_start_kernel(char * real_mode_data)
{
    char *s;

    clear_bss(); /* must be the first thing in C and must not depend on .bss to be zero */
    pda_init(0);
    copy_bootdata(real_mode_data);
    s = strstr(saved_command_line, "earlyprintk=");
    if (s != NULL)
        setup_early_printk(s+12);
#ifdef CONFIG_DISCONTIGMEM
    extern int numa_setup(char *);
    s = strstr(saved_command_line, "numa=");
    if (s != NULL)
        numa_setup(s+5);
#endif
    early_printk("booting x86_64 kernel... ");
    setup_boot_cpu_data();
    start_kernel();
}