public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Etienne Lorrain <etienne_lorrain@yahoo.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86 boot enhancements, Clean up the 32bit entry points 6/11
Date: 18 Apr 2002 06:27:52 -0600	[thread overview]
Message-ID: <m1lmbl5gzb.fsf@frodo.biederman.org> (raw)
In-Reply-To: <20020418094413.77178.qmail@web11808.mail.yahoo.com>

Etienne Lorrain <etienne_lorrain@yahoo.fr> writes:

> You want to change completely the protected mode entry point, that does
> bother me, you know why (gujin). It is a simple (as simple as possible)
> interface, available from a _very_ long time.

*Cough*  
It is impossibly broken to use, and it has long been said it is
unsupported.  That means when someone breaks it you get to keep the
pieces. 

>   I would say:
> - Please initialise registers (segment registers) before using them, it
>  is already complex enough. A bug there will be really difficult to find.
>  Moreover that remind me another OS using registers (%bx) without
>  initialising it first.

I do.  See setup.S

I could probably change that code sequence to only rely on %cs having
a sane value.  But it is much saner to rely on having %cs, %ds, and
%es having a sane value than to rely on the presence of global
descriptor table, with the descriptors you need.  Especially since
after loading a segment register it is safe to throw away the
descriptor table, and still use the segment.

Also there is only one set of sane protected mode segments values to
use.  Do you know anyone who doesn't use flat 4G segments with a base
of 0?  (While in protected mode.)

Arguing against using registers without initialization might
be credible if you weren't also arguing for, using a global
descriptor table and %ebx and %esi without initialization.

As for bugs I have run that code with %cs, %ds, and %es having totally
different descriptor values from an overwritten gdt and it worked just
fine.

> - Please keep the 'lss SYMBOL_NAME(stack_start),%esp' around, it is the
> _only_ way to know if a kernel is "loaded low" or "loaded high", just in
> case you want to write a bootloader which loads _any_ kernel, even 1.x

????  I guess if you skim forward and find that instruction, and then
read the address of the stack_start symbol, you could figure that out.
But that instruction hasn't been at a constant offset, and there is a
much cleaner way of detecting that, examining the bit in the kernel
header that tells you explicitly.

> - Please stay compatible.

I bumped the kernel boot protocol, so auto detect should be trivial.

I did not break any bootloader using a supported interface.

I added a supportable 32bit entry point.

The interface has not been fixed in time so I don't know what you want
me to be compatible with.

Eric

  reply	other threads:[~2002-04-18 12:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-18  9:44 [PATCH] x86 boot enhancements, Clean up the 32bit entry points 6/11 Etienne Lorrain
2002-04-18 12:27 ` Eric W. Biederman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-18 16:59 Etienne Lorrain
2002-04-18 18:11 ` Eric W. Biederman
2002-04-17 16:56 Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1lmbl5gzb.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=etienne_lorrain@yahoo.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox