Hardware

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

    #1

    Hardware

    Hi everyone,

    I need to ask a rather simple question so please bear with me
    as I tried to search on google but could not come up with anything.

    You see i wish to control the pc's hardware via
    usb, parallel and serial ports and pci cards

    Is there any tutorial out there that can help to do hardware programming
    on the pc with C/C++.

    Thank You

    Yours Sincerely

    Richard West

  • loufoque

    #2
    Re: Hardware

    freesoft_2000 a écrit :
    [color=blue]
    > Is there any tutorial out there that can help to do hardware programming
    > on the pc with C/C++.[/color]

    You will need to state your Operating System.

    Comment

    • Victor Bazarov

      #3
      Re: Hardware

      freesoft_2000 wrote:[color=blue]
      > I need to ask a rather simple question so please bear with me
      > as I tried to search on google but could not come up with anything.[/color]

      Try 'alt.internet.s earch-engines', they might be able to help.
      [color=blue]
      > You see i wish to control the pc's hardware via
      > usb, parallel and serial ports and pci cards
      >
      > Is there any tutorial out there that can help to do hardware programming
      > on the pc with C/C++.[/color]

      Hardware control is not part of either language. You need to ask about it
      in the newsgroup dedicated to your OS. See FAQ for suggestions where to
      post your OS-specific question.

      V

      Comment

      • freesoft_2000

        #4
        Re: Hardware

        Hi everyone,

        My os is windows but what i am trying to do to create a
        multiplatform C/C++ code that can talk to the hardware on my pc.

        Is there a way this can be achieved

        Richard West

        Comment

        • Victor Bazarov

          #5
          Re: Hardware

          freesoft_2000 wrote:[color=blue]
          > My os is windows but what i am trying to do to create a
          > multiplatform C/C++ code that can talk to the hardware on my pc.
          >
          > Is there a way this can be achieved[/color]

          The only way I know is to use some multi-platform library. See the
          archives for "Available C++ Libraries FAQ" posted here periodically by
          Nikki Locke.

          V

          Comment

          • roberts.noah@gmail.com

            #6
            Re: Hardware


            freesoft_2000 wrote:[color=blue]
            > Hi everyone,
            >
            > My os is windows but what i am trying to do to create a
            > multiplatform C/C++ code that can talk to the hardware on my pc.
            >
            > Is there a way this can be achieved
            >[/color]

            You need a hardware abstraction level above the OS level that is then
            specialized for the different target operating systems. Either build
            it or use someone else's.

            Comment

            • Benry

              #7
              Re: Hardware


              freesoft_2000 wrote:[color=blue]
              > Hi everyone,
              >
              > My os is windows but what i am trying to do to create a
              > multiplatform C/C++ code that can talk to the hardware on my pc.
              >
              > Is there a way this can be achieved[/color]

              I know people are going to kill me here...but have you thought about
              using Java? It's easier to write cross platform.

              What about Python?

              Basically, with c++, there is a lot more testing that you have to do,
              and preprocessor directives that are very fun to mess with. With java,
              it's compilied down into smaller code, which is the run on a specific
              platform by the Virtual Machine. .NET is similar, but .NET is only
              available for Windows right now.

              BURN HIM (me) AT THE STAKE!

              Comment

              • Ben Pope

                #8
                Re: Hardware

                Benry wrote:[color=blue]
                > freesoft_2000 wrote:[color=green]
                >> Hi everyone,
                >>
                >> My os is windows but what i am trying to do to create a
                >> multiplatform C/C++ code that can talk to the hardware on my pc.
                >>
                >> Is there a way this can be achieved[/color]
                >
                > I know people are going to kill me here...but have you thought about
                > using Java? It's easier to write cross platform.[/color]

                I didn't realise Java had cross platform APIs for access to PCI cards,
                USB, parallel and serial ports.
                [color=blue]
                > What about Python?[/color]

                What about it?
                [color=blue]
                > Basically, with c++, there is a lot more testing that you have to do,
                > and preprocessor directives that are very fun to mess with. With java,
                > it's compilied down into smaller code, which is the run on a specific
                > platform by the Virtual Machine. .NET is similar, but .NET is only
                > available for Windows right now.[/color]

                See Mono.
                [color=blue]
                > BURN HIM (me) AT THE STAKE![/color]

                /me gets matches.

                Ben Pope
                --
                I'm not just a number. To many, I'm known as a string...

                Comment

                • Pete C

                  #9
                  Re: Hardware

                  freesoft_2000 wrote:[color=blue]
                  > My os is windows but what i am trying to do to create a
                  > multiplatform C/C++ code that can talk to the hardware on my pc.[/color]

                  You are asking for a cross-platform device driver for many different
                  types of device at once - that's just not feasible. And besides,
                  talking to the hardware is what the OS is for. Some libraries exist to
                  let you use certain categories of device in a portable way (OpenAL for
                  audio devices, SDL for video cards, you might even say PostScript for
                  printers), but you're not going to find one library that lets you drive
                  a both a USB bar code scanner and a joystick via the same API in a
                  cross-platform manner. If you want to write one, good luck to you.

                  Was that really the question you were asking?

                  Comment

                  • Benry

                    #10
                    Re: Hardware


                    Ben Pope wrote:[color=blue]
                    > Benry wrote:[color=green]
                    > > freesoft_2000 wrote:[color=darkred]
                    > >> Hi everyone,
                    > >>
                    > >> My os is windows but what i am trying to do to create a
                    > >> multiplatform C/C++ code that can talk to the hardware on my pc.
                    > >>
                    > >> Is there a way this can be achieved[/color]
                    > >
                    > > I know people are going to kill me here...but have you thought about
                    > > using Java? It's easier to write cross platform.[/color]
                    >
                    > I didn't realise Java had cross platform APIs for access to PCI cards,
                    > USB, parallel and serial ports.[/color]

                    Yeah, I was more concerned about the cross platform rather than the
                    drivers aspect. I guess those are pretty specific. I guess it would
                    be much easier in C since Java doesn't have the libraries yet.
                    [color=blue][color=green]
                    > > What about Python?[/color]
                    >
                    > What about it?[/color]

                    Again, just touching up on the 50% of this question that caught my
                    attention.
                    [color=blue][color=green]
                    > > Basically, with c++, there is a lot more testing that you have to do,
                    > > and preprocessor directives that are very fun to mess with. With java,
                    > > it's compilied down into smaller code, which is the run on a specific
                    > > platform by the Virtual Machine. .NET is similar, but .NET is only
                    > > available for Windows right now.[/color]
                    >
                    > See Mono.[/color]

                    done.

                    ben

                    Comment

                    • freesoft_2000

                      #11
                      Re: Hardware

                      Hi everyone,

                      I had always thought that standard C/C++ were both multi
                      platform. Correct me if i am wrong.
                      [color=blue]
                      >Was that really the question you were asking?[/color]

                      Its about 90% of the question i was asking. I need to know how to access
                      USB, parallel and serial ports as well as pci cards in a multiplatform
                      way.\

                      I tried checking java and it seems that they have released a java library
                      to communicate with both serial and parallel ports only but it seems to be
                      very unstable.

                      By the way is there any free ebook or articles on accessing hardware using
                      C/C++. I tried to search on google but came up empty. If someone has any
                      links i would really appreciate it

                      Any help is greatly appreciated

                      Thank You

                      Yours Sincerely

                      Richard West

                      Comment

                      • Benry

                        #12
                        Re: Hardware

                        [color=blue]
                        > I had always thought that standard C/C++ were both multi
                        > platform. Correct me if i am wrong.[/color]

                        The language is, but the compiliers must be in place, and are different
                        for your OS and architecture. Also, different platforms require
                        different methods of accessing I/O's.
                        [color=blue]
                        > By the way is there any free ebook or articles on accessing hardware using
                        > C/C++. I tried to search on google but came up empty. If someone has any
                        > links i would really appreciate it[/color]

                        Try searching for "Writing .DLLs", look for your platform and
                        architecture's register maps. You'll probably find the best
                        information this way.

                        Actually, I found this with a quick search on Google:


                        I know USB works differently, so you might want to research how USB
                        works with your OS to get a feeling for what your real goals are. The
                        reason someone asked "is this your real question" is because there are
                        a lot of levels. You can just do this:
                        printf(USB_PORT , "Hello External World!");

                        Unless you first know what USB_PORT is. Good luck, I would be
                        interested in using or hearing your results!

                        -ben

                        Comment

                        Working...