Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: VAX RPB (Restart Parameter Block)

Mouse wrote:

> > The Netbsd bootloader is faking an RPB in autoconf.c: [...]
> > ...and I think that the behavior with the reboot has something todo
> > with that "bootregs".
> Quite possibly.
> > so I've looked at the ../../include/rpb.h file:
> >  * Look at "VAX/VMS Internals and Data Structures" around page 907
> >  * to get more info about RPB.
> You probably can also check your hardware's doc - I think you have the
> hardware manual, right? - for how your particular hardware reacts to
> various settings in the RPB.
> > Or what is that rpb_rstflag meaning, I read somewhere in the rtVAX
> > manual that a restart should be prevented when the booted Os is
> > broken (for debugging purposes).
> The KA630 manual describes a "restart in progress" flag which the OS is
> presumably expected to change once it's far enough up that it should be
> considered successfully booted.  It's not in the RPB, though:
>     The  console  keeps  a  "Restart in progress" flag in CPMBX bit 3,
>     which  it  uses  to  avoid  repeated attempts to restart a failing
>     operating  system. An additional "Restart in progress" flag may be
>     maintained by software in the RPB.
> However, this affects attempts to restart the OS, not behaviour on
> HALT.  Behaviour on HALT is controlled by a hardware pin and
> CPMBX<1:0>.
> Of course, how similar this is to your rtVAX is the real question.  The
> KA630 manual has a section that's all about what the hardware does on
> the various halt conditions (section 4.4.4, page 4-9); it doesn't go
> into details about what the ROM code does (that's earlier - 3.3, page
> 3-7).  Does your hardware manual have something similar perhaps?
> /~\ The ASCII                           Mouse
> \ / Ribbon Campaign
>  X  Against HTML              mouse%rodents-montreal.org@localhost
> / \ Email!         7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

There is not that much in the Manual about this:

"4.2.1 Restart
The restart opration searches system memory for a restart parameter block
(RPB). Tihs data structure is construced by the VQXELN operating system or
by the console program. If a valid RPB is found, the operating system is
restarted at an address specified in the RPB. An internal flag indicating
restart in progress is set to prevent repeated attempts to restart a
failing operating system. A system restart can occur as the result of a
processor halt."

We do have a system restart as result of a processor halt (..if I inserted
an __asm("halt)).

As next the Document references the RPB regarding the console command FIND
/RPB, but it doesn't find anything when ever I tried it.

That's all in the documentation.


From srt0.S:

        movl    $_C_LABEL(start), %sp   # Probably safe place for stack
        pushr   $0x1fff         # save for later usage

        subl3   $_C_LABEL(start), $_C_LABEL(edata), %r0
        movab   _C_LABEL(start), %r1 # get where we are
        movl    $_C_LABEL(start), %r3 # get where we want to be
        cmpl    %r1,%r3         # are we where we want to be?
        beql    relocated       # already relocated, skip copy
        movc3   %r0,(%r1),(%r3) # copy
        subl3   $_C_LABEL(edata), $_C_LABEL(end), %r2
        movc5   $0,(%r3),$0,%r2,(%r3) # Zero bss

        movpsl  -(%sp)
        pushl   $relocated
relocated:                      # now relocation is done !!!
        movl    %sp,_C_LABEL(bootregs)  # *bootregs
        calls   $0, _C_LABEL(Xmain)     # Were here!
        halt                    # no return

then boot.c

        int io;
        int j, nu;
        u_long marks[MARK_MAX];
        extern const char bootprog_rev[];

        io = 0;
        skip = 1;

then autoconf.c

        int copyrpb = 1;
        int fromnet = (bootregs[12] != -1);

        findcpu(); /* Configures CPU variables */
        consinit(); /* Allow us to print out things */
        scbinit(); /* Fix interval clock etc */

#define Holm
#ifdef Holm

        vax_siedata = *(int *)(0x20040004);     /* SIE address */
        vax_boardtype |= vax_siedata >> 24;
        printf("\nvax_boardtype(sie): %x\n",vax_boardtype);

#ifdef DEV_DEBUG
        printf("\nRegister contents:\n");
        for (copyrpb = 0; copyrpb < 13; copyrpb++)
                printf("r%d: %lx\n", copyrpb, bootregs[copyrpb]);
        switch (vax_boardtype) {
       case VAX_BTYP_1202:
                if (fromnet == 0)
                copyrpb = 0;
                bootrpb.devtyp = bootregs[0];
                bootrpb.adpphy = bootregs[1];
                bootrpb.csrphy = bootregs[2];
                bootrpb.unit = bootregs[3];
                bootrpb.rpb_bootr5 = bootregs[5];
                bootrpb.pfncnt = 0;

        case VAX_BTYP_RT300:
                if (fromnet == 0)
                copyrpb = 0;
                bootrpb.devtyp = 100;
                bootrpb.csrphy = 0x20008000;
                bootrpb.unit = 0;
                bootrpb.rpb_bootr5 = bootregs[5];
                bootrpb.pfncnt = 0;

so it must be in findcpu(), consinit() or scbinit()..

That below the  case VAX_BTYP_RT300: is from me, since the bootloader
doesn't knew that CSR or the 100 for ze0 before, so I'm not sure if there
is a "compatible" RPB at all, at least there is nothing that the bootloader
recognized w/o my hint.

I've downloaded the manual I've asked for, but had not time yet to look
further at it.
The bootregs should be on the stack, I wan't to know what they containing.

Anyway, It isn't that much interesting if the original RPB exists from the
Firmware on the board, like u sayd some time before, I wan't to halt that
thing. When I fake an RPB that the firmware could find later when the cpu
is running at a halt, it should halt, shouldn't it?

Interresting is the sentence above: "An internal flag indicating  
restart in progress is set to prevent repeated attempts to restart a 
failing operating system." .... oh yes, an internal flag somewxpehre in the
universe ...it's all clear now :-|

I'll look tomorrow further at this stuff.



      Technik Service u. Handel Tiffe, www.tsht.de, Holm Tiffe, 
     Freiberger Straße 42, 09600 Oberschöna, USt-Id: DE253710583
  www.tsht.de, info%tsht.de@localhost, Fax +49 3731 74200, Mobil: 0172 8790 741

Home | Main Index | Thread Index | Old Index