Slashdot Mirror


Moving the Linux Kernel Console To User-Space

jones_supa sends this quote from Phoronix: "David Herrmann has provided an update on his ambitious initiative to kill off the Linux kernel console. Herrmann has long been working on making the Linux kernel CONFIG_VT option unnecessary for providing a Linux console by punting it off to user-space. The Linux kernel VT console hasn't been changed much in the past two decades and Herrmann is hoping to see it replaced with a user-space solution he's been developing that would allow for multi-seat support, a hardware-accelerated console, full internalization, and other features."

33 of 311 comments (clear)

  1. Unneeded by Anonymous Coward · · Score: 5, Insightful

    Lets not mess with the TTY's they are STILL NEEDED for when things go wrong...

    1. Re:Unneeded by Anonymous Coward · · Score: 4, Insightful

      100x This ^^^

      Start messing with the console, and you could end up, like Windows, with no basic, self-reliant recovery options.

    2. Re:Unneeded by PReDiToR · · Score: 4, Insightful

      And in the situation where your kernel didn't boot up and you're scratching your head, where are those messages that will help you?
      All the text before:
      Give root password for maintenance:
      is very useful to some people.

      I'll admit that I do tend to compile out early printk and most error messages, hide the init confirmations as much as possible and generally like a tidy boot sequence.
      I like to know that I can put them back in when needed though.

      --

      Do not meddle in the affairs of geeks for they are subtle and quick to anger
  2. good thinking HA! by rubycodez · · Score: 5, Insightful

    making console depend on layers of complexity in user space, yeah that'll all be there when things go south.... the console is there for emergencies, needs to depend on as little as possibile

  3. But pleeeease keep the key-combo by Anonymous Coward · · Score: 5, Insightful

    Being able to press ctrl-alt-f1 when anyting hangs the X server is why I feel more at home in linux than in windows or OSX.

    1. Re:But pleeeease keep the key-combo by Anonymous Coward · · Score: 4, Informative

      When you are on the X console, all keys are handled by X, including the Ctrl-Alt-F1 (that's why if you lock up X badly, even Ctrl-Alt-F1 won't work, although you may still be able to remotely log in and fix things; assuming you have sshd or something equivalent running, of course). However switching back to X11 with Ctrl-Alt-F7 (or whereever your current X session is) is handled by the console.

    2. Re:But pleeeease keep the key-combo by poizan42 · · Score: 5, Informative

      That is why you have Ctrl+Alt+SysRq+R ( http://en.wikipedia.org/wiki/Magic_SysRq_key )

  4. It Works. Fuck It Up! by Anonymous Coward · · Score: 4, Insightful

    So, it's relatively unchanged for "two decades". No one is complaining about it. It doesn't really seem to require improvement as it does what it needs to.

    Yea, let's completely gut the system, move it to user space, introduce a metric shit ton of unexpected and undesirable behavior because... Well, Gnome is changing.

    1. Re:It Works. Fuck It Up! by 0123456 · · Score: 3

      With that argument you kill off a lot of innovation. We don't need cars, we had horse buggies for centuries, right?

      You didn't cut off your legs when you got a horse. You didn't shoot all the horses when you got a car.

      The console is there to fix the system when someone fscks it up. Making it reliant on a ton of user-space code is a really bad idea.

  5. Re:good thinking HA! by Anonymous Coward · · Score: 5, Funny

    This could be an essential part of GNOME 3!

  6. Re:why? by Anonymous Coward · · Score: 5, Informative

    The idea is to replace a kernel functionality with few features and several crucial limitations with a user space solution that is fully-fledged. The fully-fledged solution is not what you want to have inside the kernel, therefore taking the console to user space.

    The need for this arose primarily with the introduction of kernel mode setting etc. Before these advances, the console would somewhat be lame by definition. Now it is much more viable to have a nice console even without a windowing system and that opens new applications to a user-space console.

    E.g. look at Terminology. It is a virtual terminal emulator from the Enlightenment guys, built on the EFL core libraries. It works with David Herrmanns patches, without X11 or any display server!
    http://www.youtube.com/watch?v=AD-BJThtNnc (here run within X)

    Compare this to the basic kernel console. It could replace it if David's work gets through.

  7. I Can't Wait by Anonymous Coward · · Score: 4, Funny

    I can;t wait to hear Linus' response to this plan. I expect it to be something like...

    How 'bout noh! You crazy Dutch bastard.

  8. Uh by christurkel · · Score: 4, Insightful

    a hardware-accelerated console

    Why?

    --

    CDE open sourced! https://sourceforge.net/projects/cdesktopenv/
  9. Wrong Analogy by Anonymous Coward · · Score: 3, Informative

    Good troll, but the better analogy would be car steering wheels haven't changed in decades. They're all round and don't come in many colors or properly support knee control. So, I want to move them into the back seat so they don't get in the way.

  10. Re:why? by Anonymous Coward · · Score: 4, Insightful

    I guess my questions boils down to this: why can't someone who wants a more advanced terminal just open up an X session, and put a few xterms on it? Please leave the very robust kernel console for its failsafe properties.

  11. Re:Rule no 1 by idontgno · · Score: 4, Funny

    If it still works, you haven't fixed it enough.

    --
    Welcome to the Panopticon. Used to be a prison, now it's your home.
  12. Re:good thinking HA! by rubycodez · · Score: 4, Funny

    I think it should require Unity and a touchscreen

  13. Re:good thinking HA! by greg1104 · · Score: 4, Funny

    I await the new console with gesture support. There is one gesture I regularly make to systems that are so broken I have to use the console.

  14. Re:why? by jedidiah · · Score: 3, Insightful

    Quite. This sounds like a solution in search of a problem and users that actually care. On the other hand, it could break things horribly especially for those failsafe situations.

    it sounds like yet another example for of change for it's own sake not driven by any actual end user requirements that is actually being done DESPITE end user objections.

    It seems like a perfect microsoftism.

    --
    A Pirate and a Puritan look the same on a balance sheet.
  15. If you aren't using a serial port by ultrasawblade · · Score: 3, Informative

    then you aren't really using a "failsafe" console. Even Windows has this with it's "Special Administration Console" / "Emergency Management Services."

    When I was building custom kernels for my server I would remove the VT support. Pure serial.

    So I don't care. Sounds good from a design standpoint. Should have the least in the kernel possible - simple = robust.

  16. Re:Look at the details, this is a joke by ultrasawblade · · Score: 4, Informative

    The VT console has been "hardware accelerated" under x86/VGA for years. You don't think it's actually copying memory line for line when it needs to scroll the screen, do you? No, it's incrementing the VGA register that tells it what memory address to start drawing text from.

  17. What exact problem is this trying to solve? by idontgno · · Score: 5, Insightful

    From TFA (to save your delicate eyes from the indignity of RTFA):

    Among his principal complaints about the current terminal is that it's a user-interface in kernel-space, the code is poorly maintained, handles keyboards badly, produces bad font rendering, misses out on mode-setting and multi-head support, contains no multi-seat awareness, and only has limited hot-plugging handling, limited to VT102 compliance.

    Let's look at this one item at a time.

    1. "user-interface in kernel-space": Is this a philosophical objection? I'd argue that depending completely on userspace for system restoration is basically giving up on many classes of system problems. If you don't have user interaction at the kernel level, your only response to certain problems is reduced to "burn it down and rebuild it, lol". If you're all VM, sure, go nuts. But VM isn't universal, and restructuring Linux to only be usable in VM environments only is just foolish and shortsighted.
    2. "code is poorly maintained": [Citation needed]. Is the complaint that it hasn't had commits in a while? Maybe because it's not broke? Simple capability with simple requirements probably attained stable maturity years ago. Maybe the committers should toss in a few random code restructures to make it look like someone cares.
    3. "handles keyboards badly": Does it drop keystrokes? If it doesn't do that, there's absolutely no rational basis for this complaint. Maybe baby wants his arrow keys, or non-ASCII character set? Screw that. This is a console. Use vi commands like a grownup. And you don't need your umlauts and accents. The commands are all composed of ASCII characters. If you're reduced to using the console, internationalization is the least of your problems.
    4. "produces bad font rendering": "bad font rendering?" "BAD FONT RENDERING?" Seriously? "It's not pretty enough?" I'm not even gonna address this drivel.
    5. "misses out on mode-setting and multi-head support": Guess what. There is exactly ONE CONSOLE. It's for the use of ONE ADMINISTRATOR to restore function to a system which can't otherwise run in multi-head, multi-user modes. Not a problem.
    6. "contains no multi-seat awareness": While you're at it, please complain that cars don't have multiple drivers' seats.
    7. "limited hot-plugging handling": Interestingly, when system consoles were serial terminals like God intended, hot-plugging was a non-problem, since EIA RS-232 specifications meant that you could hot-plug serial cabling to your heart's content. Maybe thats' where the solution to this "problem" properly lies?
    8. "limited to VT102 compliance": Oh, I'm so sorry it doesn't include your favorite terminal emulation. But it's good enough to run vi (properly statically linked, in /sbin), and that's as close to a GUI you'll ever get in system recovery operations. so, um, NO.
    --
    Welcome to the Panopticon. Used to be a prison, now it's your home.
    1. Re:What exact problem is this trying to solve? by psmears · · Score: 3, Informative

      "handles keyboards badly": Does it drop keystrokes? If it doesn't do that, there's absolutely no rational basis for this complaint. Maybe baby wants his arrow keys, or non-ASCII character set? Screw that. This is a console. Use vi commands like a grownup.

      Maybe the user wants to get the ">" symbol on pressing the ">" key. Which is different on different keyboard layouts. Doesn't seem too unreasonable...

      And you don't need your umlauts and accents. The commands are all composed of ASCII characters.

      ... but the filenames aren't. When you're trying to free up vital disk space by deleting hügë_fïlë.jpg, wouldn't it be handy to be able to type its filename?

  18. Re:why? by Hatta · · Score: 4, Insightful

    The idea is to replace a kernel functionality with few features and several crucial limitations

    But those few features are crucial.

    The need for this arose primarily with the introduction of kernel mode setting etc.

    And what happens when KMS fails? What happens when all you have are VGA text modes?

    Will the user space console work in every instance where the current console works? If so, great. If we give up any of the reliability we've grown to rely upon, no thanks. I'd rather have a "lame console" I know will be there, than a full featured console I have to troubleshoot.

    --
    Give me Classic Slashdot or give me death!
  19. Re:why? by Anonymous Coward · · Score: 5, Insightful

    So you two & everyone who's modded these up, thinks that 1) something being moved to a secondary option is the same as "being killed", and 2) that technology shouldn't be used to improve anything.

    Please rethink.

  20. Re:why? by Anonymous Coward · · Score: 4, Insightful

    Wrong. Less functionality running in the kernel, the better. The kernel is a highly constrained environment, and it is also very security sensitive. Console processing does not belong there.

    This sounds like yet another example of uninformed people assuming that they know anything about the subject matter at hand, and assuming that actual kernel developers do not.

  21. Re:why? by Spazmania · · Score: 5, Insightful

    But it's not fully fledged.... it doesn't provide two of the three features I need in a text console: kernel diagnostic messages prior to the start of user space and kernel diagnostic messages following a crash.

    --
    Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
  22. QNX does this and gets it right. by Animats · · Score: 4, Informative

    QNX, the real-time message passing operating system now owned by Blackberry, does all "console" handling in user space. They've done that for years. That's because, in the embedded world, you can't assume the target machine has a console, or even a serial port.

    When you build a QNX boot image for an embedded system, you can add any programs you want to be available as soon as the system boots. All device drivers are in user space, so that's how the initial set of drivers gets loaded. You can also load applications that way. Having a file system is optional. If necessary, all software can be in a ROM. This allows scaling down to small embedded devices.

    A serial console program is available, and is loaded into most systems that have a serial port. There are other options for systems that don't have a serial port, like connecting it to a network.

    There's also a system logger. It's common to have the system logger log to some network destination elsewhere, so problems out at Pumping Station 42 are reported to the control center far away.

    Linux has tried to emulate this architecture. More drivers are in user space. But in Linux that was an afterthought, and it shows.

  23. Re:why? by tibit · · Score: 3, Interesting

    What's wrong with it being in the userspace? At least if it crashes, it doesn't bring the whole kernel down. The process is relaunched by the kernel, and off you go. It's the Erlang mantra of reliable software: fail fast, in limited scope. I love it. That's why I'm a big fan of userspace drivers for all devices that are application-specific. Suppose you have a USB-based toy that has a vendor-specific functionality and isn't one of the standard USB device classes. You have an application for. It should only have a userspace driver bundled with the application. You start the app, it claims any USB devices it can handle, and goes from there. That's often how it's done on OS X, it's quite onpopular on Windows, unfortunately.

    --
    A successful API design takes a mixture of software design and pedagogy.
  24. Re:why? by tibit · · Score: 3, Insightful

    It's not a long stretch to imagine that you can start a userspace process long before all of the kernel drivers are initialized. It's basically a big waste of time that the kernel delays starting init to *after* all the drivers are initialized. It's a waste of time. The applications that depend on functionality of certain parts of the kernel should simply wait until those parts become available. That's all there's to it. Also, the drivers can be initialized in parallel. No reason for the network card driver initialization not to run in parallel with waiting for the scsi raid driver to come up. The console doesn't need any of that and can be started up as the first thing, even if it were a userspace driver. Kernel usually starts off an initrd image, that's where the console application would be. I think it'd be wonderful if the kernel went in this direction, not only for console but for all other drivers as well. The applications that need to wait for certain things can get notifications when drivers get ready.

    --
    A successful API design takes a mixture of software design and pedagogy.
  25. Re:why? by Hatta · · Score: 4, Insightful

    What's wrong with it being in the userspace? At least if it crashes, it doesn't bring the whole kernel down. The process is relaunched by the kernel, and off you go.

    Suppose you never make it to user space?

    --
    Give me Classic Slashdot or give me death!
  26. Re:why? by fa2k · · Score: 3, Insightful

    Wrong. Less functionality running in the kernel, the better. The kernel is a highly constrained environment, and it is also very security sensitive. Console processing does not belong there.

    When everything breaks down, it isn't worth much to have a rock solid kernel if you can't interact with it through a console

  27. Re:Going that way for a while now by sjames · · Score: 3, Insightful

    There have been a lot of improvements in Linux, but there has also been a lot of dane brammage shoveled in. Most of it is in userspace, but sadly, not all.

    Gnome finally exceeded the maximum height BS can be piled and people are switching in droves. I have to agree that the new startup methods are mostly crap. I see no reason to pile in that much poorly documented crap to save 5 seconds at boot time (especially when we're not supposed to need to boot all that often).

    I believe GP is referring to the situation in Fedora (perhaps changed now). For a while, it would break fairly badly if you dared to go back even a single sub-minor number on your kernel.

    I am definitely NOT fond of grub2's configuration system. They took a simple and sane config and turned it into a 20 headed hydra full of config files and scripts that write config files. It's a very complex solution to a very simple problem and it needs to die. I have similar feelings about the way /dev is handled now. I can live with devices appearing and disappearing, but wit's with the bazillion little cryptic files.

    It really IS becoming more opaque like Windows.

    I certainly agree about the modelines. Good riddance to them. DDP is a win!