summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/driver/pata.c
diff options
context:
space:
mode:
authordzwdz2023-09-09 16:54:13 +0200
committerdzwdz2023-09-09 16:54:13 +0200
commit4516acc2814de7e1420109a9469600a5607eb984 (patch)
treef528afa2d2158c1d06ee203926e8c06251642868 /src/kernel/arch/amd64/driver/pata.c
parentb7e5252ab4955039ca548d7f8216bfc432a3bd62 (diff)
kernel: build /kdev/ on the fly
Diffstat (limited to 'src/kernel/arch/amd64/driver/pata.c')
-rw-r--r--src/kernel/arch/amd64/driver/pata.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/kernel/arch/amd64/driver/pata.c b/src/kernel/arch/amd64/driver/pata.c
index b0058f8..da8b541 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("/kdev/ata/", accept);
}
static void accept(VfsReq *req) {
@@ -23,11 +23,11 @@ static void accept(VfsReq *req) {
size_t len;
switch (req->type) {
case VFSOP_OPEN:
- if (reqpathcmp(req, "/")) ret = root_id;
- else if (reqpathcmp(req, "/0")) ret = 0;
- else if (reqpathcmp(req, "/1")) ret = 1;
- else if (reqpathcmp(req, "/2")) ret = 2;
- else if (reqpathcmp(req, "/3")) ret = 3;
+ if (reqpathcmp(req, "")) ret = root_id;
+ else if (reqpathcmp(req, "0")) ret = 0;
+ else if (reqpathcmp(req, "1")) ret = 1;
+ else if (reqpathcmp(req, "2")) ret = 2;
+ else if (reqpathcmp(req, "3")) ret = 3;
else ret = -ENOENT;
// TODO don't allow opening nonexistent drives
vfsreq_finish_short(req, ret);
@@ -70,6 +70,7 @@ static void accept(VfsReq *req) {
case VFSOP_GETSIZE:
if (id == root_id) {
+ // TODO getsize for all kernel provided directories
panic_unimplemented();
}
vfsreq_finish_short(req, ata_size(id));