本文整理汇总了C++中paging_init函数的典型用法代码示例。如果您正苦于以下问题:C++ paging_init函数的具体用法?C++ paging_init怎么用?C++ paging_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了paging_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
};
示例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);
}
示例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
示例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();
}
示例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);
}
示例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");
}
示例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
}
示例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();
}
示例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();
}
示例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();
}
示例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) ;
}
示例12: init
void init()
{
gdt_init();
idt_init();
paging_init();
timer_init(50);
keyboard_init();
}
示例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();
}
示例14: arch_entry
void arch_entry() {
paging_init();
gdt_init();
idt_init();
isr_init();
pic_init();
pit_init();
}
示例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
}