[Toybox] init.c ? and oneit

Rob Landley rob at landley.net
Fri Apr 30 23:48:59 PDT 2021


On 4/30/21 7:03 PM, scsijon wrote:
>>> yup, a whole bucket full of bloodworms, not just a small tub of fishing worms if
>>> you want to meet the complete init spec.
>> A) Ew?
>>
>> B) what spec? Posix doesn't _mention_ init (or mount), which is one of my
>> persistent gripes about it.
>
> Search under mutex and pthread, makes basically the same thing with a different
> name (IEEE Std 1003.1-2001 to start from), the mutex name came from mainframes
> from memory.

Those are locking primitives? I'm talking about the "mount" and "init" command
line programs?

> And then there are the posix 'semaphores' if you want to go that way.

Another locking primitive? Having to do with threads, when neither init nor
mount are generally threaded? (And init predates threads by a decade?)

>>> !NOT going there again, 3 months wasted many years
>>> ago, without any usefull code, just specs read and flowcharts created, "^"
>>> wasn't happy.
>> Ah, I was confused because you're referring to something only you ever
>> experienced as if other people should know it.
> 
> No, there are earlier specs, that start from late last century,

Which are not posix, and thus irrelevant to my complaint that posix does not
mention/standardize these things?

I know there are various vendor man pages on them, the 7th edition manual has
"init" in it, and the System V Interface Definition (4th edition) probably does
as well. But POSIX didn't, because IBM and Microsoft spent a lot of money
sabotaging the committee to let OS/360 and NT nominally qualify as compliant
with FIPS 151-2:

https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub151-2-1993.pdf

> for init from
> unix, xenix (286/386/486),

Microsoft fork that Paul Allen hired two guys in a Santa Cruz garage to port to
m68k and 8086 until he could figure out which of the two IBM was going to use in
the PC, yes...

> hp-ux (intel and RISC)

The HP there stands for Hewlett Packard, Intel got involved way later...

> and icon-ux (Motorolla)

IBM's AOS was BSD based until AT&T paid them to switch to System V with AIX,
Sun's SunOS was BSD based until AT&T paid them to switch to Solaris... sort of a
theme there. In 1979 Berkeley got the VAX network support contract to replace
the original 10 year old honeywell IMP routers, and Bill Joy wrote a networking
stack 50 times more efficient than BBN's version and bundled it with BSD, so
after the ipv4 flag day everything on the internet ran BSD unix until AT&T
underwent a breakup and then used their lawyers to strong-arm all the unix
vendors to switch to System V instead.

In theory Posix was an attempt to unify the BSD and System V worlds. In practice
it was a political football gatekeeping federal procurement contracts.

> multi-processor minicomputers, all I was asked to and tried to do to start with
> was flowchart for parts that would work for the standalone system that we called
> workstations to get rid of the unneeded code to freeup memory, about half of it
> we thought, and add an auto-restart into it (didn't exist back then, it was all
> manually done unless it crashed). If you really want to see them, they
> should/maybe be on the appropriate archive sites, I do have a copy of a couple
> of the manuals in boxes somewhere in my archive storage room if they really need
> to resurface.

So you triaged dinosaur unixes from the "unix wars" days 30+ years ago? That's
nice. Did you know Dell computers had its own in 1997? There was some OBSCURE
ones. The first commercially available full unix clone AT&T couldn't claim
ownership was was Coherent from the Mark Williams company, which shipped in
1980. Tanenbaum didn't even start writing Minix (to replace the lions book)
until the AT&T breakup in 1984:

https://cacm.acm.org/magazines/2016/3/198874-lessons-learned-from-30-years-of-minix/fulltext

Unfortunately he was an ivory tower academic who made microkernel (see the
"tanenbaum-torvalds debate"). These days the replacement for the lions book is
the xv6 project:

https://pdos.csail.mit.edu/6.828/2020/xv6.html

> Also checkout
> https://support.sas.com/documentation/onlinedoc/ccompiler/doc700/html/lr2/index.htm,
> it's sas's version of the old posix docs, you might have to drill down for
> things, mount is zid-7937.htm.

The 1997 Posix release (SUSv2) is online in its original form at:

  https://pubs.opengroup.org/onlinepubs/7908799/index.html

And there is no "mount" command in it:

  https://pubs.opengroup.org/onlinepubs/7908799/xcuix.html

Vendors added all sorts of stuff to their versions during the unix wars, it was
"differentiation" to sell their offering instead of competing versions. That's a
big part of the reason the fragmentation got so bad it nearly killed unix.

But mount and init were excluded from Posix because requiring them would have
prevented IBM or Microsoft winning federal procurement contracts with Windows NT
and System 390 in the years that "posix compliance" was a checkbox item. And
posix never went BACK and cleaned that up because they'd have to admit having
been wrong in order to fix being wrong.

That's what I was complaining about. The Free Standards Group was formed to try
to come up with a proper Linux standard to replace (or at least supplement)
Posix, but unfortunately FSG that merged with OSDL to form the Linux Foundation
and THAT turned into such a clusterfsck that their "director of engineering"
left to join Microsoft:

  https://lwn.net/Articles/237510/

And they were such terrible stewards of the standard that Debian gave up on
their "standard" in 2015:

  https://lwn.net/Articles/658809/

Anyway, yes I need to clean up and promote init.c. I guess
https://manpages.debian.org/testing/sysvinit-core/init.8.en.html is as good a
reference as any...

Rob


More information about the Toybox mailing list