Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 1998 15:38:05 +0200 (SAT)
From:      Robert Nordier <rnordier@nordier.com>
To:        Marius.Bendiksen@scancall.no (Marius Bendiksen)
Cc:        rnordier@nordier.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: FreeBSD on i386 memory model
Message-ID:  <199811171338.PAA10216@ceia.nordier.com>
In-Reply-To: <3.0.5.32.19981117125202.00916bb0@mail.scancall.no> from Marius Bendiksen at "Nov 17, 98 12:52:02 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Marius Bendiksen wrote:
> >As Marius says, it's mainly down to what the instructions point at,
> >rather that the instructions themselves.  Though, that said, an
> 
> In fact, implementing multiple calling conventions would be possible
> without too much work, I think. Changing the existing ones shouldn't be too
> hard. I've not looked at the source code, though.

Yes, flow of control is all though a central point, so the sky's
probably the limit.  If you want to produce a system which won't run
standard binaries, for instance (which may be handy for security
reasons), it would be fairly trivial here.

> 
> >interrupt rather than a far call is also just a more "natural" way to
> 
> I've not looked upon interrupts beyond hardware handling, but I seem to
> recall call gates being preferrable for isolation reasons, but I'm not
> sure, so don't flame me if I'm wrong ;)

I guess it mostly depends on context and personal preference.  The i386
is one of those "kitchen sink" architectures, where it often makes
sense to define a usable feature subset.  You inevitably have to deal
with interrupt/trap gates anyway, so it can simplify the support code
considerably, if you deal only with those.

In the case of FreeBSD, the lcall actually does result in some register
juggling in order to produce a trap frame; so maybe this bears out
the above philosophy.

> >There has been some discussion about moving more of the initialization
> >into the bootstrap code, but I won't really agree that doing it in the
> >kernel is "stupid".  Just as writing almost everything in C (rather
> >than assembler) is part of the UNIX philosophy, convenience and
> >maintainability are often more important than merely saving bytes.
> 
> That's a point. Doing it in the kernel only costs a few additional kb.
> OTOH, moving it to the bootstrap would be yet another step in the process
> of moving away from a monolithic kernel. IIRC, people expressed a desire to
> do so some time ago.

Things are certainly heading in that direction.

> >If you're interested in this stuff, you probably want to look at many
> >of the files in src/sys/i386/i386, starting with locore.s (where the
> >actual interaction with the bootstrap takes place).
> 
> In truth, I can't stand AT&T syntax, and I was merely attempting to clarify
> this. If there is an ongoing effort towards moving things out of the
> kernel, or changing the syscall interface, I'd be interested in having a
> look at it, to see if it's anything I'd be able to help with.

I doubt there's any win in changing the syscall interface at this
stage; but moving initialization code is a potential project.  Of
course there are potentially massive inertia, compatibility and other
non-technical problems associated with this. :-)

> Obtw; am I correct in assuming that moving to an interrupt-based syscall
> interface makes linux-emulation easier?

Well, both Linux and NetBSD apparently use the int 0x80 approach; but I
should think the basic mechanism is most likely a fairly small part of
the complete picture.  In most emulation, semantics rather than syntax
tends to be where things get tricky.

-- 
Robert Nordier

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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