summaryrefslogtreecommitdiff
path: root/src/cmd/init
diff options
context:
space:
mode:
authordzwdz2023-09-11 03:17:23 +0200
committerdzwdz2023-09-11 03:17:23 +0200
commit1e54db260811d0d759e76be725d50f4b59d0fc41 (patch)
tree7e7fabe0ec777fd6aa9d1847e746a415f31ea12e /src/cmd/init
parent73ea9f2e3556dd753b32ac4a2c34581a4126eab1 (diff)
*: rename /kdev/ to /dev/
Diffstat (limited to 'src/cmd/init')
-rw-r--r--src/cmd/init/driver/ps2.c3
-rw-r--r--src/cmd/init/init.c14
2 files changed, 9 insertions, 8 deletions
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);
}