The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Rob Pike <robpike@gmail.com>
To: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: tuhs@tuhs.org
Subject: [TUHS] Re: Porting the SysIII kernel: boot, config & device drivers
Date: Mon, 2 Jan 2023 08:31:10 +1100	[thread overview]
Message-ID: <CAKzdPgx1i7y92K893A19TpWobpoXW+ooq_97qbsY8-R4V+0i4Q@mail.gmail.com> (raw)
In-Reply-To: <20230101212609.yjg2poiggil7pwat@illithid>

[-- Attachment #1: Type: text/plain, Size: 8048 bytes --]

Seems like a good time to pull out the "wheel of reincarnation" paper.

http://cva.stanford.edu/classes/cs99s/papers/myer-sutherland-design-of-display-processors.pdf

I think about it a lot when I ponder the state of graphics these days. The
wheel does seem finally to have rusted in place, although I'm not sure I'd
choose this exact angle of rotation.

-rob


On Mon, Jan 2, 2023 at 8:27 AM G. Branden Robinson <
g.branden.robinson@gmail.com> wrote:

> At 2023-01-01T21:29:17+0100, Paul Ruizendaal wrote:
> > > Mothy Roscoe gave a really interesting keynote at OSDI'21:
> > > https://www.youtube.com/watch?v=36myc8wQhLo
> >
> > What an interesting keynote! At first he makes the case that OS
> > research is dead (not unlike Rob’s similar observation 20 years
> > before).
> >
> > However, he goes on to point out a specific challenge that he
> > feels is in dire need of research and innovation. In short his case is
> > that a modern SoC is nothing like a VAX, but Linux still treats all
> > hardware like a VAX.
>
> As do C programmers.  https://queue.acm.org/detail.cfm?id=3212479
>
> > > That makes figuring out where the host OS image is and getting it
> > > loaded into memory a real pain in the booty; not to mention on
> > > modern systems where you’ve got to do memory training as part of
> > > initializing DRAM controllers and the like.
> >
> > That was my immediate pain point in doing the D1 SoC port.
> > Unfortunately, the manufacturer only released the DRAM init code as
> > compiler ‘-S’ output and the 1,400 page datasheet does not discuss its
> > registers. Maybe this is a-typical, as I heard in the above keynote
> > that NXP provides 8,000 page datasheets with their SoC’s. Luckily,
> > similar code for ARM chips from this manufacturer was available as C
> > source and I could reverse engineer the assembler file back to about
> > 1,800 lines of C. See
> > https://gitlab.com/pnru/xv6-d1/-/blob/master/boot0/sdram.c
>
> I don't think it's atypical.  I was pretty annoyed trying to use the
> data sheet to program a simple timer chip on the ODROID-C2; the sheet
> was simply erroneous about the address of one of the registers you
> needed to poke to set up a repeating timer.  When I spoke to people more
> experienced with banging on modern devices, I was mostly met with
> resignation and rolled shoulders.  I grew up in the hobbyist era; these
> days it is _only_ OS nerds who program these devices, and these OS nerds
> don't generally handle procurement themselves.  Instead, purchasing
> managers do, and those people don't have to face the pain.
>
> Data sheets are only as good as they need to be to move the product,
> which means they don't need to be good at all, since the people who pay
> for them look only at the advertised feature list and the price.
>
> > It does all the expected things (set voltage, switch on the main
> > clock, set up the PLL, calculate delays in terms of clocks, train for
> > the line delays, probe address multiplexing, etc.) by accessing a
> > multitude of registers that appear directly connected to the
> > controller fabric. Yet, at the same time it has only a single entry
> > point (“init_DRAM”) that takes 24 (poorly documented) words of 32 bits
> > to define the desired configuration (with options to specify “default”
> > or “auto”).
> >
> > Why does the main processor need to run this code? Why is there not a
> > small RV32E CPU inside this controller that runs the 1,800 lines and
> > exposes just the 24 words as registers to the main CPU? Are the square
> > mils really that expensive? Or is this the reason that many SoC’s (but
> > not the D1) have a small side CPU to do this for all devices?
>
> I can't speak to the economic arguments but it seems wasteful to me to
> have an auxiliary CPU that is--or _should_--be used only to bring up the
> board.  The other problem I have is more ominous.
>
> "Ah, BMC.  Now every computer comes with an extra full-fledged computer!
> The main computer is for your use, and the other computer is for the use
> of the attacker." — Russ Allbery
>
> But the real problem is with the software these auxiliary processors
> run.  My first encounter with auxiliary processors was with the TRS-80
> Model 16 line in the early 1980s, which was also available as an upgrade
> option from the Model II.  The II ran a Zilog Z80.  The Model 16 upgrade
> added a 68000 board which became the main CPU, and the Z80 was relegated
> to I/O management.  This turned out to work really well.  I gather that
> big IBM iron was doing this sort of thing decades earlier.  That at
> least is an honorable and useful application of the additional core,
> instead of smuggling your keystrokes and network packets out to
> interested intelligence agencies and harvesters for targeted
> advertising.
>
> [...]
> > One of the things on my mind was that SoC boards change quite quickly:
> > the D1 was last year’s hit with hobbyists, next year it will be
> > something else. Not nice if one has to redo 3,500-10,000 lines of code
> > for each board. Although I am not a fan of Forth, I can see that it is
> > useful when the controller IP blocks of a SoC (or the PCI cards of
> > discrete systems) expose some form of re-targetable program needed to
> > boot it up. The manufacturer BSP code is just not plug & play.
>
> Yes.  I too think Forth is a little weird but I appreciate its
> power/memory footprint ratio.  I really admire OpenFirmware and was
> intensely disappointed when the RISC-V community didn't take the
> opportunity to resurrect it.  Forth code seems a lot more auditable to
> me than machine language blobs.
>
> > Maybe the correct solution for my archeology is to just use the
> > simpler FPGA SoC as a target.
>
> Maybe it's the correct solution for anyone who cares about a verified
> boot process, too.  No one who sells silicon seems to.
>
> > For a long time I have wondered why early Xenix did not make the jump
> > to a product that was split between a BIOS and a BDOS part, so that
> > they could sell BDOS-part updates to the total installed base. The
> > BDOS part could even be in some kind of p-code. Considering that they
> > heavily invested in their “revenue bomb” C-compiler at the time, this
> > type of thinking was close to their hart
>
> You _really have_ been writing for RISC-V lately... ;-)
>
> > (the Amsterdam Compiler Kit was a similar idea). I am talking ’81-’83
> > here, thereafter it is clear that their economic interest was to focus
> > on DOS.
> >
> > There are 3 possibilities:
> > 1. It did not make technical sense
> > 2. It did not make economic sense
> > 3. It did make sense, but it simply did not happen
> >
> > So, yes, I was conflating a lot of different thoughts into a single
> > solution, without first thinking clearly about the question.
>
> Someone is bound to suggest that p-code was, or still is, detrimental to
> boot times.  But cores are so much faster than memory buses, and JIT
> compilers so far advanced over what was available in the 1980s, that I
> wonder if that is simply a myth today for any implementation that didn't
> go out of its way to be slow.
>
> > For sure, that is undisputed. But could it have been even more
> > successful? Maybe the main reason for "no BIOS attempt" was purely
> > economic: for the companies having to port to each and every machine
> > created customer lock-in, and for the professionals it created an
> > industry of well paying porting & maintenance jobs. The customers were
> > willing to pay for it. Why kill the golden goose?
>
> Never compete on margins when you can extract monopoly rents, leverage
> asymmetric information, impose negative externalities, and defraud your
> customer or the public generally.  Everybody who stops learning
> economics after their first micro class is a sheep waiting your shears.
>
> Regards,
> Branden
>

