Hacker News new | ask | show | jobs
by lainproliant 973 days ago
This was a lot of fun. Reminded me of one of the earliest C programs I wrote when I was learning to code on Win98, before I really knew how computers worked. I was curious: "What does the rest of RAM look like?"

  #include <stdio.h>
  int main() {
     for (int x = 0;;x++) {
        putc(*(char*)x);
     }
     return 0;
   }
I was mezmerized by the strings from the uncompressed BIOS ROM being dumped back at me, "American Megatrends".. etc. Eventually this process crashes of course, when it runs past the end of mapped memory locations.
3 comments

What's even more fun is the opposite! memset(0, 0, 1 << 20);
You took me to "Now we are done with RAM, let's play with HDD" moment on 80286 when I was a kid.
It was great when virtually everything was mapped 1:1 into "real" memory, even video memory. In those days, everything was a memory address, just like "everything is a file".

Then came the realization you could alter any memory location, and further, you could write a tiny TSR to do things...

That's c++