Loading ...
Sorry, an error occurred while loading the content.

Physical Memory Scan

Expand Messages
  • Kasi Kalidindi
    Hi all, I want to have a routine that just scans the physical memory from location 0x000000 to 0xfffff based on the RAM size. I implemented it using /dev/mem
    Message 1 of 12 , Sep 30, 2004
    • 0 Attachment
      Hi all,

      I want to have a routine that just scans the physical memory from
      location 0x000000 to 0xfffff based on the RAM size. I implemented it
      using /dev/mem as shown below:

      read_mem_linux()
      {
      int mem_fd, ret;
      char var_char[4];
      char *charp;
      int count = 0;

      if((mem_fd = open("/dev/mem",O_RDONLY)) < 0){
      printf("\n\nProblem in opening /dev/mem");
      exit(-1);
      }
      ret = 1;
      charp = (char *)malloc(sizeof(char) * 1024 * 1024);
      while(ret != 0){
      ret = read(mem_fd, charp,sizeof(char) * 1024 *1024);
      printf("\nret:%d",ret);
      if (ret > 0)
      count++;
      }
      printf("\nMemory Read:%d MB",count);
      }


      My systems is having 2GB of RAM. But this routine is reading only the
      first MB of data and then returns BAD ADDRESS continuously.

      Can anybody help how to over come this problem so that i can read the
      whole memory.

      Thanks in advance,
      Kasi.
    • Lloyd Hayes
      I ll through my 2 cents in here, for what it s worth. I m also a Newbie, so take it as such. I ve been playing with the various distros on older laptops. I ve
      Message 2 of 12 , Oct 3, 2004
      • 0 Attachment
        I'll through my 2 cents in here, for what it's worth. I'm also a
        Newbie, so take it as such.

        I've been playing with the various distros on older laptops. I've
        found Red Hat to be the best distribution out of the box for a laptop.
        Fedora 2 on boxes with more then 256 MB memory.

        However, if you want to really play, and you don't want to drop off
        the deep edge with FreeBSD, then try Debian "Sarge", the "Testing"
        version. It comes with 14 Cds. It's a lot friendlier then most
        distributions, and you get EVERYTHING!

        One thing that I've found missing from most distributions was APM and
        SCSI support in the same kernel. The same holds true for Debian.
        FreeBSD, Red Hat 9, and Fedora (any version) are the only ones that
        seem to include APM and SCSI support out of the box on the same
        kernel. For some reason, people think of laptops as PDAs which plugs
        into desktops and corporate computers. They don't think about all of
        those external hard drives, scanners, CD burners, etc, which plugs
        into the laptop. (I have each of these.)

        I haven't tried Mandrake, so I can't say anything about it. But I was
        surprised that SUSE dropped SCSI support on kernels with APM on
        version 9.1.

        Yes, I know that you can roll your own kernal. But as a newbie, I'm
        still working up to it. It's on my list of things to do....

        (I think that I've gotten on my soapbox and started to ramble
        again...)

        Lloyd Hayes
      Your message has been successfully submitted and would be delivered to recipients shortly.