feature (drive manager): added device pointer to drive struct

This commit is contained in:
antifallobst 2023-05-16 23:38:14 +02:00
parent 0bed26ff26
commit 7f711d853e
3 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ struct drive_T {
drive_partition_chunk_T* partitions_chunks; drive_partition_chunk_T* partitions_chunks;
drive_controller_types_E controller_type; drive_controller_types_E controller_type;
void* controller; void* controller;
void* device;
}; };
struct drive_chunk_T { struct drive_chunk_T {

View File

@ -1,6 +1,7 @@
// This file is part of noxos and licensed under the MIT open source license // This file is part of noxos and licensed under the MIT open source license
#include "drivers/drive_manager.h" #include "drivers/drive_manager.h"
#include "drivers/ahci.h"
#include "utils/memory.h" #include "utils/memory.h"
#include "utils/logger.h" #include "utils/logger.h"
@ -67,6 +68,7 @@ drive_T* drive_manager_add_drive(drive_controller_types_E controller_type, void*
drive->partitions_chunks = drive_partition_chunk_alloc(NULL); drive->partitions_chunks = drive_partition_chunk_alloc(NULL);
drive->controller_type = controller_type; drive->controller_type = controller_type;
drive->controller = controller; drive->controller = controller;
drive->device = device;
drive->chunk = chunk; drive->chunk = chunk;
chunk->num_drives += 1; chunk->num_drives += 1;

View File

@ -291,6 +291,8 @@ void vfs_init(boot_info_T* boot_info) {
// unpacking initial ramdisk to '/initrd/' // unpacking initial ramdisk to '/initrd/'
vfs_node_create(g_root_fs.root_node, "initrd", VFS_NODE_MOUNT, &g_ramdisk_fs); vfs_node_create(g_root_fs.root_node, "initrd", VFS_NODE_MOUNT, &g_ramdisk_fs);
vfs_unpack_archive_ustar(&g_ramdisk_fs, boot_info->ramdisk_file->address); vfs_unpack_archive_ustar(&g_ramdisk_fs, boot_info->ramdisk_file->address);
vfs_node_create(g_root_fs.root_node, "devices", VFS_NODE_DIRECTORY, NULL);
} }
vfs_node_T* vfs_resolve_path(fs_T* filesystem, string_t path) { vfs_node_T* vfs_resolve_path(fs_T* filesystem, string_t path) {