]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
initrd: remove placeholder read wrapper; ignore analysis artifacts
authorTulio A M Mendes <[email protected]>
Fri, 6 Feb 2026 13:17:09 +0000 (10:17 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 6 Feb 2026 13:17:09 +0000 (10:17 -0300)
.gitignore
src/drivers/initrd.c

index 05ef27b56d8278847559e5a0ce8758afd16c592d..7e73df7241d3b27b5b93c60a264313c67689f78b 100644 (file)
@@ -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/
index bd21bde24c4734fe11da11e8df6d6ce0989d162a..c4650338c7488d2bd6c594a8d3899e121c45cd79 100644 (file)
@@ -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) {