[Toybox] Fwd: Re: Is binutils neccessary?
Rob Landley
rob at landley.net
Mon Jan 2 10:18:00 PST 2017
Somebody asked where the article to go with
https://news.ycombinator.com/item?id=8984343
went and it's one of those "Dreamhost's incompetence
blows annual holes in the web archive, then
https://lwn.net/Articles/695695/ took out
http://news.gmane.org/gmane.linux.toybox and really
I think my attempts to archive this list are cursed."
That said, here's a resend out of my "sent" folder.
Rob
P.S. the cryptnet link went down, here's the original:
https://groups.google.com/forum/#!original/comp.sys.sun.hardware/wCd7fHnzHjw/VlRbqq6HIyQJ
-------- Forwarded Message --------
Subject: Re: [Toybox] Is binutils neccessary?
Date: Tue, 27 Jan 2015 21:51:57 -0600
From: Rob Landley <rob at landley.net>
On 01/27/2015 07:50 PM, Rich Felker wrote:
> On Tue, Jan 27, 2015 at 08:21:04PM -0500, stephen Turner wrote:
>>> The BSD syscall ABIs I've seen aren't very usable (no way to make a
>>> syscall without a stack, which is mandatory, and likewise no futex),
>>> but fortunately you have Linux syscall ABI available on some BSDs.
>>
>> So I read that unix dates back to the 60's... who is more accurate to the
>> unix syscall linux or bsd or other? Im curious who decided it was a good
>> idea to be different. Gnu im betting...
>
> I suspect this follows the BSD/SYSV split, but I may be mistaken.
> AFAIK Linux copied the SYSV-style syscall ABIs (and other psABI
> aspects) for the existing proprietary unices on the platforms it
> supported
Actually it's because AT&T paid Sun Microsystems to switch from BSD to
System V (over Larry McVoy's strong and public objections) back in the
1980's, as detailed in the book "Under the Radar" (a history of Red Hat).
Linus Torvalds' book "Just for Fun" describes how Linux grew out of a
term program Linus Torvalds wrote (in assembly language, booting from a
floppy) over the summer of 1991. He did this partly to teach himself 386
assembly, and partly because minix was a microkernel OS and thus
couldn't keep up with a 2400 baud modem when dialing into the university
microvax to read usenet (multiple context switches each interrupt, it
would drop characters all over the place on a 40 mhz 386dx).
Linus taught his term program to read and write the minix filesystem so
he could download stuff from the microvax, but rebooting into minix to
delete/rename/mkdir stuff got old, so he wanted to teach it to run bash.
So he went through the Sun Workstation manuals in the university library
and started implementing each system call listed there until he got
tired of that and had his system call handler print the call number of
the next unhandled call bash tried to make, implemented that, rinse
repeat until he had bash working. And once he had bash working, getting
the compiler running under it turned out to be trivial because almost
all the system calls it needed were there.
Linus used the gnu assembler because Minix's built-in toolchain was 16
bit, and as the project grew beyond a boot sector he wrapped his
assembly as C inlines, using gcc.
And gcc was a marketing success due to Sun VP of marketing Ed Zander.
Lemme back up a bit to explain why:
Sun started out commercializing the Stanford University Network
m68k-based BSD workstations (S.U.N.), and they hired the BSD maintainer
Bill Joy as one of their first 4 employees. But when AT&T came to them
(circa 1986?) and waved a LOT of money at them to rebase on System V,
they did. (SunOS was the BSD based one, the new System V one was
Solaris. There was no technical reason for it, but there was a very
strong business reason. This was the period AT&T was suing anyone who
shipped BSD claiming it infringed their copyrights, which culminated in
the lawsuit against BSDi which AT&T lost.)
As part of the SunOS->Solaris switch, in 1987 Ed Zander came up with the
idea to increase Sun's revenue by "unbundling" basic operating system
components and sell them as add-ons you had to pay extra to get. So
SunOS came with a compiler (and a network stack, and an archive
program), but if you wanted any of those things for Solaris you paid sun
extra for the "optional" component. (That "windows home edition"
nonsense was a pale copy of Ed Zander's strategy from a couple decades
earlier.)
Sun customers responded by using alternatives, and the closest thing to
a working freely downloadable compiler was an obscure project called
"gcc" from the guy who did one of the three main emacs variants (gosmacs
from the maintainer of java, xemacs from the maintainer of netscape, and
gnu emacs). This gcc thing could produce 68k output because it was
developed on an HP workstation, and it was a bit buggy and didn't
optimize worth anything but a whole _lot_ of Sun developers threw their
time and energy at it to push ahead of the competition, because the
alternative was paying Sun extra for something that used to be part of
the base OS.
So gcc's library bindings strongly preferring System V system calls to
BSD was due to the flood of Solaris end-users dominating the late 80's
gcc development community to avoid paying Ed Zander extra for Sun's
Solaris compiler. This combined with Linus reading Sun workstation
manuals to get a system call list gave linux a very System V flavor.
(Note it didn't have to be this way. On July 3, 1991 Linus asked on
comp.os.minix if anybody had a copy of the Posix spec he could borrow,
but it wasn't online and printed copies cost thousands of dollars, so
much even his university didn't have a copy available, and posix has
remained borderline ignored by Linux ever since. I'd link to the message
in google groups, but google crippled their groups search functionality
a couple years back so finding the message in their archives even when
you know the message id and the exact date is unreasonably difficult
these days. I think they did it for intellectual property reasons?)
Of course the Linux development community, en masse, lost all respect
for sun due to a single line reply from a Sun employee in 1996, recorded
here for posterity:
http://cryptnet.net/mirrors/texts/kissedagirl.html
(That clicked Sun into "too dumb to live" territory for a lot of people.)
> (originally, just the SCO ABI on x86).
The "Intel Binary Compatability Standard" saga is a different story from
the early 90's. I researched that and wrote it up as part of my rebuttal
to SCO's second amended complaint during their lawsuit against IBM. See
giant response block to paragraph 47 under:
http://www.catb.org/esr/halloween/halloween9.html#id2854686
IBCS died due to lack of interest, as described in response to paragraph
43 a little earlier in the document:
http://www.catb.org/esr/halloween/halloween9.html#id2853846
The 86open project is a fascinating piece of unix history which has alas
fallen off the net, but archive.org still has it:
https://web.archive.org/web/20010424134601/http://www.telly.org/86open/
(Note the original announcement and FAQ linked from the bottom of that
page.)
That was a multivendor attempt to form a standards body to define an x86
intel binary compatability standard, and the result they came up with
was literally "everybody can already run Linux binaries, just use that".
In 1997 the question was worth asking. Then Eric Raymond's 1997 Usenix
paper "the cathedral and the bazaar" made its way to Netscape's CEO who
responeded at the start of 1998 by opening Netscape's source code and
elevating Linux to a Tier 1 platform, thus funneling the "anything but
microsoft" crowd Netscap had united behind Java directly into Linux,
resulting in 212% growth in a single year (tripling the size of the
userbase). By 1999, the perceived momentum of Linux made everything else
look irrelevant, and the prophecy was self-fulfilling in the unix space.
(In the larger PC world it never cracked 2% desktop market share because
of Microsoft's exclusive distribution contracts preventing preinstalls
of anything else, but oh well.)
(Did I mention computer history is a hobby of mine?)
> Rich
Rob
P.S. The compatibility with existing unixes thing did get a certain
amount of lip service, but sometimes in silly ways. Actually believing
it led people to break stuff, for example I had to fix one at:
http://lists.gnu.org/archive/html/qemu-devel/2010-02/msg00800.html
More information about the Toybox
mailing list