AquilaOS documentation
How it works, and its code
Toggle main menu visibility
Loading...
Searching...
No Matches
mbr.h
Go to the documentation of this file.
1
#ifndef _FS_MBR_H
2
#define _FS_MBR_H
3
4
#include <
core/system.h
>
5
6
struct
mbr_part
;
7
struct
mbr
;
8
9
/* The master boot record: a disk's first sector, with its partition
10
* table (fs/mbr.c reads it). */
11
12
/* A partition entry's type for an unused entry; the MBR's signature. */
13
#define MBR_TYPE_UNUSED 0x00
14
#define MBR_BOOT_SIGNATURE 0xAA55
15
17
struct
mbr_part
{
18
uint8_t
status
;
19
struct
{
20
uint8_t
h
;
21
uint16_t
cs
;
22
}
__packed
start_chs
;
23
uint8_t
type
;
24
struct
{
25
uint8_t
h
;
26
uint16_t
cs
;
27
}
__packed
end_chs
;
28
uint32_t
start_lba
;
29
uint32_t
sectors_count
;
30
}
__packed
;
31
33
struct
mbr
{
34
/* the boot loader's code */
35
uint8_t
bootloader
[440];
36
uint32_t
disk_signiture
;
37
uint16_t
copy_protected
;
38
39
/* the partition table */
40
struct
mbr_part
ptab
[4];
41
uint16_t
boot_signature
;
42
}
__packed
;
43
44
#endif
/* ! _FS_MBR_H */
system.h
__packed
#define __packed
Definition
system.h:30
uint32_t
unsigned int uint32_t
Definition
stddef.h:22
uint8_t
unsigned char uint8_t
Definition
stddef.h:20
uint16_t
unsigned short int uint16_t
Definition
stddef.h:21
mbr_part::[struct].end_chs::h
uint8_t h
mbr_part::[struct].end_chs::cs
uint16_t cs
mbr_part::[struct].start_chs::cs
uint16_t cs
mbr_part::[struct].start_chs::h
uint8_t h
mbr_part
A partition table entry.
Definition
mbr.h:17
mbr_part::start_lba
uint32_t start_lba
Definition
mbr.h:28
mbr_part::sectors_count
uint32_t sectors_count
Definition
mbr.h:29
mbr_part::type
uint8_t type
Definition
mbr.h:23
mbr_part::end_chs
struct mbr_part::@366002065263140324102276265346331217201127360205 end_chs
mbr_part::start_chs
struct mbr_part::@150037107302234200243332173256162073111374016210 start_chs
mbr_part::status
uint8_t status
Definition
mbr.h:18
mbr
The master boot record.
Definition
mbr.h:33
mbr::boot_signature
uint16_t boot_signature
Definition
mbr.h:41
mbr::ptab
struct mbr_part ptab[4]
Definition
mbr.h:40
mbr::disk_signiture
uint32_t disk_signiture
Definition
mbr.h:36
mbr::bootloader
uint8_t bootloader[440]
Definition
mbr.h:35
mbr::copy_protected
uint16_t copy_protected
Definition
mbr.h:37
kernel
include
fs
mbr.h
Generated by
1.18.0