[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]Register Based VM's Q.
From: |
Scott Lanham |
Subject: |
Re: [DotGNU]Register Based VM's Q. |
Date: |
Tue, 14 Aug 2001 20:58:24 +0000 |
So is a VM assumed to have a flat memory space?
The reason I ask this is that, as an example and from my understanding, 386
et.al protected mode allows for the isolation of tasks to their own memory
space and putting an abitrary pointer in a register then dereferencing it has
no effect other than to either map the pointer to the tasks own memory space
or cause an exception. Very specific "outside contact" points can be then
defined and the task can only use them if it wants to use system resources.
I guess there must be some issue with using this kind of model with a VM? I
always did like the 386's protection mechanisms :-P
> All examples that I've seen to date use the same
> registers for storing both integer and pointer quantities.
> When this happens, it becomes possible to put an
> arbitrary integer value in a register, and then dereference
> it as a pointer. Presto, chango: we've just accessed
> memory that we shouldn't have.
>
> Theoretically, I suppose it would be possible to build
> a typed register-based VM. However, you still have
> problems with RTL: it sort of assumes that integers
> and pointers are interchangeable. The "Pmode" register
> type is typically #define'd to either "SImode" (int)
> or "DImode" (double int). I don't think anyone has
> yet tried defining "Pmode" to be something else.
>
> Cheers,
>
> Rhys.