Revised kernel.c for readSector function.