• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  *  GRUB  --  GRand Unified Bootloader
4  *  Copyright (C) 2001  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 /* command-line parameter defines */
22 #define RB_ASKNAME      0x01	/* ask for file name to reboot from */
23 #define RB_SINGLE       0x02	/* reboot to single user only */
24 #define RB_NOSYNC       0x04	/* dont sync before reboot */
25 #define RB_HALT         0x08	/* don't reboot, just halt */
26 #define RB_INITNAME     0x10	/* name given for /etc/init (unused) */
27 #define RB_DFLTROOT     0x20	/* use compiled-in rootdev */
28 #define RB_KDB          0x40	/* give control to kernel debugger */
29 #define RB_RDONLY       0x80	/* mount root fs read-only */
30 #define RB_DUMP         0x100	/* dump kernel memory before reboot */
31 #define RB_MINIROOT     0x200	/* mini-root present in memory at boot time */
32 #define RB_CONFIG       0x400	/* invoke user configuration routing */
33 #define RB_VERBOSE      0x800	/* print all potentially useful info */
34 #define RB_SERIAL       0x1000	/* user serial port as console */
35 #define RB_CDROM        0x2000	/* use cdrom as root */
36 #define RB_GDB		0x8000	/* use GDB remote debugger instead of DDB */
37 #define RB_MUTE		0x10000	/* Come up with the console muted */
38 #define RB_MULTIPLE	0x20000000	/* Use multiple consoles */
39 
40 #define RB_BOOTINFO     0x80000000	/* have `struct bootinfo *' arg */
41 
42 /*
43  * Constants for converting boot-style device number to type,
44  * adaptor (uba, mba, etc), unit number and partition number.
45  * Type (== major device number) is in the low byte
46  * for backward compatibility.  Except for that of the "magic
47  * number", each mask applies to the shifted value.
48  * Format:
49  *       (4) (4) (4) (4)  (8)     (8)
50  *      --------------------------------
51  *      |MA | AD| CT| UN| PART  | TYPE |
52  *      --------------------------------
53  */
54 #define B_ADAPTORSHIFT          24
55 #define B_CONTROLLERSHIFT       20
56 #define B_UNITSHIFT             16
57 #define B_PARTITIONSHIFT        8
58 #define B_TYPESHIFT             0
59 
60 #define B_DEVMAGIC      ((unsigned long)0xa0000000)
61 
62 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
63         (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
64         ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
65         ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
66 
67 
68 /* Only change the version number if you break compatibility. */
69 #define BOOTINFO_VERSION        1
70 
71 #define N_BIOS_GEOM             8
72 
73 /*
74  * A zero bootinfo field often means that there is no info available.
75  * Flags are used to indicate the validity of fields where zero is a
76  * normal value.
77  */
78 struct bootinfo
79   {
80     unsigned int bi_version;
81     unsigned char *bi_kernelname;
82     struct nfs_diskless *bi_nfs_diskless;
83     /* End of fields that are always present. */
84 #define bi_endcommon            bi_n_bios_used
85     unsigned int bi_n_bios_used;
86     unsigned long bi_bios_geom[N_BIOS_GEOM];
87     unsigned int bi_size;
88     unsigned char bi_memsizes_valid;
89     unsigned char bi_bios_dev;
90     unsigned char bi_pad[2];
91     unsigned long bi_basemem;
92     unsigned long bi_extmem;
93     unsigned long bi_symtab;
94     unsigned long bi_esymtab;
95   };
96