[-- Attachment #2: Type: text/html, Size: 9930 bytes --]

  reply	other threads:[~2023-01-01 21:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30 18:25 [TUHS] " Paul Ruizendaal
2022-12-30 18:56 ` [TUHS] " Steve Nickolas
2022-12-31 14:59 ` Dan Cross
2022-12-31 19:08   ` Clem Cole
2022-12-31 21:10     ` Dan Cross
2022-12-31 21:39       ` Clem Cole
2022-12-31 21:52         ` Dan Cross
2022-12-31 23:25         ` Dave Horsfall
2023-01-01  1:02           ` Rob Pike
2023-01-01  1:16             ` George Michaelson
2023-01-01  1:40               ` Larry McVoy
2023-01-01  2:29                 ` Warner Losh
2023-01-01  1:24             ` Larry McVoy
2022-12-31 22:38       ` Theodore Ts'o
2022-12-31 22:55         ` Marc Donner
2023-01-01  3:55         ` Dan Cross
2023-01-01 20:29         ` Paul Ruizendaal
2023-01-01 21:26           ` G. Branden Robinson
2023-01-01 21:31             ` Rob Pike [this message]
2022-12-31 21:11     ` Paul Ruizendaal
2022-12-31 20:02   ` Paul Ruizendaal
2022-12-31 21:04     ` Warner Losh
2022-12-31 21:41     ` Dan Cross
2023-01-01  3:08     ` Warner Losh
2023-01-01  4:40       ` Dan Cross
2023-01-01  8:05     ` Jonathan Gray

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=CAKzdPgx1i7y92K893A19TpWobpoXW+ooq_97qbsY8-R4V+0i4Q@mail.gmail.com \
    --to=robpike@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --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).