void device_setup(void) { extern void console_map_init(void); struct gendisk *p; int nr=0; chr_dev_init(); blk_dev_init(); sti(); #ifdef CONFIG_SCSI scsi_dev_init(); #endif #ifdef CONFIG_INET net_dev_init(); #endif console_map_init(); for (p = gendisk_head ; p ; p=p->next) { setup_dev(p); nr += p->nr_real; } #ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start && mount_initrd) initrd_load(); else #endif rd_load(); #endif }
static int __init genhd_device_init(void) { bdev_map = kobj_map_init(base_probe, &block_subsys_sem); blk_dev_init(); subsystem_register(&block_subsys); return 0; }
void main(void) /* This really IS void, no error here. */ { /* The startup routine assumes (well, ...) this */ /* * Interrupts are still disabled. Do necessary setups, then * enable them */ ROOT_DEV = ORIG_ROOT_DEV; drive_info = DRIVE_INFO; memory_end = (1<<20) + (EXT_MEM_K<<10); memory_end &= 0xfffff000; if (memory_end > 16*1024*1024) memory_end = 16*1024*1024; if (memory_end > 12*1024*1024) buffer_memory_end = 4*1024*1024; else if (memory_end > 6*1024*1024) buffer_memory_end = 2*1024*1024; else buffer_memory_end = 1*1024*1024; main_memory_start = buffer_memory_end; #ifdef RAMDISK main_memory_start += rd_init(main_memory_start, RAMDISK*1024); #endif mem_init(main_memory_start,memory_end); trap_init(); blk_dev_init(); chr_dev_init(); tty_init(); time_init(); sched_init(); buffer_init(buffer_memory_end); hd_init(); floppy_init(); sti(); move_to_user_mode(); setup((void *) &drive_info); (void) open("/dev/tty0",O_RDWR,0); (void) dup(0); (void) dup(0); (void) open("/var/process.log",O_CREAT|O_TRUNC|O_WRONLY,0666); #ifdef dis_func (void) open("/var/dis_func.log",O_CREAT|O_TRUNC|O_WRONLY,0666); #endif if (!fork()) { /* we count on this going ok */ init(); } /* * NOTE!! For any other task 'pause()' would mean we have to get a * signal to awaken, but task0 is the sole exception (see 'schedule()') * as task 0 gets activated at every idle moment (when no other tasks * can run). For task0 'pause()' just means we go check if some other * task can run, and if not we return here. */ for(;;) pause(); }
static int __init genhd_device_init(void) { int err; bdev_map = kobj_map_init(base_probe, &block_subsys_lock); blk_dev_init(); err = subsystem_register(&block_subsys); if (err < 0) printk(KERN_WARNING "%s: subsystem_register error: %d\n", __FUNCTION__, err); return err; }
/** * 主核初始化 */ asmlinkage void __init start_master(void) { debug_printstr_mmu("xby_debug, start cpu 0\n"); local_irq_disable(); //tick_init(); /* 为当前CPU设置其活动掩码 */ boot_cpu_init(); /* 体系结构特定的初始化过程 */ start_arch(); //初始化boot内存分配器 InitBootMemory(0xc0000000 + 8 * 1024 * 1024, 0xc0000000 + 24 * 1024 * 1024); init_IRQ(); //体系结构和驱动的一些初始化过程 //run_initcall(); //为VFS分配一些大的内存块,用于哈希表。此过程必须在boot阶段分配。 //vfs_caches_init_early(); #ifdef FS blk_dev_init(); inode_init(); file_table_init(); name_cache_init(); buffer_init_early(); #endif memory_init(); #ifdef FS buffer_init_tail(); tty_init(); #endif sched_init(); time_init(); setup_timer(); serial_init(); //mmc_init(); //omap_gpio_init(); //初始化文件系统 //vfs_caches_init(num_physpages); local_irq_enable(); //创建系统任务,以及用户任务入口 TaskEntry(); cpu_idle(); //不可能运行到这里来 BUG(); }
int __init device_init(void) { struct blk_probe *base = kmalloc(sizeof(struct blk_probe), GFP_KERNEL); int i; memset(base, 0, sizeof(struct blk_probe)); base->dev = 1; base->range = ~0; /* range 1 .. ~0 */ base->get = base_probe; for (i = 0; i < MAX_PROBE_HASH; i++) probes[i] = base; /* must remain last in chain */ blk_dev_init(); subsystem_register(&block_subsys); return 0; }
int __init device_init(void) { rwlock_init(&gendisk_lock); blk_dev_init(); sti(); #ifdef CONFIG_NET net_dev_init(); #endif #ifdef CONFIG_ATM (void) atmdev_init(); #endif #ifdef CONFIG_VT console_map_init(); #endif return 0; }
void main(void) /* This really IS void, no error here. */ { /* The startup routine assumes (well, ...) this */ /* * Interrupts are still disabled. Do necessary setups, then * enable them */ ROOT_DEV = ORIG_ROOT_DEV; drive_info = DRIVE_INFO; memory_end = (1<<20) + (EXT_MEM_K<<10); memory_end &= 0xfffff000; if (memory_end > 16*1024*1024) memory_end = 16*1024*1024; if (memory_end > 12*1024*1024) buffer_memory_end = 4*1024*1024; else if (memory_end > 6*1024*1024) buffer_memory_end = 2*1024*1024; else buffer_memory_end = 1*1024*1024; main_memory_start = buffer_memory_end; #ifdef RAMDISK main_memory_start += rd_init(main_memory_start, RAMDISK*1024); #endif mem_init(main_memory_start,memory_end); trap_init(); /* set the IDT in 0x00080000~0x000807ff(4KB)*/ blk_dev_init(); chr_dev_init(); /* this function do nothing */ tty_init(); /* rs_init() and con_init() */ time_init(); sched_init(); buffer_init(buffer_memory_end); hd_init(); floppy_init(); sti(); move_to_user_mode(); if (!fork()) { /* we count on this going ok */ init(); } /* * NOTE!! For any other task 'pause()' would mean we have to get a * signal to awaken, but task0 is the sole exception (see 'schedule()') * as task 0 gets activated at every idle moment (when no other tasks * can run). For task0 'pause()' just means we go check if some other * task can run, and if not we return here. */ for(;;) pause(); }
void device_setup(void) { register struct gendisk *p; chr_dev_init(); blk_dev_init(); set_irq(); for (p = gendisk_head; p; p = p->next) setup_dev(p); #ifdef CONFIG_BLK_DEV_RAM rd_load(); #endif }