Date: Mon, 27 Mar 2000 21:07:33 +0900 From: Motomichi Matsuzaki <mzaki@e-mail.ne.jp> To: FreeBSD-current@FreeBSD.ORG Subject: Please test for 8G-OVER-Booting with /boot/loader Message-ID: <86n1nkvcoq.wl@tkc.att.ne.jp>
next in thread | raw e-mail | index | archive | help
--Multipart_Mon_Mar_27_21:07:33_2000-1
Content-Type: text/plain; charset=US-ASCII
Hi.
I made a patch for /sys/boot/i386/libi386/biosdisk.c (attached).
This aimed to enable /boot/loader to manage 8G-OVER-Disks.
0. you need 8G-OVER-ENABLED BIOS for your motherboard
(check whether your BIOS has Int 13 Extended Interface)
1. teach boot0 using extended BIOS (See boot0cfg(8))
# boot0cfg -o packet YOUR-BOOT-DEVICE
2. install boot2 which have extended BIOS support
# cd /sys/boot/i386/boot2; make B1FLAGS=0x80 clean install
3. patch to libi386 and install new /boot/loader
# cd /sys/boot/i386/libi386/; patch <THIS-MAIL; make
# cd /sys/boot/i386/loader; make install
--
Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
Dept. of Biological Science, Faculty of Sciences, Univ. of Tokyo, Japan
--Multipart_Mon_Mar_27_21:07:33_2000-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="biosdisk.c.diff"
Content-Transfer-Encoding: 7bit
--- biosdisk.c Thu Mar 16 01:36:55 2000
+++ biosdisk.c.new Mon Mar 27 20:50:38 2000
@@ -74,7 +74,7 @@
int od_flags;
#define BD_MODEMASK 0x3
#define BD_MODEINT13 0x0
-#define BD_MODEEDD1 0x1
+#define BD_MODEPACKET 0x1
#define BD_MODEEDD3 0x2
#define BD_FLOPPY (1<<2)
struct disklabel od_disklabel;
@@ -166,13 +166,13 @@
bdinfo[nbdinfo].bd_unit = unit;
bdinfo[nbdinfo].bd_flags = (unit < 0x80) ? BD_FLOPPY : 0;
- /* XXX add EDD probes */
if (!bd_int13probe(&bdinfo[nbdinfo]))
break;
/* XXX we need "disk aliases" to make this simpler */
- printf("BIOS drive %c: is disk%d\n",
- (unit < 0x80) ? ('A' + unit) : ('C' + unit - 0x80), nbdinfo);
+ printf("BIOS drive %c: is disk%d%s\n",
+ (unit < 0x80) ? ('A' + unit) : ('C' + unit - 0x80), nbdinfo,
+ (bdinfo[nbdinfo].bd_flags & BD_MODEPACKET) ? " (LBA)" : "");
nbdinfo++;
}
}
@@ -180,7 +180,7 @@
}
/*
- * Try to detect a device supported by the legacy int13 BIOS
+ * Try to detect a device supported by the int13 BIOS
*/
static int
@@ -197,6 +197,26 @@
((v86.edx & 0xff) > (bd->bd_unit & 0x7f))) { /* unit # OK */
bd->bd_flags |= BD_MODEINT13;
bd->bd_type = v86.ebx & 0xff;
+
+ /* LBA support by Motomichi Matsuzaki <mzaki@e-mail.ne.jp> */
+
+ v86.ctl = V86_FLAGS;
+ v86.addr = 0x13;
+ v86.eax = 0x4100;
+ v86.ebx = 0x55AA;
+ v86.edx = bd->bd_unit;
+ v86int();
+
+ if (!(v86.efl & 0x1) && /* carry clear */
+ (v86.ebx & 0xffff) == 0xAA55) { /* magic OK */
+ if ((v86.eax & 0xf000) >= 0x3000) {
+ bd->bd_flags |= BD_MODEEDD3; /* meanless? */
+ }
+ if (v86.ecx & 0x1) {
+ bd->bd_flags |= BD_MODEPACKET; /* packet access */
+ }
+ }
+
return(1);
}
return(0);
@@ -624,6 +644,15 @@
/* Max number of sectors to bounce-buffer if the request crosses a 64k boundary */
#define FLOPPY_BOUNCEBUF 18
+struct lba_packet {
+ u_int8_t len;
+ u_int8_t rsrv;
+ u_int16_t blks;
+ u_int16_t offs;
+ u_int16_t seg;
+ u_int64_t blkno;
+};
+
static int
bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest)
{
@@ -685,25 +714,44 @@
v86.edx = od->od_unit;
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();
+
+ /* build request */
+ if (od->od_flags & BD_MODEPACKET) {
+ struct lba_packet pkt
+ = {sizeof(pkt), 0, x, VTOPOFF(xp), VTOPSEG(xp), dblk};
+ v86.ctl = V86_FLAGS;
+ v86.addr = 0x13;
+ v86.eax = 0x4200;
+ v86.edx = od->od_unit;
+ v86.ds = VTOPSEG(&pkt);
+ v86.esi = VTOPOFF(&pkt);
+ v86int();
+ } else {
+ 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");
- /* BUG here, cannot use v86 in printf because putchar uses it too */
- DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x",
- 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff);
+ if (od->od_flags & BD_MODEPACKET) {
+ DEBUG("%d sectors from %d to %p (0x%x) %s",
+ x, dblk, p, VTOP(p), result ? "failed" : "ok");
+ } else {
+ DEBUG("%d sectors from %d/%d/%d to %p (0x%x) %s",
+ x, cyl, hd, sec - 1, p, VTOP(p), result ? "failed" : "ok");
+ /* BUG here, cannot use v86 in printf because putchar uses it too */
+ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x",
+ 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec,
+ (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff);
+ }
if (result) {
if (bbuf != NULL)
free(bbuf);
--Multipart_Mon_Mar_27_21:07:33_2000-1--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86n1nkvcoq.wl>
