blob: 3280b343969d1c3dc683fd67b8a8b249207676c1 [file] [log] [blame]
package body FS.FILO is
procedure Read
(Buffer : in out Buffer_Type;
Offset : in Natural;
Bytes_Read: out Natural)
is
Sector_Size : constant Natural := 512;
Sector : constant Interfaces.C.unsigned_long := Offset / Sector_Size;
Byte_Offset : constant Interfaces.C.unsigned_long := Offset rem Sector_Size;
Byte_Len : constant Interfaces.C.unsigned_long := Buffer'Length;
begin
Bytes_Read := C_devread
(sector => Sector,
byte_offset => Byte_Offset,
byte_len => Byte_Len,
buf => Buffer'Address);
end Read;
end FS.FILO;