paul@263 | 1 | /* |
paul@263 | 2 | * Boot-related utilities. |
paul@263 | 3 | * |
paul@263 | 4 | * Copyright (C) 2024 Paul Boddie <paul@boddie.org.uk> |
paul@263 | 5 | * |
paul@263 | 6 | * This program is free software; you can redistribute it and/or |
paul@263 | 7 | * modify it under the terms of the GNU General Public License as |
paul@263 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@263 | 9 | * the License, or (at your option) any later version. |
paul@263 | 10 | * |
paul@263 | 11 | * This program is distributed in the hope that it will be useful, |
paul@263 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@263 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@263 | 14 | * GNU General Public License for more details. |
paul@263 | 15 | * |
paul@263 | 16 | * You should have received a copy of the GNU General Public License |
paul@263 | 17 | * along with this program; if not, write to the Free Software |
paul@263 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@263 | 19 | * Boston, MA 02110-1301, USA |
paul@263 | 20 | */ |
paul@263 | 21 | |
paul@263 | 22 | #pragma once |
paul@263 | 23 | |
paul@263 | 24 | #include <l4/sys/compiler.h> |
paul@263 | 25 | #include <stdint.h> |
paul@263 | 26 | |
paul@263 | 27 | struct chs_address |
paul@263 | 28 | { |
paul@263 | 29 | uint8_t head; |
paul@263 | 30 | uint16_t sector:6, cylinder:10; |
paul@263 | 31 | } __attribute__((packed)); |
paul@263 | 32 | |
paul@263 | 33 | struct partition_table_entry |
paul@263 | 34 | { |
paul@263 | 35 | uint8_t status; |
paul@263 | 36 | struct chs_address chs_first_sector; |
paul@263 | 37 | uint8_t partition_type; |
paul@263 | 38 | struct chs_address chs_last_sector; |
paul@263 | 39 | uint32_t lba_first_sector; |
paul@263 | 40 | uint32_t num_sectors; |
paul@263 | 41 | } __attribute__((packed)); |
paul@263 | 42 | |
paul@263 | 43 | EXTERN_C_BEGIN |
paul@263 | 44 | |
paul@263 | 45 | struct partition_table_entry *get_partition_table(uint8_t *data); |
paul@263 | 46 | |
paul@263 | 47 | EXTERN_C_END |