Read
()
| 88 | |
| 89 | // Read |
| 90 | pub fn read() -> Self |
| 91 | { |
| 92 | let blk = Blk::read(SBLK_ADDR); |
| 93 | let data = blk.data(); |
| 94 | // TODO: Add debugging message |
| 95 | // serprint!(&data[0..8], SIG); |
| 96 | |
| 97 | Self |
| 98 | { |
| 99 | sig: SIG, |
| 100 | vers: data[5], |
| 101 | blksize: 2 << (8 + data[9] as u32), |
| 102 | blkcount: u32::from_be_bytes(data[10..14].try_into().unwrap()), |
| 103 | alloc_count: u32::from_be_bytes(data[14..18].try_into().unwrap()), |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // Write |
| 108 | pub fn write(&self) |