RE: [suse-programming-e] Hardware access to RAM

If I have a pointer pointing to address 256 and then look at address 257, by how many BYTES have I jumped in physical memory?
2
2? are you sure? It would be two in an old fashioned 16 bit machine with a 16 bit databus; but this is a 64 bit machine and the original definition of a word was a hardware word (not a Bill Gates 16 bit thingy.)
Woops, I saw the numbers 256 and 258. I meant 1.
With Linux, both addresses 256 and 257 lie in the same page (each 4096 bytes). All the bytes within a single page maps to a single physical page frame of the same size. ah! this is one of the ideas I seek: is address 256 pointing to byte number 256-1 = 255, and 257 pointing to the very next character in the string or: byte number 8 x 256 -1 = 2096-1 and 257 to 8 x 257 - 1 = last plus 8 bytes because the memory is 64 bit (8 byte) ?
The address 256 IS the address of the 256'th (zero offset) byte. So the address 256 is byte number 256, and the address 257 is the next byte. Regards, Håkon Hallingstad Software Developer, EDB +47 2252 8218 hakon.hallingstad@edb.com www.edb.com "IT er ikke alt - men det hjelper"
participants (1)
-
Hallingstad Håkon