Keyboard device driver modification... Plzzz help!!! - Minix

This is a discussion on Keyboard device driver modification... Plzzz help!!! - Minix ; Hi.. I have three main problems.. 1. I need to modify the appropriate device drivers in MINIX 3 such that when you hit a special key (or ctrl-key or esc sequence), it will delete the last word that you have ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Keyboard device driver modification... Plzzz help!!!

  1. Keyboard device driver modification... Plzzz help!!!

    Hi..
    I have three main problems..

    1. I need to modify the appropriate device drivers in MINIX 3 such
    that when you hit a special key (or ctrl-key or esc sequence), it will
    delete the last word that you have just typed. You can delete a total
    of three words consecutively.

    2. If you hit another key (or ctrl-key etc.), it will restore the word
    that it just deleted. You can restore the last three deleted words by
    hitting the special key three times.

    3.I need to choose another key (e.g. the tab key). When you kit the
    key, it should echo the file names in the directory that you are
    working on one at a time from the curser position.

    Kindly help me...
    Ricky


  2. Re: Keyboard device driver modification... Plzzz help!!!


    ricky.sa.2000@gmail.com schreef:
    > Hi..
    > I have three main problems..
    >
    > 1. I need to modify the appropriate device drivers in MINIX 3 such
    > that when you hit a special key (or ctrl-key or esc sequence), it will
    > delete the last word that you have just typed. You can delete a total
    > of three words consecutively.


    For what program do you need this? All or just the shell? If you need it
    for the shell, I think you can beter modify just the the shell instead.

  3. Re: Keyboard device driver modification... Plzzz help!!!



    Erik writes:

    > ricky.sa.2000@gmail.com schreef:
    >> Hi..
    >> I have three main problems..
    >> 1. I need to modify the appropriate device drivers in MINIX 3 such
    >> that when you hit a special key (or ctrl-key or esc sequence), it will
    >> delete the last word that you have just typed. You can delete a total
    >> of three words consecutively.

    >
    > For what program do you need this?


    For a very important program which is a matter of life and death. :-).

    Regards -- Markus


  4. Re: Keyboard device driver modification... Plzzz help!!!


    ricky.sa.2000@gmail.com writes:

    > Hi..
    > I have three main problems..


    Oh no, you have four problems. Since you don't follow up when people
    kindly offer to help you, the b'number of people inclined to help you
    decrease monotonously with time.


    > 1. I need to modify the appropriate device drivers in MINIX 3 such
    > that when you hit a special key (or ctrl-key or esc sequence), it will
    > delete the last word that you have just typed. You can delete a total
    > of three words consecutively.
    >
    > 2. If you hit another key (or ctrl-key etc.), it will restore the word
    > that it just deleted. You can restore the last three deleted words by
    > hitting the special key three times.
    >
    > 3.I need to choose another key (e.g. the tab key). When you kit the
    > key, it should echo the file names in the directory that you are
    > working on one at a time from the curser position.



    1+2 can be done in the device driver (but make sense only in cooked
    mode, look there in the tty driver code and consider what "normal"
    backspace does there). 3 doesn't seem to make sense being done in the
    device driver. Are you sure you're repeating your requirements /
    instructions correctly? Again it would help to get a bit more
    context, like exactly what you achieve or the exact wording of your
    homework (and admitting that it's homework would spare us trying to
    suggest alternative solutions for a technical problem).

    Regards -- Markus


  5. Re: Keyboard device driver modification... Plzzz help!!!

    On Apr 16, 6:53 pm, Markus E Leypold
    wrote:
    > ricky.sa.2...@gmail.com writes:
    > > Hi..
    > > I have three main problems..

    >
    > Oh no, you have four problems. Since you don't follow up when people
    > kindly offer to help you, the b'number of people inclined to help you
    > decrease monotonously with time.
    >
    > > 1. I need to modify the appropriate device drivers in MINIX 3 such
    > > that when you hit a special key (or ctrl-key or esc sequence), it will
    > > delete the last word that you have just typed. You can delete a total
    > > of three words consecutively.

    >
    > > 2. If you hit another key (or ctrl-key etc.), it will restore the word
    > > that it just deleted. You can restore the last three deleted words by
    > > hitting the special key three times.

    >
    > > 3.I need to choose another key (e.g. the tab key). When you kit the
    > > key, it should echo the file names in the directory that you are
    > > working on one at a time from the curser position.

    >
    > 1+2 can be done in the device driver (but make sense only in cooked
    > mode, look there in the tty driver code and consider what "normal"
    > backspace does there). 3 doesn't seem to make sense being done in the
    > device driver. Are you sure you're repeating your requirements /
    > instructions correctly? Again it would help to get a bit more
    > context, like exactly what you achieve or the exact wording of your
    > homework (and admitting that it's homework would spare us trying to
    > suggest alternative solutions for a technical problem).
    >
    > Regards -- Markus


    Yeah.. it's a homework, and these are the requirements as given
    exactly.. lol.. I think i know how to delete a word.. but how do i
    delete just 3 words at max by pressing the special key and how do i
    restore the three words after the delete by pressing the same key?
    it's very confusing..
    BTW, i didn't understand what u meant by just the shell.. or as a
    whole. kindly help me!
    ... Ricky


  6. Re: Keyboard device driver modification... Plzzz help!!!


    ricky.sa.2000@gmail.com writes:

    > On Apr 16, 6:53 pm, Markus E Leypold
    > wrote:
    >> ricky.sa.2...@gmail.com writes:
    >> > Hi..
    >> > I have three main problems..

    >>
    >> Oh no, you have four problems. Since you don't follow up when people
    >> kindly offer to help you, the b'number of people inclined to help you
    >> decrease monotonously with time.
    >>
    >> > 1. I need to modify the appropriate device drivers in MINIX 3 such
    >> > that when you hit a special key (or ctrl-key or esc sequence), it will
    >> > delete the last word that you have just typed. You can delete a total
    >> > of three words consecutively.

    >>
    >> > 2. If you hit another key (or ctrl-key etc.), it will restore the word
    >> > that it just deleted. You can restore the last three deleted words by
    >> > hitting the special key three times.

    >>
    >> > 3.I need to choose another key (e.g. the tab key). When you kit the
    >> > key, it should echo the file names in the directory that you are
    >> > working on one at a time from the curser position.

    >>
    >> 1+2 can be done in the device driver (but make sense only in cooked
    >> mode, look there in the tty driver code and consider what "normal"
    >> backspace does there). 3 doesn't seem to make sense being done in the
    >> device driver. Are you sure you're repeating your requirements /
    >> instructions correctly? Again it would help to get a bit more
    >> context, like exactly what you achieve or the exact wording of your
    >> homework (and admitting that it's homework would spare us trying to
    >> suggest alternative solutions for a technical problem).
    >>
    >> Regards -- Markus

    >
    > Yeah.. it's a homework, and these are the requirements as given
    > exactly.. lol.. I think i know how to delete a word.. but how do i


    OK. I assume for a moment we're really talking about something that
    should happen in the terminal driver (IMHO you can't usefully do (3)
    in the tty driver, but never mind for a moment).

    As you might no, the tty drive has 2 modes, cooked and raw (look it up
    in OSDI if you don't know). Input editing is only happening in cooked
    mode. Now might remember that backspace or ^H (or whatever key is set
    to do this work) already does a very similar task: Deleting the last
    character from screen and from the input buffer. I think you can
    duplicate without effort exactly this piece of code and make it delete
    a complete word (again at the same time form the input buffer and from
    the screen).

    As far as restoring words goes: You could maintain additional buffers
    in the tty driver, but I think the easiest thing would be to just
    maintain 3 pointers in the already existing buffer:

    [this word got ........deleted]
    ^ ^
    A B

    A is the already existing pointer for newly entered characters into
    the input biffer, B would be the deltion pointer: You delete and save
    "deleted" stuff by moving it upwards at the upper end of the
    buffer. Of course you now have to modfiy every place where A is being
    adjusted, so, dependend on how nice the existing code is, you can also
    maintain 2 buffers.


    > delete just 3 words at max by pressing the special key and how do i
    > restore the three words after the delete by pressing the same key?
    > it's very confusing..


    Restoring is just another instance of input editing, using the save
    content from the last deletion operations. Just add another special
    editing key.

    So, now about (3) -- file name completion: That would require that the
    terminal driver queries the working directory of the process calling
    the driver and the talk to the file system. Apart from the fact that
    the tty-driver is called in turn by the filesystem (I see a potential
    for dead locking here) that sounds like a rather messy solution. At
    first glance (I might be wrong) it doesn't seem to work well together
    with a micro kernel architecture (where, IMHO, the terminal driver
    should be a s agnostic of processes and a file system as possible)

    So I wondered wether you're really, verbatimely required to "modify
    the appropriate device drivers". (3) is usually done as a part of
    shell (which as you know is just another process, taking input from
    the shell): The shell has a special procedure for getting input from
    the user, which in this case must (?) work the terminal in raw mode,
    collects key presses in a buffer and when the user presses the enter
    key, returns.

    You see, (3) is best done in user space in my opinion, since the
    process knows its own working directory best (and probably also wether
    it is useful to complete a name as a file at that point: Studying the
    bash completion can give one a number of useful thoughts, since one
    woul perhaps also want to get the domain specific quoting right (sh
    needs other quoting than csh, than ...). (3) is a mess and can hardly
    be gotten right except in a very restricted way.

    (1+2) can also be done in userspace and usually are, so I keep
    wondering. But if your requirements say "device driver" there is
    probably no use arguing about it.

    > BTW, i didn't understand what u meant by just the shell.. or as a
    > whole. kindly help me!


    Please keep that sound of desperation out of you voice. For one thing
    you weren't very honest in your first post, so I there still is (and
    in my mind will always be) some doubt wether it's really so
    urgent.

    Second, whereas I would see good reason to help another fellow
    hobbyist, researcher or teacher, I find it somewhat annoying to give
    you the support you're probably not getting from your teachers. They
    get paid for it, either don't do their duty, you don't ask them enough
    or you're just not up to the course you booked. In either case I don't
    see a reason why I should be obligated to bother. If what you write is
    interesting to me you get hints. Hopefully also from others (and don't
    you have fellow students, man?). But begging somehow repulses me. And
    I've had enough students "of my own" that didn't really want to know,
    only to pass.

    To me you sound like the wrong person in the wrong course: If you
    don't know about the distinction between driver and user space you
    should never have gotten this homework and certainly need more help
    and better counselling than anyone can give at a newsgroup: Either you
    missed some prerequisite / prerequisite course or there is something
    wrong with your curriculum. That can only be solved within your
    university / college by individual negotiation and agreement of an
    individual solution. If those are out of question (but what college
    would that be, I wonder?), than the only generic advice can (in my
    opinion) be: Give it up. You sound to me like someone very far removed
    from those topics and need, I think, some professional advice on this.

    Sorry for preaching.

    Regards -- Markus


+ Reply to Thread