From: Tulio A M Mendes Date: Fri, 6 Feb 2026 13:17:09 +0000 (-0300) Subject: initrd: remove placeholder read wrapper; ignore analysis artifacts X-Git-Url: https://projects.tadryanom.me/?a=commitdiff_plain;h=f05a139785c82ff307abeba0298f59247b61b258;p=AdrOS.git initrd: remove placeholder read wrapper; ignore analysis artifacts --- diff --git a/.gitignore b/.gitignore index 05ef27b..7e73df7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,12 @@ build/ # ISO staging: keep config, ignore generated kernel binaries iso/boot/*.bin +# Static analysis artifacts +compile_commands.json +clang-tidy.txt +cppcheck.txt +scanbuild-out/ + # Temporary folders iso_root/ isodir/ diff --git a/src/drivers/initrd.c b/src/drivers/initrd.c index bd21bde..c465033 100644 --- a/src/drivers/initrd.c +++ b/src/drivers/initrd.c @@ -8,29 +8,12 @@ fs_node_t* initrd_root; fs_node_t* root_nodes; // Array of file nodes int n_root_nodes; +uint32_t initrd_read_impl(fs_node_t* node, uint32_t offset, uint32_t size, uint8_t* buffer); + uint32_t initrd_read(fs_node_t* node, uint32_t offset, uint32_t size, uint8_t* buffer) { - initrd_file_header_t header = file_headers[node->inode]; - - if (offset > header.length) return 0; - if (offset + size > header.length) - size = header.length - offset; - - // Calculate memory location: location_of_headers + sizeof(headers) + offset_in_file - // Wait, our simple format: - // [n_files] [header 0] [header 1] ... [data] - // The 'offset' in header is relative to the START of the initrd or the data region? - // Let's assume relative to START of InitRD location. - - // We need to know the base address of InitRD. Let's store it globally or in node. - // Hack: Assuming offset in header is absolute address for now (patched during build) - // OR: offset is relative to initrd start. - - // Let's refine the format logic in initrd_init. - return 0; // Placeholder until init logic fixed below + return initrd_read_impl(node, offset, size, buffer); } -// Fixed read function -// We need to store the base address somewhere. static uint32_t initrd_location_base = 0; uint32_t initrd_read_impl(fs_node_t* node, uint32_t offset, uint32_t size, uint8_t* buffer) {