void kmain(uint32_t magic, multiboot_info_t *mboot, uintptr_t ebp) { monitor_clear(); printf("Booting Dionysus!\n"); ASSERT(magic == MULTIBOOT_BOOTLOADER_MAGIC && "Not booted with multiboot."); ASSERT(mboot->flags & MULTIBOOT_INFO_MEMORY && "No memory info."); ASSERT(mboot->flags & MULTIBOOT_INFO_MEM_MAP && "No memory map."); printf("Initializing GDT\n"); init_gdt(); printf("Initializing IDT\n"); init_idt(); // Check for modules if (mboot->flags & MULTIBOOT_INFO_MODS && mboot->mods_count) { multiboot_module_t *mods = (multiboot_module_t *)mboot->mods_addr; placement_address = mods[mboot->mods_count - 1].mod_end + KERNEL_BASE; } printf("Setting up paging\n"); init_paging(mboot->mem_lower + mboot->mem_upper, mboot->mmap_addr, mboot->mmap_length); printf("Initializing timers\n"); init_time(); init_timer(); printf("Starting task scheduling\n"); init_tasking(ebp); init_syscalls(); printf("Initializing vfs\n"); init_vfs(); printf("Initializing driver subsystem\n"); init_blockdev(); init_chardev(); init_term(); printf("Enumerating PCI bus(ses)\n"); init_pci(); dump_pci(); init_devfs(); ASSERT(mount(NULL, "/dev", "devfs", 0) == 0); init_ide(); halt(); }
/** Main start function of the module @param argc: Unused @param argv: Unused @returns 0 on success, -1 on error */ int _start(int argc, char **argv) { int res = 1; printf(BANNER, VERSION); if ((res = RegisterLibraryEntries(&_exp_devfs)) != 0) { M_PRINTF("Library is already registered, exiting.\n"); printf("res=%d\n", res); } else { res = init_devfs(); } M_PRINTF("devfs_device_t size=%d\n", sizeof(devfs_device_t)); M_PRINTF("Driver loaded.\n"); return res; }