Making driver for Linux in Java?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tux

    Making driver for Linux in Java?

    Is it possible and does someone try to make driver
    for Linux in Java, for some USB device?
    Could Java do that ?
    I saw jUSB package but it seems that works only with the
    devices which Linux already see.
  • Jared Dykstra

    #2
    Re: Making driver for Linux in Java?

    Tux <mario_zupan@in et.hr> wrote in message news:<bum9ec$fl [email protected] .hr>...[color=blue]
    > Is it possible and does someone try to make driver
    > for Linux in Java, for some USB device?
    > Could Java do that ?
    > I saw jUSB package but it seems that works only with the
    > devices which Linux already see.[/color]


    The short answer is no. ...well kinda. Consider these two factors:

    * It doesn't make sense to make a driver in a high-level language
    (like Java) unless the rest of the system is also a high level
    language so it can easily interface to the driver.

    * Java is designed to be hardware-independent. That is reflected in
    the 'write once, run anywhere' mantra. If you write code to interface
    to the hardware directly, you have to write native code. You would
    then have to recompile this native code for each OS and ship the
    correct shared library for others to use it.

    So you could make a native driver for use by other Java apps...but is
    this what you want?

    ---
    Jared Dykstra

    Comment

    • Jared Dykstra

      #3
      Re: Making driver for Linux in Java?

      Tux <mario_zupan@in et.hr> wrote in message news:<bum9ec$fl [email protected] .hr>...[color=blue]
      > Is it possible and does someone try to make driver
      > for Linux in Java, for some USB device?
      > Could Java do that ?
      > I saw jUSB package but it seems that works only with the
      > devices which Linux already see.[/color]


      The short answer is no. ...well kinda. Consider these two factors:

      * It doesn't make sense to make a driver in a high-level language
      (like Java) unless the rest of the system is also a high level
      language so it can easily interface to the driver.

      * Java is designed to be hardware-independent. That is reflected in
      the 'write once, run anywhere' mantra. If you write code to interface
      to the hardware directly, you have to write native code. You would
      then have to recompile this native code for each OS and ship the
      correct shared library for others to use it.

      So you could make a native driver for use by other Java apps...but is
      this what you want?

      ---
      Jared Dykstra

      Comment

      • Mario_5

        #4
        Re: Making driver for Linux in Java?


        "Jared Dykstra" <dyksjare@hotma il.com> wrote in message
        news:ba84b53e.0 401220046.34ed9 [email protected] gle.com...[color=blue]
        > Tux <mario_zupan@in et.hr> wrote in message[/color]
        news:<bum9ec$fl [email protected] .hr>...[color=blue][color=green]
        > > Is it possible and does someone try to make driver
        > > for Linux in Java, for some USB device?
        > > Could Java do that ?
        > > I saw jUSB package but it seems that works only with the
        > > devices which Linux already see.[/color]
        >
        >
        > The short answer is no. ...well kinda. Consider these two factors:
        >
        > * It doesn't make sense to make a driver in a high-level language
        > (like Java) unless the rest of the system is also a high level
        > language so it can easily interface to the driver.
        >
        > * Java is designed to be hardware-independent. That is reflected in
        > the 'write once, run anywhere' mantra. If you write code to interface
        > to the hardware directly, you have to write native code. You would
        > then have to recompile this native code for each OS and ship the
        > correct shared library for others to use it.
        >
        > So you could make a native driver for use by other Java apps...but is
        > this what you want?
        >
        > ---
        > Jared Dykstra
        > http://www.bork.org/~jared[/color]

        OK. It doesn't need to be a driver but can I make Java application
        which reads from USB devices but for that devices driver doesn't exist?
        p.s.
        jUSB package for Java exist but I can't understand can I use it if Linux
        doesn't see my device because there is not proper driver for it.


        Comment

        • Mario_5

          #5
          Re: Making driver for Linux in Java?


          "Jared Dykstra" <dyksjare@hotma il.com> wrote in message
          news:ba84b53e.0 401220046.34ed9 [email protected] gle.com...[color=blue]
          > Tux <mario_zupan@in et.hr> wrote in message[/color]
          news:<bum9ec$fl [email protected] .hr>...[color=blue][color=green]
          > > Is it possible and does someone try to make driver
          > > for Linux in Java, for some USB device?
          > > Could Java do that ?
          > > I saw jUSB package but it seems that works only with the
          > > devices which Linux already see.[/color]
          >
          >
          > The short answer is no. ...well kinda. Consider these two factors:
          >
          > * It doesn't make sense to make a driver in a high-level language
          > (like Java) unless the rest of the system is also a high level
          > language so it can easily interface to the driver.
          >
          > * Java is designed to be hardware-independent. That is reflected in
          > the 'write once, run anywhere' mantra. If you write code to interface
          > to the hardware directly, you have to write native code. You would
          > then have to recompile this native code for each OS and ship the
          > correct shared library for others to use it.
          >
          > So you could make a native driver for use by other Java apps...but is
          > this what you want?
          >
          > ---
          > Jared Dykstra
          > http://www.bork.org/~jared[/color]

          OK. It doesn't need to be a driver but can I make Java application
          which reads from USB devices but for that devices driver doesn't exist?
          p.s.
          jUSB package for Java exist but I can't understand can I use it if Linux
          doesn't see my device because there is not proper driver for it.


          Comment

          • Roman

            #6
            Re: Making driver for Linux in Java?

            You still need to have the driver installed and loaded by the Linux kernel,
            then you could write a piece of code in C that can interact with the dirver
            through the datastructs. This C library then will need to implement the JNI
            interface that allows C code to interface with Java applications this is how
            you can gain access to the data being sent by the USB deivce and be able to
            send data to that USB device.

            Roman.
            [color=blue]
            > OK. It doesn't need to be a driver but can I make Java application
            > which reads from USB devices but for that devices driver doesn't exist?
            > p.s.
            > jUSB package for Java exist but I can't understand can I use it if Linux
            > doesn't see my device because there is not proper driver for it.
            >
            >[/color]


            Comment

            • Roman

              #7
              Re: Making driver for Linux in Java?

              You still need to have the driver installed and loaded by the Linux kernel,
              then you could write a piece of code in C that can interact with the dirver
              through the datastructs. This C library then will need to implement the JNI
              interface that allows C code to interface with Java applications this is how
              you can gain access to the data being sent by the USB deivce and be able to
              send data to that USB device.

              Roman.
              [color=blue]
              > OK. It doesn't need to be a driver but can I make Java application
              > which reads from USB devices but for that devices driver doesn't exist?
              > p.s.
              > jUSB package for Java exist but I can't understand can I use it if Linux
              > doesn't see my device because there is not proper driver for it.
              >
              >[/color]


              Comment

              • Mario_5

                #8
                Re: Making driver for Linux in Java?

                Could you please look at http://jusb.sourceforge.net/ and tell me what is a
                procedure to use that package? I think that C-code isn't necessary.
                Which language is usually uses for writing a Linux driver?


                "Roman" <anonuser@shaw. ca> wrote in message
                news:nQJQb.2631 98$ts4.159277@p d7tw3no...[color=blue]
                > You still need to have the driver installed and loaded by the Linux[/color]
                kernel,[color=blue]
                > then you could write a piece of code in C that can interact with the[/color]
                dirver[color=blue]
                > through the datastructs. This C library then will need to implement the[/color]
                JNI[color=blue]
                > interface that allows C code to interface with Java applications this is[/color]
                how[color=blue]
                > you can gain access to the data being sent by the USB deivce and be able[/color]
                to[color=blue]
                > send data to that USB device.
                >
                > Roman.
                >[color=green]
                > > OK. It doesn't need to be a driver but can I make Java application
                > > which reads from USB devices but for that devices driver doesn't exist?
                > > p.s.
                > > jUSB package for Java exist but I can't understand can I use it if Linux
                > > doesn't see my device because there is not proper driver for it.
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Mario_5

                  #9
                  Re: Making driver for Linux in Java?

                  Could you please look at http://jusb.sourceforge.net/ and tell me what is a
                  procedure to use that package? I think that C-code isn't necessary.
                  Which language is usually uses for writing a Linux driver?


                  "Roman" <anonuser@shaw. ca> wrote in message
                  news:nQJQb.2631 98$ts4.159277@p d7tw3no...[color=blue]
                  > You still need to have the driver installed and loaded by the Linux[/color]
                  kernel,[color=blue]
                  > then you could write a piece of code in C that can interact with the[/color]
                  dirver[color=blue]
                  > through the datastructs. This C library then will need to implement the[/color]
                  JNI[color=blue]
                  > interface that allows C code to interface with Java applications this is[/color]
                  how[color=blue]
                  > you can gain access to the data being sent by the USB deivce and be able[/color]
                  to[color=blue]
                  > send data to that USB device.
                  >
                  > Roman.
                  >[color=green]
                  > > OK. It doesn't need to be a driver but can I make Java application
                  > > which reads from USB devices but for that devices driver doesn't exist?
                  > > p.s.
                  > > jUSB package for Java exist but I can't understand can I use it if Linux
                  > > doesn't see my device because there is not proper driver for it.
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  Working...