[lkml]   [1997]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRegistering additional console from a module?
    For some time, I've been using an old MDA monitor to display my syslog. I have 
    decided it's about time to make it a console, so that any kernel panic
    messages will get sent to it, because they usually end up behind my X display,
    which isn't particularly useful.

    As the mda driver is currently a module, I'd like to keep it that way, but I
    have a few doubts about registering the new console from a module.

    Looking at the implementation of register_console in kernel/printk.c, I
    see that the new console would be added at the head of the linked list.
    Can I happily add an unregister_console function, to cut the new console
    entry out of the linked list when the module is unloaded?

    As these functions could then be called at any time, I suppose I would
    need to protect the linked list with a spinlock to prevent concurrent
    modifications, which could leave the linked list corrupted. What routines are
    offered by the kernel for this? (2.1.37)

    I did think about the possibility of adding a routine to allow dynamic setting
    of consoles via a file in /proc, e.g. echo "add /dev/mono" >/proc/consoles to
    do it, but this wouldn't be so simple, would it? Maybe it could be done if we
    only allow character devices to be used?

    Any ideas / suggestions?

    ---- ------------------------------------------------ ----
    David Woodhouse, WWW:
    Robinson College, Email:
    Cambridge, Tel: +44 (0) 976 658355
    CB3 9AN, (n)talk:
    England. PGP KEY: finger
    ---- ------------------------------------------------ ----

     \ /
      Last update: 2005-03-22 13:39    [W:0.038 / U:4.216 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site