blob: 3280b343969d1c3dc683fd67b8a8b249207676c1 [file] [log] [blame]
Thomas Heijligend1e04572023-11-27 14:28:55 +00001package body FS.FILO is
2
3 procedure Read
4 (Buffer : in out Buffer_Type;
5 Offset : in Natural;
6 Bytes_Read: out Natural)
7 is
8 Sector_Size : constant Natural := 512;
9 Sector : constant Interfaces.C.unsigned_long := Offset / Sector_Size;
10 Byte_Offset : constant Interfaces.C.unsigned_long := Offset rem Sector_Size;
11 Byte_Len : constant Interfaces.C.unsigned_long := Buffer'Length;
12 begin
13
14 Bytes_Read := C_devread
15 (sector => Sector,
16 byte_offset => Byte_Offset,
17 byte_len => Byte_Len,
18 buf => Buffer'Address);
19 end Read;
20
21end FS.FILO;
22