bootsector.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted
Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PED_FAT_BOOTSECTOR_H
#define PED_FAT_BOOTSECTOR_H
typedef struct _FatBootSector FatBootSector;
typedef struct _FatInfoSector FatInfoSector;
#include "fat.h"
#define FAT32_INFO_MAGIC1 0x41615252
#define FAT32_INFO_MAGIC2 0x61417272
#define FAT32_INFO_MAGIC3 0xaa55
/* stolen from mkdosfs, by Dave Hudson */
#define FAT_BOOT_MESSAGE \
"This partition does not have an operating system loader installed on it.\n\r"\
"Press a key to reboot..."
"\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: */ \
#define FAT_BOOT_CODE_LENGTH 128
#ifdef __sun
#define __attribute__(X) /*nothing*/
#endif /* __sun */
#ifdef __sun
#pragma pack(1)
#endif
union __attribute__ ((packed)) {
/* FAT16 fields */
struct __attribute__ ((packed)) {
} fat16;
/* FAT32 fields */
struct __attribute__ ((packed)) {
} fat32;
} u;
};
};
#ifdef __sun
#pragma pack()
#endif
const PedGeometry* geom);
#endif /* PED_FAT_BOOTSECTOR_H */