• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ paging_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中paging_init函数的典型用法代码示例。如果您正苦于以下问题:C++ paging_init函数的具体用法?C++ paging_init怎么用?C++ paging_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了paging_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: kernel_init

void kernel_init(boot_info_t bootInfo) {
	tty_init();

	multiboot_init(bootInfo.multiboot_magic, bootInfo.multiboot_addr);
	if(a20_enable()) {
		serial_writestring(1, "A20 enable failed - triggering panic\n");
		kernel_panic();
	};
	gdt_install();
	idt_install();
	irq_install();
	_protected_mode_init();

	paging_init();
	_paging_enable();

	PIC_init();
	serial_init();
	keyboard_init();
	timer_init();

	serial_writestring(1, "End kernel_init\n");

	kernel_main();
};
开发者ID:ajxs,项目名称:jxos,代码行数:25,代码来源:kernel.c


示例2: setup_arch

void __init setup_arch(char **cmdline_p)
{
	paging_init();
	strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
	*cmdline_p = command_line;
	setup_hostinfo(host_info, sizeof host_info);
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:7,代码来源:um_arch.c


示例3: main

/* Pintos main program. */
int
main (void)
{
  char **argv;

  /* Clear BSS. */  
  bss_init ();

  /* Break command line into arguments and parse options. */
  argv = read_command_line ();
  argv = parse_options (argv);

  /* Initialize ourselves as a thread so we can use locks,
     then enable console locking. */
  thread_init ();
  console_init ();  

  /* Greet user. */
  printf ("Pintos booting with %'"PRIu32" kB RAM...\n",
          init_ram_pages * PGSIZE / 1024);

  /* Initialize memory system. */
  palloc_init (user_page_limit);
  malloc_init ();
  paging_init ();
<<<<<<< HEAD
开发者ID:wangtaoX,项目名称:PintOS,代码行数:27,代码来源:init.c


示例4: arch_mem_init

static void __init arch_mem_init(char **cmdline_p)
{
	extern void plat_mem_setup(void);

	/* call board setup routine */
	plat_mem_setup();

	pr_info("Determined physical RAM map:\n");
	print_memory_map();

	strlcpy(command_line, arcs_cmdline, sizeof(command_line));
	strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);

	*cmdline_p = command_line;

	parse_early_param();

	if (usermem) {
		pr_info("User-defined physical RAM map:\n");
		print_memory_map();
	}
    
	bootmem_init();
#ifndef CONFIG_NLM_16G_MEM_SUPPORT
#ifndef CONFIG_NUMA
	setup_mapped_kernel_tlbs(FALSE, TRUE);
#endif
#endif
	sparse_init();
	paging_init();
}
开发者ID:akennedy-adtran,项目名称:linux_mmc_2.6.32.9,代码行数:31,代码来源:setup.c


示例5: k_main

void k_main(multiboot_info_t * multiboot_info)
{
	system_info.total_memory = multiboot_info->mem_upper;

	clrscr();

	printf("%s\n", &uname);
	printf("  Copyright 2005-2006 Draco Project\n");
	printf("%dM of extended memory.\n", multiboot_info->mem_upper >> 10);

	cons_attribute = 7;

	init_gdt();
	init_idt();
	init_irq(0x20, 0x28);
	paging_kernel_env(system_info.total_memory / 4);
	paging_init();
	proc_init();
	modules_init(multiboot_info);

	printf("Kernel is initialized.\n");

	sti();

	while(1);
}
开发者ID:podusowski,项目名称:draco,代码行数:26,代码来源:kernel.c


示例6: mm_init

void mm_init(multiboot_memory_map_t* mmap, uint32_t length, uint32_t highest_module)
{
    uint32_t i, len;
    if((uint32_t)&end_of_image > highest_module) {
        highest_module = (uint32_t)&end_of_image;
    }
    uint32_t start_addr = ((highest_module + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE;
    uint64_t end;
    for(i = 0; i < length / sizeof(multiboot_memory_map_t); i++) {
        if(mmap[i].type == MULTIBOOT_MEMORY_AVAILABLE) {
            if(mmap[i].addr >= ADDRESS_SPACE_SIZE) {
                continue;
            }
            end = mmap[i].addr + mmap[i].len;
            if(end > ADDRESS_SPACE_SIZE) {
                end = ADDRESS_SPACE_SIZE - 1;
            }
            len = end - mmap[i].addr;
            if(mmap[i].addr + len <= start_addr) {
                continue;
            }
            if(mmap[i].addr > start_addr) {
                len -= (uint32_t)mmap[i].addr - start_addr;
                start_addr = (uint32_t)mmap[i].addr;
            }
            // page align base address:
            base = ((start_addr + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE;
            max_size = len;
            kprintf("%d MiB available memory (0x%x - 0x%x)\n", len / (1024 * 1024), start_addr, start_addr + len);
            paging_init(start_addr + len);
            return;
        }
    }
    panic("did not find suitable memory region");
}
开发者ID:BenitoJedai,项目名称:jsos,代码行数:35,代码来源:mm.c


示例7: kmain

void kmain (void)
{
    cpu = &cpus[0];

    uart_init (P2V(UART0));

    init_vmm ();
    kpt_freerange (align_up(&end, PT_SZ), P2V_WO(INIT_KERNMAP));
    paging_init (INIT_KERNMAP, PHYSTOP);

    kmem_init ();
    kmem_init2(P2V(INIT_KERNMAP), P2V(PHYSTOP));

    trap_init ();				// vector table and stacks for models
   
    gic_init(P2V(VIC_BASE));			// arm v2 gic init
    uart_enable_rx ();				// interrupt for uart
    consoleinit ();				// console
    pinit ();					// process (locks)

    binit ();					// buffer cache
    fileinit ();				// file table
    iinit ();					// inode cache
    ideinit ();					// ide (memory block device)

#ifdef INCLUDE_REMOVED
    timer_init (HZ);				// the timer (ticker)
#endif

    sti ();
    userinit();					// first user process
    scheduler();				// start running processes
}
开发者ID:finallyjustice,项目名称:xv6-OS-for-arm-v8,代码行数:33,代码来源:main.c


示例8: kern_start

void __init kern_start()
{
	struct thread *main_thread;

	mach_start();

	kprintf("Starting Koowaldah v%s kernel.\n", VERSION_STRING);

	/* memory allocation machinery: zones, buddy allocator, slices */
	init_mem_info();
	paging_init();
	galloc_init();

	kqueue_init();

	timers_init();

	sched0_load();
	scheduler_init();
	main_thread = thread_create(&kernel_main_thread, "GOD", NULL);
	if (!main_thread) {
		kprintf("Failed to create main kernel thread\n");
		bug();
	}
	thread_switch_to(main_thread);

	bug();
}
开发者ID:virtuoso,项目名称:koowaldah,代码行数:28,代码来源:init.c


示例9: setup_arch

void __init setup_arch(char **cmdline_p)
{
	init_mm.start_code = (unsigned long) _stext;
	init_mm.end_code   = (unsigned long) _etext;
	init_mm.end_data   = (unsigned long) _edata;
	init_mm.brk        = (unsigned long) _end;

	*cmdline_p = boot_command_line;

	parse_early_param();

	setup_bootmem();
	paging_init();
	unflatten_device_tree();

#ifdef CONFIG_SWIOTLB
	swiotlb_init(1);
#endif

#ifdef CONFIG_SMP
	setup_smp();
#endif

#ifdef CONFIG_DUMMY_CONSOLE
	conswitchp = &dummy_con;
#endif

	riscv_fill_hwcap();
}
开发者ID:Broadcom,项目名称:stblinux,代码行数:29,代码来源:setup.c


示例10: arch_mem_init

static void __init arch_mem_init(char **cmdline_p)
{
	extern void plat_mem_setup(void);

	/* call board setup routine */
	plat_mem_setup();

	printk("Determined physical RAM map:\n");
	print_memory_map();

	strlcpy(command_line, arcs_cmdline, sizeof(command_line));
	strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);

	*cmdline_p = command_line;

	parse_early_param();

	if (usermem) {
		printk("User-defined physical RAM map:\n");
		print_memory_map();
	}

	bootmem_init();
#ifdef CONFIG_SPARSEMEM
        sparse_memory_present_with_active_regions(MAX_NUMNODES);
#endif
	sparse_init();
	paging_init();
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:29,代码来源:setup.c


示例11: kmain

void kmain(multiboot_info_t* mbd, unsigned long magic)
{
    if(magic != MULTIBOOT_BOOTLOADER_MAGIC) {
        scrn_setmode(GREEN,BLACK);
        scrn_print("Algo salio muy muy mal. No se que mas decirte.");
        return;
    }
    scrn_cls();
    scrn_setmode(GREEN,BLACK);
    scrn_print("BIENVENIDO A juampiOS\n\t"
               "Estamos trabajando para ofrecerle "
               "el OS del futuro.\n");
    scrn_print("INICIALIZANDO GDT...");
    gdt_init();
    gdt_flush();
    scrn_print("OK\nINICIALIZANDO IDT PARA LAS EXCEPCIONES...");
    initialize_exception_handlers();
    idt_init_exceptions();
    remap_pic();
    scrn_print("OK\nINICIALIZANDO IDT PARA LAS INTERRUPCIONES Y SYSCALLS...");
    irq_init_handlers();
    syscalls_initialize();
    idt_init_interrupts();
    idt_init_syscalls();
    idt_flush();
    irq_sti_force();

    scrn_printf("OK\nCHEQUEANDO ESTADO DE LOS MODULOS...");
    scrn_printf("%u MODULOS CARGADOS\n",mbd->mods_count);

    scrn_print("CHECKEANDO ESTADO DE LA MEMORIA\n");
    // Chequeamos que la cantidad de memoria RAM presente.
    if(mbd->flags & 1) {
        scrn_printf("\tCantidad de RAM en el sistema:\n"
                    "\t\tLower: %u Kb, Upper: %u Kb\n",
                    mbd->mem_lower,mbd->mem_upper);
    } else {
        kernel_panic("Mapa de memoria de GRUB invalido");
    }
    scrn_print("INICIALIZANDO LAS ESTRUCTURAS DE MEMORIA DEL KERNEL...");
    module_t* grub_modules = (module_t*) mbd->mods_addr;
    uint kernel_end_addr = grub_modules[mbd->mods_count-1].mod_end;
    // El mapa de memoria upper es a partir del primer megabyte ergo el primer
    // lugar donde nos vamos de largo es 1024 kilobytes mas la memoria que dice GRUB
    paging_init(kernel_end_addr, (1024+mbd->mem_upper)*1024);
    scrn_printf("OK\n");

    scrn_print("INICIALIZANDO DISCO ATA\n");
    hdd_init();
    scrn_printf("INICIALIZANDO FILESYSTEM MINIX\n");
    init_disk_super_block();
    keybuffer_init(1024);
    scheduler_init();

    void * buffer = (void *) grub_modules[0].mod_start;
    jump_to_initial(buffer);

    while(1) ;
}
开发者ID:jpdarago,项目名称:juampi-os,代码行数:59,代码来源:kernel.c


示例12: init

void init()
{
gdt_init();
idt_init();
paging_init();
timer_init(50);
keyboard_init();
}
开发者ID:brightening-eyes,项目名称:AmirOS,代码行数:8,代码来源:init.c


示例13: setup_arch

void __init setup_arch(char **cmdline_p)
{
	notifier_chain_register(&panic_notifier_list, &panic_exit_notifier);
	paging_init();
 	strcpy(command_line, saved_command_line);
 	*cmdline_p = command_line;
	setup_hostinfo();
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:8,代码来源:um_arch.c


示例14: arch_entry

void arch_entry() { 
  paging_init();
  gdt_init();
  idt_init();
  isr_init();
  pic_init();
  pit_init();
}
开发者ID:warrantyvoids,项目名称:DuckyOS,代码行数:8,代码来源:arch.c


示例15: setup_arch

void __init setup_arch(char **cmdline_p)
{
	extern int mem_reserve(unsigned long, unsigned long, int);
	extern void bootmem_init(void);

	memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
	boot_command_line[COMMAND_LINE_SIZE-1] = '\0';
	*cmdline_p = command_line;

	/* Reserve some memory regions */

#ifdef CONFIG_BLK_DEV_INITRD
	if (initrd_start < initrd_end) {
		initrd_is_mapped = mem_reserve(__pa(initrd_start),
					       __pa(initrd_end), 0);
		initrd_below_start_ok = 1;
 	} else {
		initrd_start = 0;
	}
#endif

	mem_reserve(__pa(&_stext),__pa(&_end), 1);

	mem_reserve(__pa(&_WindowVectors_text_start),
		    __pa(&_WindowVectors_text_end), 0);

	mem_reserve(__pa(&_DebugInterruptVector_literal_start),
		    __pa(&_DebugInterruptVector_text_end), 0);

	mem_reserve(__pa(&_KernelExceptionVector_literal_start),
		    __pa(&_KernelExceptionVector_text_end), 0);

	mem_reserve(__pa(&_UserExceptionVector_literal_start),
		    __pa(&_UserExceptionVector_text_end), 0);

	mem_reserve(__pa(&_DoubleExceptionVector_literal_start),
		    __pa(&_DoubleExceptionVector_text_end), 0);

	bootmem_init();

	platform_setup(cmdline_p);


	paging_init();
	zones_init();

#ifdef CONFIG_VT
# if defined(CONFIG_VGA_CONSOLE)
	conswitchp = &vga_con;
# elif defined(CONFIG_DUMMY_CONSOLE)
	conswitchp = &dummy_con;
# endif
#endif

#ifdef CONFIG_PCI
	platform_pcibios_init();
#endif
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:58,代码来源:setup.c


示例16: setup_arch

void __init
setup_arch(char **cmdline_p)
{
        /*
         * print what head.S has found out about the machine
         */
#ifndef CONFIG_64BIT
	printk((MACHINE_IS_VM) ?
	       "We are running under VM (31 bit mode)\n" :
	       "We are running native (31 bit mode)\n");
	printk((MACHINE_HAS_IEEE) ?
	       "This machine has an IEEE fpu\n" :
	       "This machine has no IEEE fpu\n");
#else /* CONFIG_64BIT */
	printk((MACHINE_IS_VM) ?
	       "We are running under VM (64 bit mode)\n" :
	       "We are running native (64 bit mode)\n");
#endif /* CONFIG_64BIT */

	/* Save unparsed command line copy for /proc/cmdline */
	strlcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);

	*cmdline_p = COMMAND_LINE;
	*(*cmdline_p + COMMAND_LINE_SIZE - 1) = '\0';

        ROOT_DEV = Root_RAM0;

	init_mm.start_code = PAGE_OFFSET;
	init_mm.end_code = (unsigned long) &_etext;
	init_mm.end_data = (unsigned long) &_edata;
	init_mm.brk = (unsigned long) &_end;

	if (MACHINE_HAS_MVCOS)
		memcpy(&uaccess, &uaccess_mvcos, sizeof(uaccess));
	else
		memcpy(&uaccess, &uaccess_std, sizeof(uaccess));

	parse_early_param();

	setup_memory_end();
	setup_addressing_mode();
	setup_memory();
	setup_resources();
	setup_lowcore();

        cpu_init();
        __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr;
	smp_setup_cpu_possible_map();

	/*
	 * Create kernel page tables and switch to virtual addressing.
	 */
        paging_init();

        /* Setup default console */
	conmode_default();
}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:57,代码来源:setup.c


示例17: setup_arch

void __init setup_arch(char **cmdline_p)
{
	struct tag *tags = (struct tag *)&init_tags;
	char *from = default_command_line;

	setup_processor();
	if(machine_arch_type == MACH_TYPE_A5K)
		machine_name = "A5000";
	else if(machine_arch_type == MACH_TYPE_ARCHIMEDES)
		machine_name = "Archimedes";
	else
		machine_name = "UNKNOWN";

	//FIXME - the tag struct is always copied here but this is a block
	// of RAM that is accidentally reserved along with video RAM. perhaps
	// it would be a good idea to explicitly reserve this?

	tags = (struct tag *)0x0207c000;

	/*
	 * If we have the old style parameters, convert them to
	 * a tag list.
	 */
	if (tags->hdr.tag != ATAG_CORE)
		convert_to_tag_list(tags);
	if (tags->hdr.tag != ATAG_CORE)
		tags = (struct tag *)&init_tags;
	if (tags->hdr.tag == ATAG_CORE) {
		if (meminfo.nr_banks != 0)
			squash_mem_tags(tags);
		parse_tags(tags);
	}

	init_mm.start_code = (unsigned long) &_text;
#ifndef CONFIG_XIP_KERNEL
	init_mm.end_code   = (unsigned long) &_etext;
#else
	init_mm.end_code   = (unsigned long) &_endtext;
	init_mm.start_data   = (unsigned long) &_sdata;
#endif
	init_mm.end_data   = (unsigned long) &_edata;
	init_mm.brk	   = (unsigned long) &_end;

	memcpy(boot_command_line, from, COMMAND_LINE_SIZE);
	boot_command_line[COMMAND_LINE_SIZE-1] = '\0';
	parse_cmdline(&meminfo, cmdline_p, from);
	bootmem_init(&meminfo);
	paging_init(&meminfo);
	request_standard_resources(&meminfo);

#ifdef CONFIG_VT
#if defined(CONFIG_DUMMY_CONSOLE)
	conswitchp = &dummy_con;
#endif
#endif
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:56,代码来源:setup.c


示例18: ia32_region_init

t_error			ia32_region_init(t_vaddr		start,
					 t_vsize		size)
{
  REGION_ENTER(region);

  if (paging_init() != ERROR_NONE)
    REGION_LEAVE(region, ERROR_UNKNOWN);

  REGION_LEAVE(region, ERROR_NONE);
}
开发者ID:BackupTheBerlios,项目名称:kanetonbigfen-svn,代码行数:10,代码来源:region.c


示例19: init_early

static void init_early(unsigned int cpu_id)
{
	struct jailhouse_memory hv_page;
	unsigned long core_percpu_size;

	master_cpu_id = cpu_id;

	arch_dbg_write_init();

	printk("\nInitializing Jailhouse hypervisor %s on CPU %d\n",
	       JAILHOUSE_VERSION, cpu_id);
	printk("Code location: %p\n", __text_start);

	error = paging_init();
	if (error)
		return;

	root_cell.config = &system_config->root_cell;

	error = check_mem_regions(&system_config->root_cell);
	if (error)
		return;

	root_cell.id = -1;
	error = cell_init(&root_cell);
	if (error)
		return;

	error = arch_init_early();
	if (error)
		return;

	/*
	 * Back the region of the hypervisor core and per-CPU page with empty
	 * pages for Linux. This allows to fault-in the hypervisor region into
	 * Linux' page table before shutdown without triggering violations.
	 */
	hv_page.phys_start = page_map_hvirt2phys(empty_page);
	hv_page.virt_start = page_map_hvirt2phys(&hypervisor_header);
	hv_page.size = PAGE_SIZE;
	hv_page.flags = JAILHOUSE_MEM_READ;
	core_percpu_size = PAGE_ALIGN(hypervisor_header.core_size) +
		hypervisor_header.possible_cpus * sizeof(struct per_cpu);
	while (core_percpu_size > 0) {
		error = arch_map_memory_region(&root_cell, &hv_page);
		if (error)
			return;
		core_percpu_size -= PAGE_SIZE;
		hv_page.virt_start += PAGE_SIZE;
	}

	page_map_dump_stats("after early setup");
	printk("Initializing processors:\n");
}
开发者ID:Flox35,项目名称:jailhouse,代码行数:54,代码来源:setup.c


示例20: setup_arch

void __init setup_arch(char **cmdline_p)
{
	randomize_va_space = 0;
	*cmdline_p = command_line;

	cpu_cache_init();
	tlb_init();
	bootmem_init();
	paging_init();
	resource_init();
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:11,代码来源:setup.c



注:本文中的paging_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ paint函数代码示例发布时间:2022-05-30
下一篇:
C++ pagevec_release函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap