Loading...
Searching...
No Matches
bootsector.h File Reference

Go to the source code of this file.

## Macros

#define | FAT32_INFO_MAGIC1 0x41615252
#define | FAT32_INFO_MAGIC2 0x61417272
#define | FAT32_INFO_MAGIC3 0xaa55
#define | FAT_BOOT_CODE
#define | FAT_BOOT_JUMP "\xeb\x58\x90" /* jmp +5a */
#define | FAT_BOOT_MESSAGE

## Functions

struct | __attribute__ ((packed)) _FatBootSector
int | fat_boot_sector_analyse (FatBootSector *bs, PedFileSystem *fs)
int | fat_boot_sector_generate (FatBootSector **bs, const PedFileSystem *fs)
FatType | fat_boot_sector_probe_type (const FatBootSector *bs, const PedGeometry *geom)
int | fat_boot_sector_read (FatBootSector **bs, const PedGeometry *geom)
int | fat_boot_sector_set_boot_code (FatBootSector **bs, const PedFileSystem *fs)
int | fat_boot_sector_write (const FatBootSector *bs, PedFileSystem *fs)
int | fat_info_sector_generate (FatInfoSector **is, const PedFileSystem *fs)
int | fat_info_sector_read (FatInfoSector **is, const PedFileSystem *fs)
int | fat_info_sector_write (const FatInfoSector *is, PedFileSystem *fs)

## Macro Definition Documentation

## FAT32_INFO_MAGIC1

#define FAT32_INFO_MAGIC1 0x41615252

## FAT32_INFO_MAGIC2

#define FAT32_INFO_MAGIC2 0x61417272

## FAT32_INFO_MAGIC3

#define FAT32_INFO_MAGIC3 0xaa55

## FAT_BOOT_CODE

#define FAT_BOOT_CODE

Value:
"\x0e" /* push cs */ \
"\x1f" /* pop ds */ \
"\xbe\x74\x7e" /* mov si, offset message */ \
/* write_msg_loop: */ \
"\xac" /* lodsb */ \
"\x22\xc0" /* and al, al */ \
"\x74\x06" /* jz done (+8) */ \
"\xb4\x0e" /* mov ah, 0x0e */ \
"\xcd\x10" /* int 0x10 */ \
"\xeb\xf5" /* jmp write_msg_loop */ \
/* done: */ \
"\xb4\x00" /* mov ah, 0x00 */ \
"\xcd\x16" /* int 0x16 */ \
"\xb4\x00" /* mov ah, 0x00 */ \
"\xcd\x19" /* int 0x19 */ \
"\xeb\xfe" /* jmp +0 - in case int 0x19 */ \
/* doesn't work */ \
/* message: */ \
FAT_BOOT_MESSAGE
FAT_BOOT_MESSAGE
#define FAT_BOOT_MESSAGE
Definition bootsector.h:34

## FAT_BOOT_JUMP

#define FAT_BOOT_JUMP "\xeb\x58\x90" /* jmp +5a */

## FAT_BOOT_MESSAGE

#define FAT_BOOT_MESSAGE

Value:
"This partition does not have an operating system loader installed on it.\n\r"\
"Press a key to reboot..."

## Function Documentation

## __attribute__()

struct __attribute__ | ( | (packed) |  | ) |

## fat_boot_sector_analyse()

int fat_boot_sector_analyse | ( | FatBootSector * | bs,
|  | PedFileSystem * | fs )

## fat_boot_sector_generate()

int fat_boot_sector_generate | ( | FatBootSector ** | bs,
|  | const PedFileSystem * | fs )

## fat_boot_sector_probe_type()

FatType fat_boot_sector_probe_type | ( | const FatBootSector * | bs,
|  | const PedGeometry * | geom )

## fat_boot_sector_read()

int fat_boot_sector_read | ( | FatBootSector ** | bs,
|  | const PedGeometry * | geom )

## fat_boot_sector_set_boot_code()

int fat_boot_sector_set_boot_code | ( | FatBootSector ** | bs,
|  | const PedFileSystem * | fs )

## fat_boot_sector_write()

int fat_boot_sector_write | ( | const FatBootSector * | bs,
|  | PedFileSystem * | fs )

## fat_info_sector_generate()

int fat_info_sector_generate | ( | FatInfoSector ** | is,
|  | const PedFileSystem * | fs )

## fat_info_sector_read()

int fat_info_sector_read | ( | FatInfoSector ** | is,
|  | const PedFileSystem * | fs )

## fat_info_sector_write()

int fat_info_sector_write | ( | const FatInfoSector * | is,
|  | PedFileSystem * | fs )