aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/iso9660
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fs/iso9660')
-rw-r--r--src/kernel/fs/iso9660/iso9660.c20
-rw-r--r--src/kernel/fs/iso9660/iso9660.h8
2 files changed, 15 insertions, 13 deletions
diff --git a/src/kernel/fs/iso9660/iso9660.c b/src/kernel/fs/iso9660/iso9660.c
index f8eddd4..81b1ba6 100644
--- a/src/kernel/fs/iso9660/iso9660.c
+++ b/src/kernel/fs/iso9660/iso9660.c
@@ -4,21 +4,22 @@
#include <kernel/fs/iso9660/iso9660.h>
#include <mlibc/stdlib.h>
-struct ISO9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz) {
+struct iso9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz)
+{
ATAPI_read(1, 0x10);
uint32_t last_len = *(uint32_t *) (
ATAPI_PIO_BUFFER +
ISO9660_ROOT_RECORD_OFFSET +
ISO9660_DIR_EAR_LENGTH
);
- uint32_t last_LBA = *(uint32_t *) (
+ uint32_t last_lba = *(uint32_t *) (
ATAPI_PIO_BUFFER +
ISO9660_ROOT_RECORD_OFFSET +
ISO9660_DIR_EAR_LBA
);
for (uint8_t dirs_i = 0; dirs_i < dirs_sz; dirs_i++) {
- ATAPI_read((last_len % 2048 != 0) + (last_len / 2048), last_LBA);
+ ATAPI_read((last_len % 2048 != 0) + (last_len / 2048), last_lba);
uint8_t found = 0;
for (uint32_t i = 0; i < last_len && !found;) {
@@ -36,7 +37,7 @@ struct ISO9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz) {
if (strcmp(dirs[dirs_i], filename) == 0) {
found = 1;
- last_LBA = *(uint32_t *) (ATAPI_PIO_BUFFER + i + ISO9660_DIR_EAR_LBA);
+ last_lba = *(uint32_t *) (ATAPI_PIO_BUFFER + i + ISO9660_DIR_EAR_LBA);
last_len = *(uint32_t *) (ATAPI_PIO_BUFFER + i + ISO9660_DIR_EAR_LENGTH);
} else {
i += *(uint8_t *) (ATAPI_PIO_BUFFER + i + ISO9660_DIR_RECORD_LENGTH);
@@ -44,17 +45,18 @@ struct ISO9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz) {
}
if (!found) {
- return (struct ISO9660_entity *) 0;
+ return (struct iso9660_entity *) 0;
}
}
- struct ISO9660_entity *ret = (struct ISO9660_entity *) kmalloc(sizeof(struct ISO9660_entity));
- ret->LBA = last_LBA;
+ struct iso9660_entity *ret = (struct iso9660_entity *) kmalloc(sizeof(struct iso9660_entity));
+ ret->lba = last_lba;
ret->length = last_len;
return ret;
}
-uint8_t *ISO9660_read(struct ISO9660_entity *entity) {
- ATAPI_read((entity->length % 2048 != 0) + (entity->length / 2048), entity->LBA);
+uint8_t *ISO9660_read(struct iso9660_entity *entity)
+{
+ ATAPI_read((entity->length % 2048 != 0) + (entity->length / 2048), entity->lba);
return (uint8_t *) ATAPI_PIO_BUFFER;
} \ No newline at end of file
diff --git a/src/kernel/fs/iso9660/iso9660.h b/src/kernel/fs/iso9660/iso9660.h
index 3de5d1a..86629e4 100644
--- a/src/kernel/fs/iso9660/iso9660.h
+++ b/src/kernel/fs/iso9660/iso9660.h
@@ -10,13 +10,13 @@
#include <stdint.h>
-struct ISO9660_entity {
- uint32_t LBA;
+struct iso9660_entity {
+ uint32_t lba;
uint32_t length;
};
-struct ISO9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz);
+struct iso9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz);
-uint8_t *ISO9660_read(struct ISO9660_entity *entity);
+uint8_t *ISO9660_read(struct iso9660_entity *entity);
#endif