9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] GNU binutils: you can't make this shit up
Date: Thu, 19 Jan 2006 10:34:09 +0000	[thread overview]
Message-ID: <7f6f168f5d8ed3ddd20ffc2bd069d95e@terzarima.net> (raw)
In-Reply-To: <20060119082946.19064.qmail@web32707.mail.mud.yahoo.com>

> There is something to be said for microkernels
> they allow for a lot less headaches with kernel
> development, and it could drastically improve plan 9's
> portability, a key feature.

term% pwd
/usr/forsyth/src/xen3/xen-unstable/xen/arch/x86
term% wc -l mm.c shadow32.c shadow_guest32.c 
   3519 mm.c
   3397 shadow32.c
     18 shadow_guest32.c
   6934 total
# and that could be the tip of an iceberg, since that's x86-only

# now let's look at several non-micro/hyper kernels
term% cd /sys/src/9/pc
term% wc -l mmu.c
   1043 mmu.c

term% cd /usr/inferno/os/pc
term% wc -l mmu.c
    321 mmu.c

now if you're using the first implementation above,
you still also need something like the second or third as well (but a little different).

that's a hypervisor (but one that is claimed in a paper to be `microkernels done right').
its code is much bigger because it actually does much more than 9's or Inferno's.
i'm sure last time i looked (which to be fair was years ago)
mach had quite a bit of complex mmu code too.

which is likely to give you more headaches, and how strong?
perhaps we should have an ibuprofen rating for kernels?

portability? i have done kernels (including small micro-ish ones) myself,
and i have worked with other systems extensively over the years.
in my experience, some of the interfaces the micro/hypers present
is HARDER to drive than the underlying hardware, possibly more
frustrating, not as well documented, and changes.  and of course
there's more code in the end.  somtimes much more.
it wouldn't be so bad if people hadn't forgotten an important lesson
from THE: the idea is for each layer to provide increasingly higher levels
of abstraction, the better to reason about.  of course, in several cases, the
newer systems are the way they are to make porting Linux easier (well,
that's my impression), presumably on the grounds that its interfaces are
all over the place, x86-oriented, and hard to change.

then there are the interfaces for device drivers...

not that i'm bitter.

the way to get good portability is to have clear, well-designed interfaces
that abstract away from hardware peculiarities, and map those to the
hardware (rather than, say, reflecting in the interfaces the union of every
peculiarity of all hardware known to you at the time).

some of the hard bits about kernel development are:
- getting accurate documentation for the processor, devices, existing bootstrap, etc.
- getting anything loaded into the wretched machine at all
- deciding how your kernel should look, what it should do, how it should change
- working out a good infrastructure for networks, devices coming and going, power, etc.
- finding time and/or money to do any of it

now, while it can be really tedious when you get yourself into the state where
the hardware resets without notice (and worse, takes quite some time to get to that state,
or requires ... something ... but what is it???), it often isn't something that would
be fixed by a micro-kernel, but rather by better hardware, documentation, more careful
coding, fewer interruptions, more time to think, more energy, and of course more intelligence.
lacking any or all of these, it's still usually easier to debug a component of a smaller system with a
straightforward model overall.  that might be true of some micro-kernels, but not all, and
it isn't limited to them; a more `conventional' kernel can be quite acceptably modular.



  reply	other threads:[~2006-01-19 10:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-16  1:50 Ronald G Minnich
2006-01-16  2:00 ` Andy Newman
2006-01-16  3:10   ` Ronald G Minnich
2006-01-16  3:19     ` erik quanstrom
2006-01-16  3:47       ` David Leimbach
2006-01-18 12:55         ` Eirik Johnson
2006-01-18 13:45           ` Bruce Ellis
2006-01-18 14:00             ` alexandr babic
2006-01-18 15:45               ` Ronald G Minnich
2006-01-18 16:45                 ` Bruce Ellis
2006-01-18 17:00                   ` alexandr babic
2006-01-18 17:04                     ` Bruce Ellis
2006-01-18 17:00                 ` David Leimbach
2006-01-18 17:14                   ` Ronald G Minnich
2006-01-19  8:29               ` Eirik Johnson
2006-01-19 10:34                 ` Charles Forsyth [this message]
2006-01-19 10:43                   ` Bruce Ellis
2006-01-19 10:46                 ` erik quanstrom
2006-01-19 10:52                   ` Bruce Ellis
2006-01-19 15:41                 ` Ronald G Minnich
2006-01-19 16:05                 ` David Leimbach
2006-01-19 16:15                   ` [9fans] GNU binutils: you can't make this stuff up Brantley Coile
2006-01-19 17:16                     ` Bruce Ellis
2006-01-19 22:24                     ` erik quanstrom
2006-01-16 17:43       ` [9fans] GNU binutils: you can't make this shit up Ronald G Minnich
2006-01-16  3:46     ` David Leimbach
2006-01-16 17:44       ` Ronald G Minnich
2006-01-16 19:09         ` Bruce Ellis
2006-01-16  7:48     ` Andy Newman
2006-01-16  9:08       ` Bruce Ellis
2006-01-16 12:06       ` erik quanstrom
2006-01-16 13:23         ` Bruce Ellis
2006-01-16 19:17 jmk
2006-01-16 19:26 ` Bruce Ellis

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=7f6f168f5d8ed3ddd20ffc2bd069d95e@terzarima.net \
    --to=forsyth@terzarima.net \
    --cc=9fans@cse.psu.edu \
    /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).