installgrub.h revision 1a902ef8628b0dffd6df5442354ab59bb8530962
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _INSTALLGRUB_H
#define _INSTALLGRUB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/multiboot.h>
#include "./../common/bblk_einfo.h"
#define SECTOR_SIZE (512)
typedef struct _device_data {
char *path;
char *path_p0;
int part_fd;
int disk_fd;
int slice;
int partition;
char boot_sector[SECTOR_SIZE];
} ig_device_t;
typedef struct _stage2_data {
char *buf;
char *file;
char *extra;
} ig_stage2_t;
typedef struct _ig_data {
char stage1_buf[SECTOR_SIZE];
} ig_data_t;
enum ig_devtype_t {
IG_DEV_X86BOOTPAR = 1,
};
#define STAGE1_BPB_OFFSET (0x3)
#define STAGE1_BPB_SIZE (0x3B)
#define STAGE1_BOOT_DRIVE (0x40)
#define STAGE1_FORCE_LBA (0x41)
#define STAGE1_STAGE2_ADDRESS (0x42)
#define STAGE1_STAGE2_SECTOR (0x44)
#define STAGE1_STAGE2_SEGMENT (0x48)
#define STAGE2_BLKOFF(type) \
#ifdef __cplusplus
}
#endif
#endif /* _INSTALLGRUB_H */