Subject: Re: [bertram@ifib4.ifib.uni-karlsruhe.de (Bertram Barth): bootstrap at VAX]
To: Bertram Barth <bertram@ifib4.ifib.uni-karlsruhe.de>
From: Paul A Vixie <vixie@vix.com>
List: netbsd-ports
Date: 12/29/1993 14:22:37
cgd fwd'd this to me and asked if i'd answer it.  i know of at least one
person (who is on this list, and you know who you are) who would be better
by far at answering it than i am, but here goes:

> I'm trying to bootstrap my MicroVAX II. Now i ran into a few
> problems (missing documentation) and i don't know whom to ask.
> 
> If the first block of the boot-device is a boot block, VMB loads this
> block in the first page of good memeory and passes control to it.
> Q: what makes the first block looking like a boot block ??
>    what and where are the magic bytes ??
>    BTW: Are they the same for all VAXen ??

the boot block is executable code on some older console floppies on 780's,
but on the 750 and all newer vaxes as well as 780's with newer console 
floppies, the boot block is a VMB structure.  a VMB has a series of fields
and flags that tell VMB.EXE (which either comes from the console media or
is built into ROM depending on which vax you're talking about) how to boot.

i'm sorry but i do not remember the magic header of this block.  i no longer
work for DEC, so i don't have access to ultrix's kernel sources, or for that
matter, access to any vaxes to test this on.  (hint: if you have a vax, you
can use "dd if=/dev/rra0c count=1 | od -x" and reverse-engineer it.)

> This bootblock then loads a few more blocks into memory. For doing this
> it uses the i/o-routines in VMB. Then it passes control to loaded code.
> Q: where are the entry-points for the i/o-routines in VMB ??
>    what are the parameters ?? what are the result/return-values ??
>    how are the passed to the routines (i assume in registers, but which) ??

this information is doubtless dec-proprietary.  you could find a VMS machine
and disassemble the VMB.EXE executable and try to guess these things, but i
doubt that the offsets and parameters are terribly common from release to
release.  the way BSD used to boot was to put some boot code into the root
file system header, just enough to find the /boot file and execute it.  this
code historically avoided vmb entirely.

> I looked into a few books but couldn't find what i'm looking for:
> 	VAX/VMS Internals and Data Structures
> 	VAX Architecture Reference Manual
> 	VAX Hardware Handbook (~1981)
> 	VAX Architecture Handbook (~1981)

what you need is DEC Standard #032, an internal and proprietary document.
this is the source of all the information in the documents you listed, and
has some things in it (like VMB details) which aren't considered interesting
to users.  it's hard to remember that as time went on, DEC stopped considering
their hardware interesting and stopped assuming that people would write custom
operating systems for them.  DEC's goal was to ship integrated hardware and
software systems, rather than raw iron.  i don't now and did not then think
that this attitude was particularly bright on their part.  but so it goes.

> I hope to find the missing documentation e.g. in:
> 	KA630 CPU Module Users Guide
> Is this book still available ??? (price ??)

you can probably get this, but i don't think it'll tell you what you want to
know.  it's probably one of those "this is a picture of an anti-static wrist
strap" books rather than something that will tell you the register layouts
the way the earliest vax architecture handbooks did about the 780/750/730.

> Anybody out there who has this ???
>
> BTW: Is there a (email)-adress at DEC where i could ask such questions
>      about documentation ?? (info@dec.com didn't work)

i think they're working on this; for a while, support@dec.com worked but i
don't know if it does now.  if anyone can help you it's grant@pa.dec.com.

------------------------------------------------------------------------------