From owner-freebsd-bugs Sun Sep 19 21:20: 7 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E73461536F for ; Sun, 19 Sep 1999 21:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id VAA12794; Sun, 19 Sep 1999 21:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from midten.fast.no (midten.fast.no [195.139.251.11]) by hub.freebsd.org (Postfix) with ESMTP id BAEBD14C17 for ; Sun, 19 Sep 1999 21:12:34 -0700 (PDT) (envelope-from Tor.Egge@fast.no) Received: (from tegge@localhost) by midten.fast.no (8.9.3/8.9.3) id GAA20166; Mon, 20 Sep 1999 06:12:34 +0200 (CEST) Message-Id: <199909200412.GAA20166@midten.fast.no> Date: Mon, 20 Sep 1999 06:12:34 +0200 (CEST) From: Tor Egge Reply-To: Tor.Egge@fast.no To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: i386/13847: missing support for INT 0x13 extensions in /boot/loader Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 13847 >Category: i386 >Synopsis: missing support for INT 0x13 extensions in /boot/loader >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 19 21:20:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Tor Egge >Release: FreeBSD 3.3-STABLE i386 >Organization: Fast Search & Transfer ASA >Environment: wdc0: unit 0 (wd0): wd0: 17206MB (35239680 sectors), 34960 cyls, 16 heads, 63 S/T, 512 B/S Windows 98 at start of disk (8.5 GB) FreeBSD 3.3-STABLE at end of disk (8.5 GB) >Description: At a first glance, booting from the end of a large disk seems simple: boot0cfg -B -v -o packet wd0 But this only enables the BIOS Int 0x13 disk packet interface in boot0, and he machine hung during boot with the message "Read error". I then adjusted B1FLAGS in /usr/src/sys/boot/i386/boot2/Makefile and recompiled and reinstalled the boot blocks. Now the machine hung during boot with the message "Boot error". boot1 seems to depend upon the content of the word at offset 0x1f6 in the first sector of the FreeBSD slice being 0 in order to be able read the MBR. After performing dd if=/dev/zero of=/dev/rwd0s4 bs=512 count=1 disklabel -B wd0s4 I got one step further. /boot/loader now started. But it did not find any valid kernels. I then took a look at /usr/src/sys/boot/i386/libi386/biosdisk.c and applied the suggested fix below. Finally, a successful boot. >How-To-Repeat: See above. >Fix: Index: i386/libi386/biosdisk.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/libi386/biosdisk.c,v retrieving revision 1.20.2.7 diff -u -r1.20.2.7 biosdisk.c --- biosdisk.c 1999/08/29 16:20:59 1.20.2.7 +++ biosdisk.c 1999/09/19 23:20:02 @@ -687,18 +687,53 @@ v86int(); } - /* build request XXX support EDD requests too */ - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x200 | x; - v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; - v86.edx = (hd << 8) | od->od_unit; - v86.es = VTOPSEG(xp); - v86.ebx = VTOPOFF(xp); - v86int(); - result = (v86.efl & 0x1); - if (result == 0) + if (cyl > 1023) { + static unsigned short packet[8]; + + /* Check for Extended READ */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4100; + v86.ebx = 0x55aa; + v86.edx = od->od_unit; + v86int(); + + if (v86.ebx == 0xaa55 && (v86.ecx & 1) == 1) { + + packet[0] = 0x10; + packet[1] = x; + packet[2] = VTOPOFF(xp); + packet[3] = VTOPSEG(xp); + packet[4] = dblk; + packet[5] = dblk >> 16; + packet[6] = 0; + packet[7] = 0; + /* build request XXX support EDD requests too */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4200; + v86.ds = VTOPSEG(packet); + v86.esi = VTOPOFF(packet); + v86int(); + result = (v86.efl & 0x1); + if (result == 0) + break; + } + result = 1; + } else { + /* build request XXX support EDD requests too */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x200 | x; + v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; + v86.edx = (hd << 8) | od->od_unit; + v86.es = VTOPSEG(xp); + v86.ebx = VTOPOFF(xp); + v86int(); + result = (v86.efl & 0x1); + if (result == 0) break; + } } DEBUG("%d sectors from %d/%d/%d to %p (0x%x) %s", x, cyl, hd, sec - 1, p, VTOP(p), result ? "failed" : "ok"); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message