Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 1995 16:47:34 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        rgrimes@gndrsh.aac.dev.com, terry@cs.weber.edu
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: More serial console stuff...
Message-ID:  <199501220547.QAA31999@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> IDE disks do not require any special BIOS support.  We can not boot from
>> a disk that has not had BIOS support installed via int 13 hooking.

>This is not true.  There *must* be code to actually *do* something when
>you do an int-13 call.  Even if this is the *default* code, the int-13
>vector is hooked in order to instantiate the code.

All BIOS's have code to support IDE disks.

>That you can only have one hook or the other is the whole crux of the
>problem.

No, hooks form a chain.  You can have as many as will fit in memory.

>> Take a system with 1 IDE drive and n SCSI drives.
>> DOS drive	BSD drive	BSD unit	rootdev(maj,min)
>> 0x80		wd0		0		0,0
>> 0x81		sd0		0		4,0
>> 0x82		sd1		1		4,1

>OK, I definitely agree with most of this, only your first example is
>flawed...

>1)	The BIOS does the boot by making INT 13 calls following the
>	POST.
>2)	The INT 13 hook active is *either* the wd0/1 hook *or* the
>	sd0/1 hook.
>3)	In the first case, you can *only* boot from the wd controller
>	*or* the sd controller.  Both BIOS hooks to INT 13 can *not*
>	be active simultaneously.

I thought the example was a real one.  It's easy for the sd driver to
make it work, e.g.:

	unit = drive & 0x7f;
	if (unit > max_sd_unit)		/* max_sd_unit = min_sd_unit
					 *		 + nr_sd_units - 1 */
		return ERROR;
	if (unit < min_sd_unit)		/* min_sd_unit = number of drives
					 * at the time we hooked */
		jumpto(saved_vector);	/* restore regs and continue with
					 * the driver that owned INT 0x13
					 * at the time we hooked */
	unit -= min_sd_unit;		/* actual SCSI unit number */

Whether the bootstrap can determine all the mappings done by all the
hooked drivers is another question.

>4)	Your DOS drive numbering is invalid, unless the post-boot OS
>	hacks the INT 13 vector with something more than simple BIOS
>	code -- specifically, an INT 13 redirector that does DOS
>	drive number translation before calling the previous-to-load
>	POST initialized INT 13 vector, if the drive number is less
>	than or equal to 0x80 OR'ed with the number of drives (option

DOS is not involved, except for the special version of the bootstrap
that boots from DOS.  Complicated redirections are just more likely
if DOS has been used to load special drivers.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199501220547.QAA31999>