understand...)
I have a doubt about IBM PC and compatibles... I know that the memory area
between 640KB and 1MB is reserved by firmwares, video RAM, video ROM... but I
really don't understand how all this works!
For example:
if I write a byte to memory location 0xB8000 (video RAM in TEXT mode)
what happens?
1. The CPU writes the byte in RAM and then the Video Card reads from
RAM?
2. The CPU sends the byte to the Video Card directly?
And in the second case how it works? Who "decides" if a byte must go to RAM or
elsewhere?
Another question is derived from a test (in my stupid kernel: protected mode), I
see that the reserved memory area which I was talking about (excluding the
video RAM for text mode) turns out to be READ-ONLY! How this can happens?
Here there is the C code that I've used for the test:
static void test_memory(void)
{
long flags;
volatile unsigned char *mem = (unsigned char*)0xa0000;
const unsigned char *stop = (unsigned char*)0x100000;
unsigned char a, b;
char old_w=1, w; /* is writable? */
for (; mem<=stop; mem++) {
a = *mem;
*mem = b = ~a;
if (*mem == b)
w = 1;
else
w = 0;
switch (old_w) {
case 1:
if (!w) {
printk("Start of ROM at 0x%x\n", mem);
}
break;
case 0:
if (w) {
printk("End of ROM at 0x%x\n", mem);
}
}
if (w)
*mem = a;
old_w = w;
}
}
And here there is the OUTPUT (tested on three PC):
Start of ROM at 0xa0000
End of ROM at 0xb8000
Start of ROM at 0xc0000
End of ROM at 0x100000
Can anyone explain this these things?
Or can anyone say me where to find these informations?
Bye,
Paolo
PS = How is my English?
