git: d43bcf62a218 - main - stand: Stop support booting 4.x and earlier kernels

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 16 Sep 2022 15:54:00 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=d43bcf62a2182d3f00c11e5145c8912f4468871a

commit d43bcf62a2182d3f00c11e5145c8912f4468871a
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-09-16 15:09:07 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-09-16 15:18:57 +0000

    stand: Stop support booting 4.x and earlier kernels
    
    FreeBSD 4.x and earlier used the bi_bios_geom to get the geometry of the
    device. Starting in 5.x, with the wdc -> ata rewrite, it was used only
    in pc98 kernels to report geometry of the drives. It can be safely
    removed as booting kernels this old is no longer supported. This saves
    176 bytes in the BIOS loader.
    
    Sponsored by:           Netflix
    Reviewed by:            adrian, emaste
    Differential Revision:  https://reviews.freebsd.org/D36543
---
 stand/i386/libi386/biosdisk.c        | 29 -----------------------------
 stand/i386/libi386/bootinfo32.c      |  2 --
 stand/userboot/userboot/bootinfo32.c |  4 ----
 3 files changed, 35 deletions(-)

diff --git a/stand/i386/libi386/biosdisk.c b/stand/i386/libi386/biosdisk.c
index 1b6134ab2e6b..bc819d8e312e 100644
--- a/stand/i386/libi386/biosdisk.c
+++ b/stand/i386/libi386/biosdisk.c
@@ -1286,35 +1286,6 @@ bd_io(struct disk_devdesc *dev, bdinfo_t *bd, daddr_t dblk, int blks,
 	return (result);
 }
 
-/*
- * Return the BIOS geometry of a given "fixed drive" in a format
- * suitable for the legacy bootinfo structure.  Since the kernel is
- * expecting raw int 0x13/0x8 values for N_BIOS_GEOM drives, we
- * prefer to get the information directly, rather than rely on being
- * able to put it together from information already maintained for
- * different purposes and for a probably different number of drives.
- *
- * For valid drives, the geometry is expected in the format (31..0)
- * "000000cc cccccccc hhhhhhhh 00ssssss"; and invalid drives are
- * indicated by returning the geometry of a "1.2M" PC-format floppy
- * disk.  And, incidentally, what is returned is not the geometry as
- * such but the highest valid cylinder, head, and sector numbers.
- */
-uint32_t
-bd_getbigeom(int bunit)
-{
-
-	v86.ctl = V86_FLAGS;
-	v86.addr = DISK_BIOS;
-	v86.eax = CMD_READ_PARAM;
-	v86.edx = 0x80 + bunit;
-	v86int();
-	if (V86_CY(v86.efl))
-		return (0x4f010f);
-	return (((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) |
-	    (v86.edx & 0xff00) | (v86.ecx & 0x3f));
-}
-
 /*
  * Return a suitable dev_t value for (dev).
  *
diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c
index 68aae9b67ba9..372bced917d6 100644
--- a/stand/i386/libi386/bootinfo32.c
+++ b/stand/i386/libi386/bootinfo32.c
@@ -173,8 +173,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
     kernelname = getenv("kernelname");
     i386_getdev(NULL, kernelname, &kernelpath);
     bi.bi_version = BOOTINFO_VERSION;
-    for (i = 0; i < N_BIOS_GEOM; i++)
-        bi.bi_bios_geom[i] = bd_getbigeom(i);
     bi.bi_size = sizeof(bi);
     bi.bi_memsizes_valid = 1;
     bi.bi_basemem = bios_basemem / 1024;
diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c
index d496384fbcb5..782628c4126c 100644
--- a/stand/userboot/userboot/bootinfo32.c
+++ b/stand/userboot/userboot/bootinfo32.c
@@ -152,10 +152,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
     kernelname = getenv("kernelname");
     userboot_getdev(NULL, kernelname, &kernelpath);
     bi.bi_version = BOOTINFO_VERSION;
-#if 0
-    for (i = 0; i < N_BIOS_GEOM; i++)
-        bi.bi_bios_geom[i] = bd_getbigeom(i);
-#endif
     bi.bi_size = sizeof(bi);
     CALLBACK(getmem, &lowmem, &highmem);
     bi.bi_memsizes_valid = 1;