addresses

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

    addresses

    Are there any functions in c like memcpy perhaps that can return the
    memory address from the address bus for an array of say char name[5] ? This
    would be 40 bits somewhere. Where in memory?

    Bill


  • Ian Collins

    #2
    Re: addresses

    Bill Cunningham wrote:
    Are there any functions in c like memcpy perhaps that can return the
    memory address from the address bus for an array of say char name[5] ? This
    would be 40 bits somewhere. Where in memory?
    >
    C has no such concept. The best you can do is take the address of a
    variable and use that address within the context of the application.
    That address may or may not map directly to a physical address.

    One any virtual memory operating system, obtaining a physical address
    from a virtual address is beyond the scope of standard C.

    --
    Ian Collins.

    Comment

    • Morris Dovey

      #3
      Re: addresses

      Bill Cunningham wrote:
      >
      Are there any functions in c like memcpy perhaps that can return the
      memory address from the address bus for an array of say char name[5] ? This
      would be 40 bits somewhere. Where in memory?
      A pointer is as close as you'll get. For machines with a linear
      address space, the pointer will probably be the memory address -
      but for other architectures (and perhaps some virtual machines)
      the pointer may very not be a unique address.

      --
      Morris Dovey
      DeSoto Solar
      DeSoto, Iowa USA

      Comment

      • Kaz Kylheku

        #4
        Re: addresses

        On Feb 8, 7:37 pm, "Bill Cunningham" <nos...@nspam.c omwrote:
            Are there any functions in c like memcpy perhaps that can return the
        memory address from the address bus for  an array of say char name[5] ? This
        would be 40 bits somewhere. Where in memory?
        When you become qualified to work with this type of information, you
        will distinguish yourself by knowing where to begin looking for it.

        Comment

        • Bill Cunningham

          #5
          Re: addresses

          C has no such concept. The best you can do is take the address of a
          variable and use that address within the context of the application.
          That address may or may not map directly to a physical address.
          >
          One any virtual memory operating system, obtaining a physical address
          from a virtual address is beyond the scope of standard C.
          Perhaps what I'm thinking of is a kernel function and the kernel mapping
          virtual addresses to physical.
          What I'm looking for is probably a probably a return of a virtual
          address in hex.

          Bill


          Comment

          • Bill Cunningham

            #6
            Re: addresses

            A pointer is as close as you'll get. For machines with a linear
            address space, the pointer will probably be the memory address -
            but for other architectures (and perhaps some virtual machines)
            the pointer may very not be a unique address.
            >
            How would you use a pointer?

            Bill


            Comment

            • Ian Collins

              #7
              Re: addresses

              Bill Cunningham wrote:
              >C has no such concept. The best you can do is take the address of a
              >variable and use that address within the context of the application.
              >That address may or may not map directly to a physical address.
              >>
              >One any virtual memory operating system, obtaining a physical address
              >from a virtual address is beyond the scope of standard C.
              >
              Perhaps what I'm thinking of is a kernel function and the kernel mapping
              virtual addresses to physical.
              That would be very platform specific.
              What I'm looking for is probably a probably a return of a virtual
              address in hex.
              >
              I'm not sure you are sure what you are looking for! Why do you want to
              know a physical address? Only a device driver would care. If you want
              to print something in hex, use the printf %x specifier.

              --
              Ian Collins.

              Comment

              • santosh

                #8
                Re: addresses

                Bill Cunningham wrote:
                >A pointer is as close as you'll get. For machines with a linear
                >address space, the pointer will probably be the memory address -
                >but for other architectures (and perhaps some virtual machines)
                >the pointer may very not be a unique address.
                >>
                How would you use a pointer?
                int i, *p = &i;
                *p = 5;

                Why don't you go through a tutorial?

                Comment

                • Bill Cunningham

                  #9
                  Re: addresses


                  "santosh" <santosh.k83@gm ail.comwrote in message
                  news:fojb0d$aup $1@registered.m otzarella.org.. .
                  Bill Cunningham wrote:
                  >
                  >>A pointer is as close as you'll get. For machines with a linear
                  >>address space, the pointer will probably be the memory address -
                  >>but for other architectures (and perhaps some virtual machines)
                  >>the pointer may very not be a unique address.
                  >>>
                  > How would you use a pointer?
                  >
                  int i, *p = &i;
                  *p = 5;
                  >
                  Why don't you go through a tutorial?
                  I see what you're doing here. But I don't think it's what I'm looking
                  for.


                  Comment

                  • Bill Cunningham

                    #10
                    Re: addresses


                    "Ian Collins" <ian-news@hotmail.co mwrote in message
                    news:614m8nF1rf 19cU15@mid.indi vidual.net...
                    Bill Cunningham wrote:
                    > Are there any functions in c like memcpy perhaps that can return the
                    >memory address from the address bus for an array of say char name[5] ?
                    >This
                    >would be 40 bits somewhere. Where in memory?
                    >>
                    C has no such concept. The best you can do is take the address of a
                    variable and use that address within the context of the application.
                    That address may or may not map directly to a physical address.
                    >
                    One any virtual memory operating system, obtaining a physical address
                    from a virtual address is beyond the scope of standard C.
                    It looks that way.


                    Comment

                    • Bill Cunningham

                      #11
                      Re: addresses

                      One any virtual memory operating system, obtaining a physical address
                      from a virtual address is beyond the scope of standard C.
                      >
                      Ok all I need to know.

                      Bill


                      Comment

                      • Bart

                        #12
                        Re: addresses

                        On Feb 9, 5:24 pm, "Bill Cunningham" <nos...@nspam.c omwrote:
                        One any virtual memory operating system, obtaining a physical address
                        from a virtual address is beyond the scope of standard C.
                        >
                            Ok all I need to know.
                        I doubt the physical address would be very useful to you. For one
                        thing, the physical memory of your task may not be contiguous. And I
                        think it's likely to keep changing anyway.


                        --
                        Bart

                        Comment

                        • Mark McIntyre

                          #13
                          Re: addresses

                          Randy Howard wrote:
                          On Sat, 9 Feb 2008 10:58:58 -0600, Joe Wright wrote
                          (in article <bPidnWOPA_JPRj DanZ2dnUVZ_gWdn Z2d@comcast.com >):
                          >
                          >I am convinced that Bill is not a troll and is using C and Usenet as
                          >part of his therapy.
                          >
                          It could also be that he has discovered that relying on political
                          correctness to override common sense is a proven tactic.
                          Possibly. But the nature of his questions and answers doesn't seem to be
                          trollish to me. He rarely challenges accepted beliefs for the sake of
                          it, and generally stays in the debate.

                          --
                          Mark McIntyre

                          CLC FAQ <http://c-faq.com/>
                          CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

                          Comment

                          • Kaz Kylheku

                            #14
                            Re: addresses

                            On Feb 9, 1:24 pm, "Serve Laurijssen" <n...@hao.comwr ote:
                            Yeah Billy is cool :))
                            A big smile comes on my face when I see a thread made by Bill. Thanks! <3
                            Billy ``back issues'' are funny. Just don't get sucked in, that's all.

                            Check out message ID <q0uPe.6561$WO2 .1018@fe06.lga>


                            Comment

                            Working...