]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/doscmd/disktab.c
This commit was generated by cvs2svn to compensate for changes in r66963,
[FreeBSD/FreeBSD.git] / usr.bin / doscmd / disktab.c
1 /*
2  * Copyright (c) 1992, 1993, 1996
3  *      Berkeley Software Design, Inc.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by Berkeley Software
16  *      Design, Inc.
17  *
18  * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  *      BSDI disktab.c,v 2.2 1996/04/08 19:32:27 bostic Exp
31  */
32
33 /* XXX goaway (requires change to config.c) */
34
35 static struct {
36         int     cylinders;
37         int     heads;
38         int     sectors;
39 } disk_table[] = {
40         {  306,  4, 17 },       /* type 01   10M        */
41         {  615,  4, 17 },       /* type 02   20M        */
42         {  615,  6, 17 },       /* type 03   30M        */
43         {  940,  8, 17 },       /* type 04   62M        */
44         {  940,  6, 17 },       /* type 05   46M        */
45         {  615,  4, 17 },       /* type 06   20M        */
46         {  462,  8, 17 },       /* type 07   30M        */
47         {  733,  5, 17 },       /* type 08   30M        */
48         {  900, 15, 17 },       /* type 09   112M       */
49         {  820,  3, 17 },       /* type 10   20M        */
50         {  855,  5, 17 },       /* type 11   35M        */
51         {  855,  7, 17 },       /* type 12   49M        */
52         {  306,  8, 17 },       /* type 13   20M        */
53         {  733,  7, 17 },       /* type 14   42M        */
54         {  976, 15, 17 },       /* type 15   121M       */
55         {  612,  4, 17 },       /* type 16   20M        */
56         {  977,  5, 17 },       /* type 17   40M        */
57         {  977,  7, 17 },       /* type 18   56M        */
58         { 1024,  7, 17 },       /* type 19   59M        */
59         {  733,  5, 17 },       /* type 20   30M        */
60         {  733,  7, 17 },       /* type 21   42M        */
61         {  733,  5, 17 },       /* type 22   30M        */
62         {  306,  4, 17 },       /* type 23   10M        */
63         {  925,  7, 17 },       /* type 24   53M        */
64         {  925,  9, 17 },       /* type 25   69M        */
65         {  754,  7, 17 },       /* type 26   43M        */
66         {  754, 11, 17 },       /* type 27   68M        */
67         {  699,  7, 17 },       /* type 28   40M        */
68         {  823, 10, 17 },       /* type 29   68M        */
69         {  918,  7, 17 },       /* type 30   53M        */
70         { 1024, 11, 17 },       /* type 31   93M        */
71         { 1024, 15, 17 },       /* type 32   127M       */
72         { 1024,  5, 17 },       /* type 33   42M        */
73         {  612,  2, 17 },       /* type 34   10M        */
74         { 1024,  9, 17 },       /* type 35   76M        */
75         { 1024,  8, 17 },       /* type 36   68M        */
76         {  615,  8, 17 },       /* type 37   40M        */
77         {  987,  3, 17 },       /* type 38   24M        */
78         {  987,  7, 17 },       /* type 39   57M        */
79         {  820,  6, 17 },       /* type 40   40M        */
80         {  977,  5, 17 },       /* type 41   40M        */
81         {  981,  5, 17 },       /* type 42   40M        */
82         {  830,  7, 17 },       /* type 43   48M        */
83         {  830, 10, 17 },       /* type 44   68M        */
84         {  917, 15, 17 },       /* type 45   114M       */
85         { 1224, 15, 17 },       /* type 46   152M       */
86 };
87
88 static int ntypes = sizeof(disk_table)/sizeof(disk_table[0]);
89
90 int
91 map_type(int type, int *cyl, int *head, int *sec)
92 {
93     --type;
94     if (type < 0 || type >= ntypes)
95         return(0);
96     *cyl = disk_table[type].cylinders;
97     *head = disk_table[type].heads;
98     *sec = disk_table[type].sectors;
99     return(1);
100 }