1 /* biosdisk.h - emulate biosdisk */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2002,2007 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_BIOSDISK_MACHINE_UTIL_HEADER
21 #define GRUB_BIOSDISK_MACHINE_UTIL_HEADER 1
23 #include <grub/disk.h>
24 #include <grub/partition.h>
25 #include <sys/types.h>
26 #include <grub/emu/hostfile.h>
29 grub_util_fd_open_device (const grub_disk_t disk
, grub_disk_addr_t sector
, int flags
,
30 grub_disk_addr_t
*max
);
32 void grub_util_biosdisk_init (const char *dev_map
);
33 void grub_util_biosdisk_fini (void);
34 char *grub_util_biosdisk_get_grub_dev (const char *os_dev
);
35 const char *grub_util_biosdisk_get_osdev (grub_disk_t disk
);
36 int grub_util_biosdisk_is_present (const char *name
);
37 int grub_util_biosdisk_is_floppy (grub_disk_t disk
);
39 grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk
);
40 grub_err_t
grub_util_biosdisk_flush (struct grub_disk
*disk
);
42 grub_cryptodisk_cheat_mount (const char *sourcedev
, const char *cheat
);
44 grub_util_cryptodisk_get_uuid (grub_disk_t disk
);
46 grub_util_get_ldm (grub_disk_t disk
, grub_disk_addr_t start
);
48 grub_util_is_ldm (grub_disk_t disk
);
51 grub_util_ldm_embed (struct grub_disk
*disk
, unsigned int *nsectors
,
52 unsigned int max_nsectors
,
53 grub_embed_type_t embed_type
,
54 grub_disk_addr_t
**sectors
);
57 grub_hostdisk_os_dev_to_grub_drive (const char *os_dev
, int add
);
61 grub_util_get_os_disk (const char *os_dev
);
64 grub_util_get_dm_node_linear_info (dev_t dev
,
66 grub_disk_addr_t
*st
);
69 /* Supplied by hostdisk_*.c. */
71 grub_util_get_fd_size_os (grub_util_fd_t fd
, const char *name
, unsigned *log_secsize
);
72 /* REturns partition offset in 512B blocks. */
74 grub_hostdisk_find_partition_start_os (const char *dev
);
76 grub_hostdisk_flush_initial_buffer (const char *os_dev
);
80 grub_util_hurd_get_disk_info (const char *dev
, grub_uint32_t
*secsize
, grub_disk_addr_t
*offset
,
81 grub_disk_addr_t
*size
, char **parent
);
84 struct grub_util_hostdisk_data
93 void grub_host_init (void);
94 void grub_host_fini (void);
95 void grub_hostfs_init (void);
96 void grub_hostfs_fini (void);
98 #endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */