Deleted Added
full compact
geom_pc98.c (107012) geom_pc98.c (107562)
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/geom/geom_pc98.c 107012 2002-11-17 13:56:37Z nyan $
32 * $FreeBSD: head/sys/geom/geom_pc98.c 107562 2002-12-03 20:20:44Z sos $
33 */
34
35#include <sys/param.h>
36#ifndef _KERNEL
37#include <signal.h>
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>

--- 144 unchanged lines hidden (view full) ---

185 if (error || fwheads == 0) {
186 fwheads = 8;
187 printf("g_pc98_taste: error %d guessing %d heads\n",
188 error, fwheads);
189 }
190 sectorsize = cp->provider->sectorsize;
191 if (sectorsize < 512)
192 break;
33 */
34
35#include <sys/param.h>
36#ifndef _KERNEL
37#include <signal.h>
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>

--- 144 unchanged lines hidden (view full) ---

185 if (error || fwheads == 0) {
186 fwheads = 8;
187 printf("g_pc98_taste: error %d guessing %d heads\n",
188 error, fwheads);
189 }
190 sectorsize = cp->provider->sectorsize;
191 if (sectorsize < 512)
192 break;
193 if (cp->provider->mediasize / sectorsize < 17 * 8 * 65536) {
194 fwsectors = 17;
195 fwheads = 8;
196 }
193 gsp->frontstuff = sectorsize * fwsectors;
194 spercyl = (off_t)fwsectors * fwheads * sectorsize;
195 buf = g_read_data(cp, 0,
196 sectorsize < 1024 ? 1024 : sectorsize, &error);
197 if (buf == NULL || error != 0)
198 break;
199 if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
200 g_free(buf);

--- 64 unchanged lines hidden ---
197 gsp->frontstuff = sectorsize * fwsectors;
198 spercyl = (off_t)fwsectors * fwheads * sectorsize;
199 buf = g_read_data(cp, 0,
200 sectorsize < 1024 ? 1024 : sectorsize, &error);
201 if (buf == NULL || error != 0)
202 break;
203 if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
204 g_free(buf);

--- 64 unchanged lines hidden ---