Re: Recent problems with -current on alpha...

From: Ken Smith (kensmith_at_cse.Buffalo.EDU)
Date: 02/27/04

  • Next message: John Baldwin: "Re: pxeloader problem: BTX halted [FIXED]"
    Date: Fri, 27 Feb 2004 10:38:17 -0500
    To: Bruce Evans <bde@zeta.org.au>
    
    

    On Sat, Feb 28, 2004 at 02:00:44AM +1100, Bruce Evans wrote:
    > On Thu, 26 Feb 2004, Ken Smith wrote:
    > > My patch moves the initialization of the promcons stuff until after
    > > the VM system is initialzed and comments out all the printf()'s I
    > > could find that might have happened before the console is initialized.
    >
    > This would break use of ddb until after the vm system is initialized
    > (unless it is already broken). i386 console initialization tries hard
    > to initiatialize the console as early as possible so that it can be
    > used for debugging. This is less needed with gdb, but early printfs
    > still need a console.

    Yup, this was bothering me too. Basically I'd like to get beast to
    the point I don't need to manually boot it every day, but I'm stubborn
    enough to not disable the nightly rebuild/reboot cron job just on the
    principle of it. :-) So, I've been poking around at this as best I
    can just to try and help isolate exactly what the problem is, I figured
    then maybe someone(s) with a bigger clue than me can take it from there.

    I don't know if this patch is an appropriate short-term fix (I'd tend
    to agree with Marcel that Alpha's console handling could use a fairly
    extensive overhaul). But it demonstrates the problem and with this
    patch beast seems to boot and runs just fine. This is better than
    what I had last night I think because it doesn't disturb what had
    been in place before except for delaying when make_dev() gets called.
    I don't know if that would have any bad side-effects.

    If I move the call to promcons_delayed_makedev() above the code block
    that this patch currently puts it under, and if I force the make_dev()
    to be called (beast doesn't actually use promcons for its console
    except during the early phase of the boot, it winds up switching to
    a different console in machdep.c at the point the comment block
    says "Initialize the real console, ...") then beast crashes with the
    kernel stack issues. With promcons_delayed_makedev() called where
    this patch puts it and similarly forcing the call to make_dev() beast
    doesn't crash and prints out two copies of every character sent to
    the console during boot so I'm fairly sure the patch is doing what
    is intended...

    Further comments welcome... I'm not totally sure where to go from
    here unless Marcel and/or Drew wants to take over... :-)

    Index: machdep.c
    ===================================================================
    RCS file: /home/ncvs/src/sys/alpha/alpha/machdep.c,v
    retrieving revision 1.216
    diff -u -r1.216 machdep.c
    --- machdep.c 3 Jan 2004 02:02:24 -0000 1.216
    +++ machdep.c 27 Feb 2004 13:28:23 -0000
    @@ -201,6 +201,9 @@
     long unknownmem; /* amount of memory with an unknown use */
     int ncpus; /* number of cpus */
     
    +int promcons_dly_mkdev = 1; /* need to delay call to make_dev() */
    +void promcons_delayed_makedev(void);
    +
     vm_offset_t phys_avail[10];
     
     /* must be 2 less so 0 0 can signal end of chunks */
    @@ -887,6 +890,14 @@
                     thread0.td_md.md_kernnest = 1;
     #endif
             }
    +
    + /*
    + * Check to see if promcons needs to make_dev() now,
    + * doing it before now crashes with kernel stack issues.
    + */
    + if (promcons_dly_mkdev > 1)
    + promcons_delayed_makedev();
    + promcons_dly_mkdev = 0;
     
             /*
              * Initialize the virtual memory system, and set the
    Index: promcons.c
    ===================================================================
    RCS file: /home/ncvs/src/sys/alpha/alpha/promcons.c,v
    retrieving revision 1.34
    diff -u -r1.34 promcons.c
    --- promcons.c 21 Feb 2004 21:10:38 -0000 1.34
    +++ promcons.c 27 Feb 2004 13:38:29 -0000
    @@ -83,6 +83,9 @@
     int promparam(struct tty *, struct termios *);
     void promstop(struct tty *, int);
     
    +extern int promcons_dly_mkdev;
    +void promcons_delayed_makedev(void);
    +
     int
     promopen(dev, flag, mode, td)
             dev_t dev;
    @@ -248,9 +251,22 @@
     {
             prom_consdev.cn_pri = CN_NORMAL;
             sprintf(prom_consdev.cn_name, "promcons");
    - make_dev(&prom_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "promcons");
    - cnadd(&prom_consdev);
    + if (promcons_dly_mkdev)
    + promcons_dly_mkdev++;
    + else {
    + make_dev(&prom_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "promcons");
    + cnadd(&prom_consdev);
    + }
             promcn_attached = 1;
    +}
    +
    +void
    +promcons_delayed_makedev(void)
    +{
    + if (promcn_attached) {
    + make_dev(&prom_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "promcons");
    + cnadd(&prom_consdev);
    + }
     }
     
     void

    -- 
    						Ken Smith
    - From there to here, from here to      |       kensmith@cse.buffalo.edu
      there, funny things are everywhere.   |
                          - Theodore Geisel |
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: John Baldwin: "Re: pxeloader problem: BTX halted [FIXED]"

    Relevant Pages

    • Re: [PATCH] serial: do not call ->pm() on initialization for console port
      ... I should push other workaround to fix this issue on 2.6.24. ... I don't know what patch you're referring to. ... Subject: serial: do not call ->pmon initialization for console port ...
      (Linux-Kernel)
    • [PATCH] interrupt driven hvc_console as vio device (final)
      ... Here is the revised hvc_console patch which fixes the issues you were ... This is an hvc_console patch which provides driver and ppc64 ... console output functionality prior to early console init (pre mem init ... -Added early discovery of vterm/vty adapters by doing a bus walk on ...
      (Linux-Kernel)
    • Re: TIOCCONS security revisited
      ... > In August 2004, Olaf Dabrunz posted a patch, which appears to have got ... The problem is that TIOCCONS causes security problems. ... the ioctl TIOCCONS allows any user to redirect console output to ...
      (Linux-Kernel)
    • Re: Recent problems with -current on alpha...
      ... syscons console initialization depends on this. ... I hade a printf() in make_dev. ... message buffer is not initialized until later, ...
      (freebsd-current)
    • Re: kern/71142; VESA 1024x768; (Poor Console resolution on Compaq 2103US)
      ... I chose to stick with FreeBSD over Slackware ... >for my laptop for the simplicity in its init system ... >proper console resolution was a pain as I favour ... >still some issues that the patch created in making use ...
      (freebsd-current)