Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 May 97 11:22:24 EDT
From:      Andrew Gallatin <gallatin@CS.Duke.EDU>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        Warner Losh <imp@village.org>, grant@CS.Duke.EDU
Subject:   Re: Alpha questions.. 
Message-ID:  <199705142341.TAA01348@hurricane.cs.duke.edu>
Resent-Message-ID: <199705142341.TAA01348@hurricane.cs.duke.edu>
In-Reply-To: <11626.863576303@time.cdrom.com>
References:  <199705140110.VAA31030@hurricane.cs.duke.edu> <11626.863576303@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help


It think there's a basic misconception here between 'console software'
and PALcode.  They are very closely related.  Both are required for
the operation of an alpha, but they serve very different roles.  I'll
try to explain the differences.

Console software is is responsible for bootstrapping the system and
is, in nearly all cases, flashed into flash memory on an alpha.  From
what I can tell, console software usually has a PALcode image inside
its image, which is installed via the 'call_pall PAL_swppal'
instruction during the bootstrap process. ARC/AlphaBios, SRM and Milo
are all examples of console software.

There is an excellent description of the bootstrap process in the
'Alpha AXP Architecture Reference Manual (2nd Edition).' Sites,
Richard L., Witek, Richard T., 1995 Digital Press, ISBN 1-55558-145-5.
I'll transcribe the highlights of what console software is responsible
for (from page III:3-10 ) in the bootstrap process:

	1) Perform a System Initialization
	2) Size Memory
	3) Test sufficient memory for bootstrapping
	4) Load PALcode
	5) Build a valid Hardware Restart Parameter Block (HWRPB)
	6) Build a valid Memory Data Descriptor Table in the HWRPB
	7) Initialize bootstrap page tables and map initial regions
	8) Locatate and load the system software primary bootstrap image
	9) Initialize processor state on all processors
	10) Transfer control to system software primary bootstrap

Now, if you look at the boot_cmd() function in milo.c, it appears to
do all of these tasks.  From what I can tell, milo is basically a
direct replacement for the SRM console which grok's linux/dos/iso9660
filesystems & provids a subset of SRM's functionality.  It appears to
present a kernel with essentially the same PALcode, HWRPB, MDDT,
environment variables, and callback I/O functions as SRM does.  This
explains why, with the benefit of an 'aboot' bootblock, linux can be
booted via the SRM console on machines where milo doesn't exist (eg,
DEC's PWS 433a & 500a).

As for PALcode, that's a totally different animal.  Again, according to
Sites & Witek (I:1-3):

	A Privileged Architecture Library (PALcode) is a set of subroutines
	that are specific to a particualar Alpha AXP operating system
	implementation.  These subroutines provide operating system primitives
	for context switching, interrupts, exceptions and memory
	management. PALcode is similar to the BIOS libraries that are provided
	in personal computers.

	PALcode subroutines are invoked by implementation hardware or by
	software CALL_PAL instructions.

