From 53d3dabb6ac679d2a7b14d57a872516e275def70 Mon Sep 17 00:00:00 2001 From: dsl Date: Fri, 7 Feb 2003 00:46:08 +0000 Subject: [PATCH] Use on-stack buffer to check for 2.88MB floppy, malloc() hasn't been loaded when this is called. Clearly the information is actually available from the bios. (Approved by christos) --- sys/arch/i386/stand/lib/biosdisk_ll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arch/i386/stand/lib/biosdisk_ll.c b/sys/arch/i386/stand/lib/biosdisk_ll.c index e22ec99bdfde..5bfd9de8de58 100644 --- a/sys/arch/i386/stand/lib/biosdisk_ll.c +++ b/sys/arch/i386/stand/lib/biosdisk_ll.c @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk_ll.c,v 1.14 2003/02/01 14:48:17 dsl Exp $ */ +/* $NetBSD: biosdisk_ll.c,v 1.15 2003/02/07 00:46:08 dsl Exp $ */ /* * Copyright (c) 1996 @@ -71,6 +71,7 @@ int set_geometry(struct biosdisk_ll *d, struct biosdisk_ext13info *ed) { int diskinfo; + char buf[512]; diskinfo = get_diskinfo(d->dev); d->sec = SPT(diskinfo); @@ -90,7 +91,7 @@ set_geometry(struct biosdisk_ll *d, struct biosdisk_ext13info *ed) * read sector >= 18. If not, assume 1.44 floppy disk. */ if (d->dev == 0 && SPT(diskinfo) == 36) { - if (biosread(d->dev, 0, 0, 18, 1, alloc_diskbuf(0))) { + if (biosread(d->dev, 0, 0, 18, 1, buf)) { d->sec = 18; d->chs_sectors /= 2; }