Ask the BIOS about the geometry, and tell the kernel about it.

This commit is contained in:
Poul-Henning Kamp 1994-11-18 05:02:14 +00:00
parent 5d75485098
commit efcdc34fe3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4597
2 changed files with 20 additions and 7 deletions

View File

@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:34:26 rpd
* $Id: bios.S,v 1.2 1993/10/16 19:11:30 rgrimes Exp $
* $Id: bios.S,v 1.3 1994/10/02 05:18:25 rgrimes Exp $
*/
/*
@ -253,8 +253,7 @@ ENTRY(get_diskinfo)
jnc ok
/*
* Urk. Call failed. It is not supported for floppies by old BIOS's.
* Guess it's a 15-sector floppy. Initialize all the registers for
* documentation, although we only need head and sector counts.
* Guess it's a 15-sector floppy.
*/
subb %ah, %ah /* %ax = 0 */
movb %al, %al
@ -272,9 +271,18 @@ ok:
data32
call EXT(real_to_prot) /* back to protected mode */
xor %eax, %eax
/* form a longword representing all this gunk */
/*
* form a longword representing all this gunk:
* 6 bit zero
* 10 bit cylinder
* 8 bit head
* 8 bit sector
*/
movb %cl, %al /* Upper two bits of cylinder count */
andl $192,%eax
leal 0(,%eax,4),%eax /* << 2 */
movb %ch, %al /* Lower 8 bits */
sall $16,%eax /* << 16 */
movb %dh, %ah /* max head */
andb $0x3f, %cl /* mask of cylinder gunk */
movb %cl, %al /* max sector (and # sectors) */

View File

@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, [92/04/03 16:51:14 rvb]
* $Id: boot.c,v 1.21 1994/10/31 18:00:06 jkh Exp $
* $Id: boot.c,v 1.22 1994/11/07 11:26:26 davidg Exp $
*/
@ -72,6 +72,11 @@ int drive;
int loadflags, currname = 0, ret;
char *t;
/* Pick up the story from the Bios on geometry of disks */
for(ret = 0; ret < N_BIOS_GEOM; ret ++)
bootinfo.bios_geom[ret] = get_diskinfo(ret + 0x80));
printf("\n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory\n",
ouraddr,
memsize(0),