Subject: Re: two OS'es on two procs of MP system
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 06/22/2005 14:31:17
> I do not really know the details of multiprocessors and APICs but
> from what I gather, the processors are pretty much independent - each
> has its own GDT, LDT, page tables, etc.

In some cases.  If they are two cores of a multi-core chip, this is
less likely to be true.  For hyperthreading virtual processors, it is
even less likely to be so.

> My idea was to use the boot processor for running one operating
> system and the 1st application processor to run another OS.  Of
> course, each would have its dedicated physical memory which the other
> OS wouldn't touch.

It's a neat idea.  But beware that for some hardware, the CPUs are
sufficiently asymmetric that some hackery will be required.  For
example, on the MicroVAX (the only case I know at all well), all
hardware interrupts go to the master CPU; if you want any other CPU to
handle hardware interrupts, you'll have to either do some strange
hardware tricks or you'll have to have the master tell the other CPU
about them somehow.  (Well, almost all.  Each CPU fields its own
console serial line interrupts, its own timer interrupts, and of course
its own interprocessor doorbell interrupt.)

> Does this idea I've just written make any sense?  Is it at least
> theoretically possible to do?

Certainly.  As someone else pointed out, in many cases the second CPU
will be capable of damaging the OS running on the first, but that is a
relatively unlikely failure mode (and in some cases, such as the
MicroVAX setup I mentioned above, can be avoided).

It'd be a cool hack.  It'd also be neat to see two OSes running on the
two CPUs with a bit of memory used as a fast network interface between
them.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B