xref: /illumos-gate/usr/src/grub/grub-0.97/lib/device.h (revision 1b8adde7ba7d5e04395c141c5400dc2cffd7d809)
1 /* device.h - Define macros and declare prototypes for device.c */
2 /*
3  *  GRUB  --  GRand Unified Bootloader
4  *  Copyright (C) 1999,2000,2004  Free Software Foundation, Inc.
5  *
6  *  This program 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 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program 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.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 
21 #ifndef DEVICE_MAP_HEADER
22 #define DEVICE_MAP_HEADER	1
23 
24 /* The maximum number of BIOS disks.  */
25 #define NUM_DISKS	256
26 
27 /* Simulated disk sizes. */
28 #define DEFAULT_FD_CYLINDERS	80
29 #define DEFAULT_FD_HEADS	2
30 #define DEFAULT_FD_SECTORS	18
31 #define DEFAULT_HD_CYLINDERS	620
32 #define DEFAULT_HD_HEADS	128
33 #define DEFAULT_HD_SECTORS	63
34 
35 /* Function prototypes.  */
36 extern void get_drive_geometry (struct geometry *geom, char **map, int drive);
37 extern int check_device (const char *device);
38 extern int init_device_map (char ***map, const char *map_file,
39 			    int no_floppies);
40 extern void restore_device_map (char **map);
41 
42 #ifdef __linux__
43 extern int is_disk_device (char **map, int drive);
44 extern int write_to_partition (char **map, int drive, int partition,
45 			       int offset, int size, const char *buf);
46 #endif /* __linux__ */
47 
48 #endif /* DEVICE_MAP_HEADER */
49