Thomas Heijligen | d1e0457 | 2023-11-27 14:28:55 +0000 | [diff] [blame^] | 1 | package 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 | |
| 21 | end FS.FILO; |
| 22 | |