>From the Alpha Architecure Handbook
(http://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphahb2.pdf)

	6.2 PALcode Instructions and Functions

	PALcode is used to implement the following functions:

	o Instructions that require complex sequencing as an atomic operation
	o Instructins which require VAX style insterlocked memory access
	o Privileged instructions
	o Memory management control, including TLB management
	o Context swapping
	o Interrupt and exception dispatching
	o Power-up initialiaztion & booting
	o Console functions
	o Emulation of instructions with no hardware support

< Before you jump on me for the Power-up initialiaztion & booting, and
console functions contradicting what I just said: I assume they're
talking about the PAL_swppal instruction, the HALT instruction etc.
Basically the PALcode that the console program uses >



Jordan K. Hubbard writes:
 > > I'm not sure this is an accurate impression.  From what I can tell
 > > from groping around in the Milo code, it appears that Milo loads the
 > > OSF palcode.  From reading the linux documentation (which is about as
 > 
 > That would be a huge breach of licensing and would bring at least one
 > division of Digital howling down upon Linux's neck.  I really really
 > doubt that.

Until I downloaded milo & started poking around in it, I would have
thought the same thing myself.  But if you actually look at it, it
claims to be the OSF PALcode *AND* it has a *BSD* copyright on the file.


See for yourself:

	<9:10am>hurricane/gallatin:eb164>pwd
	/tmp/milo/milo-2.1.13/palcode/eb164
	
	<9:11am>hurricane/gallatin:eb164>head -50 platform.S 
	/*
	 *      VID: [T1.2] PT: [Fri Aug 23 07:16:23 1996] SF: [platform.s]
	 *       TI: [/sae_users2/fdh/ebtools/unix/vice -iplatform.s -l/* -p# -DEB164 -h -m -aeb164 ] 
	 */
	/*
	*****************************************************************************
	**                                                                          *
	**  Copyright © 1993, 1994                                                  *
	**  by Digital Equipment Corporation, Maynard, Massachusetts.               *
	**                                                                          *
	**  All Rights Reserved                                                     *
	**                                                                          *
	**  Permission  is  hereby  granted  to  use, copy, modify and distribute   *
	**  this  software  and  its  documentation,  in  both  source  code  and   *
	**  object  code  form,  and without fee, for the purpose of distribution   *
	**  of this software  or  modifications  of this software within products   *
	**  incorporating  an  integrated   circuit  implementing  Digital's  AXP   *
	**  architecture,  regardless  of the  source of such integrated circuit,   *
	**  provided that the  above copyright  notice and this permission notice   *
	**  appear  in  all copies,  and  that  the  name  of  Digital  Equipment   *
	**  Corporation  not  be  used  in advertising or publicity pertaining to   *
	**  distribution of the  document  or  software without specific, written   *
	**  prior permission.                                                       *
	**                                                                          *
	**  Digital  Equipment  Corporation   disclaims  all   warranties  and/or   *
	**  guarantees  with  regard  to  this  software,  including  all implied   *
	**  warranties of fitness for  a  particular purpose and merchantability,   *
	**  and makes  no  representations  regarding  the use of, or the results   *
	**  of the use of, the software and documentation in terms of correctness,  *
	**  accuracy,  reliability,  currentness  or  otherwise;  and you rely on   *
	**  the software, documentation and results solely at your own risk.        *
	**                                                                          *
	**  AXP is a trademark of Digital Equipment Corporation.                    *
	**                                                                          *
	*****************************************************************************
	**
	**  FACILITY:
	**
	**      DECchip 21164 PALcode
	**
	**  MODULE:
	**
	**      platform.s
	** 
	**  MODULE DESCRIPTION:
	** 
	**      Machine specific OSF/1 PALcode for the DECchip 21164
	** 
	**  AUTHOR: ER 

 > Basically, the OSF palcode is closed closed closed and the people
 > responsible for it don't want any &*%$#! free software types using it
 > (a direct quote).  They want $$$ before they'll give it out.

<see above>

 > Besides, it's really not worth getting into anyway because the
 > hardware support for the OSF palcode is abysmal (one or two SCSI
 > controllers and an even smaller variety of other hardware).

Again, this is a console software issue.  PALcode has no
device-specific knowledge of the boot process.  Rather the console
software is responsible for knowing enough about boot devices to be
able to bootstrap from them.  This is why, for example, milo requires
a linux kernel to be built -- it uses the linux device drivers. Ick.

Yes, the SRM console is limited in that respect.  It can't boot from
IDE disks or many SCSI controllers.  Its hard to obtain & in many
ways, its an albatross around the necks of anybody attempting to run a
free UNIX. 

 > For better or for worse, it's ARC for us.
 > 
 > 					Jordan

I do think that we should attempt to at least try to leave ourselves
flexible, otherwise we risk getting badly burned.  As little as I like
linux, there's probably a bit of a lesson to be learned from what
they've done.  It would a appear that they rely on OSFpalcode, and a
very minimal subset of the same functionality provided by the SRM
console (which is provided by Milo on systems where its impossible or
inconvenient to obtain the SRM console -- eg, Alpha 300Xl, etc).  I
think its important to at least try to follow this model.

In fact, from the milo documentation it appears that the only way
linux uses the ARC console software is to load milo & then linux.
(See http://www.azstarnet.com/~axplinux/milo-5.html#ss5.1):


	Most, if not all, Alpha AXP based systems include the Windows NT ARC
	firmware and this is the prefered method of booting MILO and thus
	Linux. Once the Windows NT firmware is running and you have the
	correct MILO image for your system, this method is completely generic.

Eg, ARC -> NT-Palcode/Milo -> OSF-Palcode/Linux.  Or 2 PAL_swppal's &
and 2 bootstraps instead of the normal 1..

Anyway, I hope this helps.  I'm *NOT* a linux fan & realize their boot
process is a mess.  I'm just attempting to understand it and am
beginning to realize that there is a point to it.  

I came in late on this discussion & am not CC'ing this to the list
because for all I know, it may have already come up.  If not, and you
buy what I'm saying, please forward it.

Drew














Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705142341.TAA01348>