예제 #1
0
파일: main.c 프로젝트: JamesLinus/levos6
void do_mount() {
    for(int i = 0; i < get_num_of_devices(); i++)
        vfs_mount("/", device_get(i));

    if (!vfs_root_mounted())
        panic("unable to mount root directory\n");
}
예제 #2
0
void cmd_lsdev()
{
    _printk("NAME TYPE\n");
    for (int i = 0; i < get_num_of_devices(); i++) {
        struct device *d = device_get(i);

        if (!d) {
            i --;
            continue;
        }

        _printk("%s %s\n", d->name,
                d->type == DEV_TYPE_TTY ? "[tty]"
                : d->type == DEV_TYPE_PSEUDO ? "[pseudo]"
                : d->type == DEV_TYPE_ISA ? "[isa]"
                : d->type == DEV_TYPE_PCI ? "[pci]"
                : d->type == DEV_TYPE_BLK ? "[blk]"
                : d->type == DEV_TYPE_TTY_INPUT ? "[intty]"
                : "[unktype]");
    }
}