aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/dev/pciide.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-24 16:38:29 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-24 16:38:29 +0100
commitfa8a840c6dfc9eb737ef5d777f066b05eb8d9544 (patch)
tree1b7b0accd02ef635065bf11d0f3502ba6aa4875c /src/kernel/dev/pciide.c
parentf2c07854463763ed82e00857ae6d9bcbc924e42c (diff)
downloadkogata-fa8a840c6dfc9eb737ef5d777f066b05eb8d9544.tar.gz
kogata-fa8a840c6dfc9eb737ef5d777f066b05eb8d9544.zip
More preparation for iso9660
Diffstat (limited to 'src/kernel/dev/pciide.c')
-rw-r--r--src/kernel/dev/pciide.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/kernel/dev/pciide.c b/src/kernel/dev/pciide.c
index 58bccfd..5d79470 100644
--- a/src/kernel/dev/pciide.c
+++ b/src/kernel/dev/pciide.c
@@ -742,8 +742,7 @@ size_t ide_vfs_write(fs_handle_ptr f, size_t offset, size_t len, const char* buf
if (offset % d->block_size != 0) return 0;
if (len % d->block_size != 0) return 0;
-
- uint8_t err = ide_write_sectors(d->c, d->device,
+uint8_t err = ide_write_sectors(d->c, d->device,
offset / d->block_size, len / d->block_size, (char*)buf);
if (err != 0) return 0;
@@ -751,7 +750,13 @@ size_t ide_vfs_write(fs_handle_ptr f, size_t offset, size_t len, const char* buf
}
int ide_vfs_ioctl(fs_handle_ptr f, int command, void* data) {
- // TODO
+ ide_vfs_dev_t *d = (ide_vfs_dev_t*)f;
+
+ if (command == IOCTL_BLOCKDEV_GET_BLOCK_SIZE)
+ return d->block_size;
+ if (command == IOCTL_BLOCKDEV_GET_BLOCK_COUNT)
+ return d->c->devices[d->device].size;
+
return 0;
}