The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Alexander Voropay <alec@sensi.org>
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Design of the AT&T assembly syntax
Date: Tue, 29 Oct 2019 17:38:36 +0300	[thread overview]
Message-ID: <CAGqcPWDFH+z4SMhAOX6b9P+tGTTEwiQv7rN8nqrtDK4i_h3Yhg@mail.gmail.com> (raw)

Robert Clausecker <fuz@fuz.su> wrote:

> > I've tried Microport SystemV /386 (SysV R3.2). It uses COFF
> Nice find!  It seems to use lcall to selector 7 for system calls.  A
> similar choice was made in 386BSD all the way through FreeBSD 2.2.8
> where it was replaced with int $0x80 as in Linux.

Technically speaking
lcall $0x07,$0
uses selector 0 with RPL=3 (bit0 and bit1==1) and LDT (bit2==1)

It seems it's oldest way to call kernel from userspace on x86 architecture.
AT&T's programmers used this sycall convention for SysVR3 and
SysVR4 on i386 (not sure about SysVR2 on i286).
There are very few examples with lcall-type syscall  i.e.
http://www.sco.com/developers/devspecs/abi386-4.pdf
(figure 3-26)
(and leaked SysVR4 i386 sources)

William Jolitz used this convention in his amazing articles about
porting BSD4.3 to the i386 (c)1991
http://www.informatica.co.cr/unix-source-code/research/1991/0101.html
(p."System Call Inteface"). See also 386BSD 0.0:
https://github.com/386bsd/386bsd/blob/0.0/arch/i386/i386/locore.s#L361
(Did he run AT&T userspace on his kernel ???)
As you mentioned, most of early *BSD systems on i386 also used lcall.

Linus selected to use "DOS-style" call with INT 0x80.
More recent BSD on i386 also use INT.
https://john-millikin.com/unix-syscalls
http://asm.sourceforge.net/intro/hello.html

Solaris on x86 (ex. SysVR4) also uses lcall. See a
https://www.cs.dartmouth.edu/sergey/cs258/solaris-on-x86.pdf
p.4.2.3
and Solaris (later OpenSolaris and later Illumos) sourcecode.

             reply	other threads:[~2019-10-29 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 14:38 Alexander Voropay [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-10-28 21:48 Alexander Voropay
2019-10-28 21:59 ` Robert Clausecker
2019-10-28 20:14 Robert Clausecker
2019-10-28 21:06 ` Seth Morabito
2019-10-29  0:31   ` Nemo Nusquam
2019-10-28 20:07 Robert Clausecker
2019-10-28 22:08 ` Warner Losh
2019-10-28 22:24   ` Robert Clausecker
2019-10-28 22:29     ` Warner Losh

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=CAGqcPWDFH+z4SMhAOX6b9P+tGTTEwiQv7rN8nqrtDK4i_h3Yhg@mail.gmail.com \
    --to=alec@sensi.org \
    --cc=tuhs@tuhs.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;
as well as URLs for NNTP newsgroup(s).