i am tring to get a string as an input to a function that i dont know the size of:
pub fn findTable(signature: *const []u8) ?*SDTHeader {
const localRsdp = tables.rsdp orelse {
virtio.printf("can't find table rsdp not found\n", .{});
return null;
};
const rsdt = localRsdp.rsdt_address;
const enteries = (rsdt.h.length - @sizeOf(SDTHeader)) / @sizeOf(u32);
const enteriesArray: [*]*SDTHeader = @ptrCast(&rsdt.entries);
for (0..enteries) |i| {
const header: *SDTHeader = enteriesArray[i];
if (std.mem.eql(u8, &header.signature, signature)) {
return header;
}
}
virtio.printf("table not found with signiture {}\n", .{signature});
return null;
}
but it gives the error:
src/kernel/arch/x86/acpi.zig:170:31: error: expected type '*const []u8', found '*const [4:0]u8'
return @ptrCast(findTable(FADT_SIGNATURE));
also if you find any problems in my code or things that i can do better tell me