
Virtual Memory with 256 Bytes of RAM - robertelder
http://blog.robertelder.org/virtual-memory-with-256-bytes-of-ram/
======
robertelder
Hi I'm the author, and I find it surprising that this has received 60 upvotes,
but 0 comments.

I had fun creating this, and might make similar visualizations in the future.
If you have feedback or requests, I would welcome it. I give you permission to
disregard HN's policy on 'gratuitous negativity' as much as I have the
authority to.

~~~
jamesmiller5
I believe it's the opposite of bike shedding, this is a very technical topic
and is well written, there is little to debate :) .

Thank you for writing it, I'm actually doing a little refresher of my computer
architecture coursework now and comparing what I remember to article.

Virtual Memory Explanation -
[https://www.cs.purdue.edu/homes/clifton/cs250/](https://www.cs.purdue.edu/homes/clifton/cs250/)

Virtual Memory Exercise -
[http://webcache.googleusercontent.com/search?q=cache:VFdxPaP...](http://webcache.googleusercontent.com/search?q=cache:VFdxPaP13S0J:https://www.cs.purdue.edu/homes/cs503/lab5/lab5.html+&cd=1&hl=en&ct=clnk&gl=us)

------
userbinator
_Executing Numerical Constants as Code_

It would be better to use bytes, since x86 instructions can be as small as one
byte (e.g. the C3 in 0x55C35D08 and 0x55C3C9D2 is the return instruction, the
last byte of the function, and the 55 is the start of the next one), but this
is basically how a JIT works. If the access permissions are set right (or
nonexistent, as the case may be), you can generate code into a buffer and
execute it directly.

You could explore this further by modifying the 08 in 0x55C35D08 to any signed
byte value (80 to 7F --- -128 to 127), resulting in a "JIT'd" function that
adds that amount to its argument. The actual instruction is the 3 bytes 83 C0
08, which is "add eax, 8". Definitely not portable, but if you're "pseudo-
JITting" pieces of code in your application, you are likely worrying about
other more important things than portability.

(If you work with things like this enough, you start memorising the most
common opcodes and can mentally disassemble hex dumps...)

------
nitrogen
I've only had a few minutes with this so far, but already I'll say the
interactivity is very cool. Being able to edit page table entries and see how
it changes virtual memory is fun. I'll definitely revisit this later for a
closer look and to read more of the explanatory text. How deep/thorough is
this simulation?

Since you asked for specific feedback, I'll suggest trying to find a way to
trick us HNers into learning more of what your simulation actually does,
instead of just looking at the pretty lights. Maybe showing text first and
requiring a click to show the simulation? Or maybe start with a very simple
visualization and a small amount of text to get us hooked, then have a wizard-
like step-by-step interface that introduces more complexity with each step.

Also, maybe flashing red is a bit too distracting :).

Very cool work.

------
0x54MUR41
I love your posts. But, I don't see there is RSS feed so we can subscribe or
put it on RSS reader.

