diff options
-rw-r--r-- | ports/doom/files/doomgeneric_camellia.c | 5 | ||||
-rw-r--r-- | src/cmd/drawmouse/drawmouse.c | 4 | ||||
-rw-r--r-- | src/cmd/dvd/dvd.c | 2 | ||||
-rw-r--r-- | src/cmd/init/driver/ps2.c | 3 | ||||
-rw-r--r-- | src/cmd/init/init.c | 14 | ||||
-rw-r--r-- | src/cmd/vterm/vterm.c | 2 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/fsroot.c | 36 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/pata.c | 2 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/ps2.c | 2 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/rtl8139.c | 2 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/serial.c | 2 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/video.c | 2 |
12 files changed, 39 insertions, 37 deletions
diff --git a/ports/doom/files/doomgeneric_camellia.c b/ports/doom/files/doomgeneric_camellia.c index 3fe6032..596e3d7 100644 --- a/ports/doom/files/doomgeneric_camellia.c +++ b/ports/doom/files/doomgeneric_camellia.c @@ -1,3 +1,4 @@ +#include <camellia.h> #include <camellia/syscalls.h> #include <shared/ring.h> #include <stdbool.h> @@ -39,11 +40,11 @@ static void kb_thread(void *arg) { } void DG_Init(void) { - if (fb_setup(&fb, "/kdev/video/") < 0) { + if (fb_setup(&fb, "/dev/video/") < 0) { puts("DG_Init: fb_setup error"); abort(); } - kb = _sys_open("/kdev/ps2/kb", 12, 0); + kb = camellia_open("/dev/ps2/kb", OPEN_READ); if (kb < 0) { puts("DG_Init: can't open keyboard"); abort(); diff --git a/src/cmd/drawmouse/drawmouse.c b/src/cmd/drawmouse/drawmouse.c index c65030c..f20d9bd 100644 --- a/src/cmd/drawmouse/drawmouse.c +++ b/src/cmd/drawmouse/drawmouse.c @@ -49,13 +49,13 @@ struct packet { int main(void) { char buf[64]; - hid_t fd = camellia_open("/kdev/ps2/mouse", OPEN_READ); + hid_t fd = camellia_open("/dev/ps2/mouse", OPEN_READ); if (fd < 0) { err(1, "open"); return 1; } - if (fb_setup(&fb, "/kdev/video/") < 0) { + if (fb_setup(&fb, "/dev/video/") < 0) { err(1, "fb_setup"); return 1; } diff --git a/src/cmd/dvd/dvd.c b/src/cmd/dvd/dvd.c index b20858d..0b5caaf 100644 --- a/src/cmd/dvd/dvd.c +++ b/src/cmd/dvd/dvd.c @@ -21,7 +21,7 @@ void draw_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t col) { } int main(void) { - if (fb_setup(&fb, "/kdev/video/") < 0) { + if (fb_setup(&fb, "/dev/video/") < 0) { err(1, "fb_setup"); return 1; } diff --git a/src/cmd/init/driver/ps2.c b/src/cmd/init/driver/ps2.c index 874e672..d0480bc 100644 --- a/src/cmd/init/driver/ps2.c +++ b/src/cmd/init/driver/ps2.c @@ -1,5 +1,6 @@ #include "driver.h" #include <assert.h> +#include <camellia.h> #include <camellia/compat.h> #include <camellia/syscalls.h> #include <err.h> @@ -94,7 +95,7 @@ static void kb_thread(void *unused) { int fd; (void)unused; - fd = _sys_open("/kdev/ps2/kb", 12, 0); + fd = camellia_open("/dev/ps2/kb", OPEN_READ); if (fd < 0) err(1, "open"); while (true) { diff --git a/src/cmd/init/init.c b/src/cmd/init/init.c index 8682dd5..acb6a8f 100644 --- a/src/cmd/init/init.c +++ b/src/cmd/init/init.c @@ -44,8 +44,8 @@ void redirect(const char *exe, const char *out, const char *in) { int main(void) { hid_t killswitch_pipe[2]; - freopen("/kdev/com1", "a+", stdout); - freopen("/kdev/com1", "a+", stderr); + freopen("/dev/com1", "a+", stdout); + freopen("/dev/com1", "a+", stderr); MOUNT_AT("/") { fs_dirinject2((const char*[]){ @@ -62,7 +62,7 @@ int main(void) { } MOUNT_AT("/keyboard") { - MOUNT_AT("/") { fs_whitelist((const char*[]){"/kdev/ps2/kb", NULL}); } + MOUNT_AT("/") { fs_whitelist((const char*[]){"/dev/ps2/kb", NULL}); } ps2_drv(); } MOUNT_AT("/usr/") { @@ -99,14 +99,14 @@ int main(void) { execv(argv[0], (void*)argv); } MOUNT_AT("/vtty") { - const char *allow[] = {"/bin/vterm", "/kdev/video/", "/keyboard", "/init/usr/share/fonts/", NULL}; + const char *allow[] = {"/bin/vterm", "/dev/video/", "/keyboard", "/init/usr/share/fonts/", NULL}; const char *argv[] = {"/bin/vterm", NULL}; MOUNT_AT("/") { fs_whitelist(allow); } execv(argv[0], (void*)argv); } MOUNT_AT("/net/") { - const char *allow[] = {"/bin/netstack", "/kdev/eth", NULL}; - const char *argv[] = {"/bin/netstack", "/kdev/eth", "192.168.0.11", "192.168.0.2", NULL}; + const char *allow[] = {"/bin/netstack", "/dev/eth", NULL}; + const char *argv[] = {"/bin/netstack", "/dev/eth", "192.168.0.11", "192.168.0.2", NULL}; MOUNT_AT("/") { fs_whitelist(allow); } execv(argv[0], (void*)argv); } @@ -124,7 +124,7 @@ int main(void) { if (!fork()) { // TODO close on exec close(killswitch_pipe[0]); - redirect("/bin/shell", "/kdev/com1", "/kdev/com1"); + redirect("/bin/shell", "/dev/com1", "/dev/com1"); redirect("/bin/shell", "/vtty", "/keyboard"); exit(1); } diff --git a/src/cmd/vterm/vterm.c b/src/cmd/vterm/vterm.c index 97149c9..f4db528 100644 --- a/src/cmd/vterm/vterm.c +++ b/src/cmd/vterm/vterm.c @@ -37,7 +37,7 @@ void in_char(char c) { } int main(void) { - if (fb_setup(&fb, "/kdev/video/") < 0) { + if (fb_setup(&fb, "/dev/video/") < 0) { err(1, "fb_setup"); return 1; } diff --git a/src/kernel/arch/amd64/driver/fsroot.c b/src/kernel/arch/amd64/driver/fsroot.c index 0eef12f..2684b72 100644 --- a/src/kernel/arch/amd64/driver/fsroot.c +++ b/src/kernel/arch/amd64/driver/fsroot.c @@ -12,23 +12,23 @@ enum { Hbase, - Hkdev, + Hdev, }; static int -get_kdev(char *lst) +get_dev(char *lst) { int len = 0; for (VfsMount *m = vfs_mount_seed(); m; m = m->prev) { if (m->prefix_len == 0) { continue; /* that's us */ } - assert(m->prefix_len > 6); - assert(memcmp(m->prefix, "/kdev/", 6) == 0); - len += m->prefix_len - 6 + 1; + assert(m->prefix_len > 5); + assert(memcmp(m->prefix, "/dev/", 5) == 0); + len += m->prefix_len - 5 + 1; if (lst) { - memcpy(lst, m->prefix + 6, m->prefix_len - 6); - lst += m->prefix_len - 6; + memcpy(lst, m->prefix + 5, m->prefix_len - 5); + lst += m->prefix_len - 5; *lst++ = '\0'; } } @@ -38,8 +38,8 @@ get_kdev(char *lst) static long handle(VfsReq *req) { - static char *kdev = NULL; - static int kdev_len = 0; + static char *dev = NULL; + static int dev_len = 0; const char *lst = NULL; int len = 0; @@ -47,17 +47,17 @@ handle(VfsReq *req) if (req->type != VFSOP_OPEN) { switch ((uintptr_t __force)req->id) { case Hbase: - lst = "kdev/"; + lst = "dev/"; len = strlen(lst) + 1; break; - case Hkdev: - if (!kdev) { - kdev_len = get_kdev(NULL); - kdev = kmalloc(kdev_len); - get_kdev(kdev); + case Hdev: + if (!dev) { + dev_len = get_dev(NULL); + dev = kmalloc(dev_len); + get_dev(dev); } - lst = kdev; - len = kdev_len; + lst = dev; + len = dev_len; break; default: assert(false); @@ -67,7 +67,7 @@ handle(VfsReq *req) switch (req->type) { case VFSOP_OPEN: if (reqpathcmp(req, "/")) return Hbase; - if (reqpathcmp(req, "/kdev/")) return Hkdev; + if (reqpathcmp(req, "/dev/")) return Hdev; return -ENOENT; case VFSOP_READ: return req_readcopy(req, lst, len); diff --git a/src/kernel/arch/amd64/driver/pata.c b/src/kernel/arch/amd64/driver/pata.c index da8b541..cc6645d 100644 --- a/src/kernel/arch/amd64/driver/pata.c +++ b/src/kernel/arch/amd64/driver/pata.c @@ -13,7 +13,7 @@ static const int root_id = 100; static void accept(VfsReq *req); void pata_init(void) { ata_init(); - vfs_root_register("/kdev/ata/", accept); + vfs_root_register("/dev/ata/", accept); } static void accept(VfsReq *req) { diff --git a/src/kernel/arch/amd64/driver/ps2.c b/src/kernel/arch/amd64/driver/ps2.c index f2a98a2..f0c5f2c 100644 --- a/src/kernel/arch/amd64/driver/ps2.c +++ b/src/kernel/arch/amd64/driver/ps2.c @@ -58,7 +58,7 @@ void ps2_init(void) { irq_fn[IRQ_PS2KB] = ps2_irq; irq_fn[IRQ_PS2MOUSE] = ps2_irq; - vfs_root_register("/kdev/ps2/", accept); + vfs_root_register("/dev/ps2/", accept); } static void ps2_irq(void) { diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c index d55a58f..42b2abb 100644 --- a/src/kernel/arch/amd64/driver/rtl8139.c +++ b/src/kernel/arch/amd64/driver/rtl8139.c @@ -80,7 +80,7 @@ void rtl8139_init(uint32_t bdf) { rx_irq_enable(false); - vfs_root_register("/kdev/eth", accept); + vfs_root_register("/dev/eth", accept); } static void rtl8139_irq(void) { diff --git a/src/kernel/arch/amd64/driver/serial.c b/src/kernel/arch/amd64/driver/serial.c index 4ee8639..6f383a3 100644 --- a/src/kernel/arch/amd64/driver/serial.c +++ b/src/kernel/arch/amd64/driver/serial.c @@ -20,7 +20,7 @@ static VfsReq *hung_reads = NULL; void serial_init(void) { if (COM1_exists) { - vfs_root_register("/kdev/com1", accept); + vfs_root_register("/dev/com1", accept); } } diff --git a/src/kernel/arch/amd64/driver/video.c b/src/kernel/arch/amd64/driver/video.c index 390e8dd..5ce9a30 100644 --- a/src/kernel/arch/amd64/driver/video.c +++ b/src/kernel/arch/amd64/driver/video.c @@ -65,5 +65,5 @@ void video_init(GfxInfo fb_) { fb = fb_; snprintf(namebuf, sizeof namebuf, "%ux%ux%u", fb.width, fb.height, fb.bpp); namelen = strlen(namebuf); - vfs_root_register("/kdev/video/", accept); + vfs_root_register("/dev/video/", accept); } |