Port-vax archive

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

VAX RPB (Restart Parameter Block)



Since I want to post mortem debug my broken netbsd kernels with that scn
driver, that auto restart at a halt instruction is annoying.

As I wrote before I've set HALT to 3 before booting, but when the kernel
is crashing it is set to 0 automagically.

The Netbsd bootloader is faking an RPB in autoconf.c:
-----------------------------------------------------------------------
long *bootregs;

/*
 * Do some initial setup. Also create a fake RPB for net-booted machines
 * that don't have an in-prom VMB.
 */

void
autoconf(void)
{
        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);
#endif


#ifdef DEV_DEBUG
        printf("\nRegister contents:\n");
        for (copyrpb = 0; copyrpb < 13; copyrpb++)
                printf("r%d: %lx\n", copyrpb, bootregs[copyrpb]);
#endif
        switch (vax_boardtype) {

        case VAX_BTYP_780:
        case VAX_BTYP_790:
        case VAX_BTYP_8000:
        case VAX_BTYP_9CC:
        case VAX_BTYP_9RR:
        case VAX_BTYP_1202:
                if (fromnet == 0)
                        break;
                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;
                break;

                break;

        case VAX_BTYP_RT300:
                if (fromnet == 0)
                        break;
                copyrpb = 0;
                bootrpb.devtyp = 100;
                bootrpb.csrphy = 0x20008000;
                bootrpb.unit = 0;
                bootrpb.pfncnt = 0;
                break;

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

...and I think that the behavior with the reboot has something todo with
that "bootregs".

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.
 */

struct rpb {            /* size         description */
        struct rpb *rpb_base;   /* 4  physical base address of block */
        void  (*rpb_restart)(void);/* 4  physical address of restart
routine */
        long    rpb_chksum;/* 4  checksum of first 31 longwords of restart
*/
        long    rpb_rstflg;     /* 4  Restart in progress flag */
        long    rpb_haltpc;     /* 4  PC at HALT/restart */
                        /* offset: 20 */
        long    rpb_haltpsl;/* 4  PSL at HALT/restart */
        long    rpb_haltcode;/* 4  reason for restart */
        long    rpb_bootr0;/* 24  Saved bootstrap parameters (R0 through R5) */
        long    rpb_bootr1;
        long    rpb_bootr2;
        long    rpb_bootr3;
        long    rpb_bootr4;
        long    rpb_bootr5;
        long    iovec;  /* 4  Address of bootstrap driver */
        long    iovecsz;/* 4  Size (in bytes) of bootstrap driver */
                        /* offset: 60 */
        long    fillbn; /* 4  LBN of seconday bootstrap file */
        long    filsiz; /* 4  Size (in blocks) of seconday bootstrap file
*/
        long    pfnmap[2];      /* 8  Descriptor of PFN bitmap */
        long    pfncnt; /* 4  Count of physical pages */
                        /* offset: 80 */
        long    svaspt; /* 4  system virtual address of system page table
*/
        long    csrphy; /* 4  Physical Address of UBA device CSR */
        long    csrvir; /* 4  Virtual Address of UBA device CSR */
        long    adpphy; /* 4  Physical Address of adapter configurate reg.
*/
        long    adpvir; /* 4  Virtual Address of adapter configurate reg.
*/
-----------------------------------------------------------------------

...and so I need to know a little more.
Above in rpb.h is the hint about that

Look at  "VAX/VMS Internals and Data Structures" around page 907

But this manual seems to be not existing as PDF or so.
Does anyone have this on paper and could please doo a look at it?

I want to know if the "HALT" Value from the firmware loader is lokated
somewhere in the rpb astructure so I can it set right in the loader.
I thought it is set somewhere in the 24 saved values and enabled
DEV_DEBUG while building,  but I can see nowhere a "3" in the
registers at the start auf the autoconf:
-----------------------------------------------------------------------
2..1..0..
vax_boardtype(sie): a000009

Register contents:
r0: 20042f75
r1: ffea00
r2: 1000
r3: ffba00
r4: 0
r5: 0
r6: 0
r7: 3fe6a8
r8: 800
r9: 1800
r10: 1800
r11: 0
r12: 200
-----------------------------------------------------------------------

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).

THX,

Holm


-- 
      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