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>
27 void grub_util_biosdisk_init (const char *dev_map
);
28 void grub_util_biosdisk_fini (void);
29 char *grub_util_biosdisk_get_grub_dev (const char *os_dev
);
30 const char *grub_util_biosdisk_get_osdev (grub_disk_t disk
);
31 int grub_util_biosdisk_is_present (const char *name
);
32 int grub_util_biosdisk_is_floppy (grub_disk_t disk
);
34 grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk
);
35 grub_err_t
grub_util_biosdisk_flush (struct grub_disk
*disk
);
36 void grub_util_pull_device (const char *osname
);
38 grub_util_fd_seek (int fd
, const char *name
, grub_uint64_t sector
);
39 ssize_t
grub_util_fd_read (int fd
, char *buf
, size_t len
);
40 ssize_t
grub_util_fd_write (int fd
, const char *buf
, size_t len
);
42 grub_cryptodisk_cheat_mount (const char *sourcedev
, const char *cheat
);
43 void grub_util_cryptodisk_print_uuid (grub_disk_t disk
);
45 grub_util_get_ldm (grub_disk_t disk
, grub_disk_addr_t start
);
47 grub_util_is_ldm (grub_disk_t disk
);
50 grub_util_ldm_embed (struct grub_disk
*disk
, unsigned int *nsectors
,
51 unsigned int max_nsectors
,
52 grub_embed_type_t embed_type
,
53 grub_disk_addr_t
**sectors
);
56 grub_hostdisk_find_partition_start (const char *dev
);
58 grub_hostdisk_os_dev_to_grub_drive (const char *os_dev
, int add
);
60 #if !defined(__MINGW32__)
62 grub_util_get_fd_size (int fd
, const char *name
, unsigned *log_secsize
);
66 grub_util_get_os_disk (const char *os_dev
);
68 #ifdef HAVE_DEVICE_MAPPER
70 grub_util_get_dm_node_linear_info (const char *dev
,
72 grub_disk_addr_t
*st
);
75 #endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */