richterm

"terminal emulator" with support for text fonts and images for plan9
git clone git://nsmpr.xyz/richterm.git
Log | Files | Refs | README

commit 3f4e42688356a5c67bfbea96219aa971dedd3a0d
parent 1064dcb9efa975594980410708ab7b4d52bda0e1
Author: Pavel Renev <an2qzavok@gmail.com>
Date:   Sun,  6 Jun 2021 09:24:12 +0000

more fs.c

Diffstat:
Mdevfs.c | 3+--
Mfs.c | 15++++++++++++---
2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/devfs.c b/devfs.c @@ -64,8 +64,7 @@ initdevfs(void) dctl->wc = chancreate(sizeof(char *), 0); dctl->rc = chancreate(sizeof(int), 1024); srv.tree = alloctree("richterm", "richterm", DMDIR|0555, nil); - if (srv.tree == nil) - return nil; + if (srv.tree == nil) return nil; cons = createfile(srv.tree->root, "cons", "richterm", 0666, dctl); if (cons == nil) return nil; consctl = createfile(srv.tree->root, "consctl", "richterm", 0666, dctl); diff --git a/fs.c b/fs.c @@ -11,7 +11,14 @@ File *new; void fs_read(Req *r) { - respond(r, nil); + File *f; + Fsctl *fsctl; + f = r->fid->file; + fsctl = f->aux; + if (f == new) { + respond(r, "not implemented"); + } + else respond(r, "what"); } void @@ -30,8 +37,10 @@ initfs(void) }; fsctl = mallocz(sizeof(Fsctl), 1); fsctl->c = chancreate(sizeof(int), 0); - srv.tree = alloctree("richterm", "richterm", DMDIR|555, nil); + srv.tree = alloctree("richterm", "richterm", DMDIR|0555, nil); if (srv.tree == nil) return nil; - new = createfile(srv.tree->root, "new", "richterm", 0666, nil); + new = createfile(srv.tree->root, "new", "richterm", 0666, fsctl); + if (new == nil) return nil; + threadpostmountsrv(&srv, nil, "/mnt/richterm", MREPL); return fsctl; }