whats p-mode?? 
Author Message
 whats p-mode??

from what I have heard it means protected mode
and is a different way from accessing memory?
does it use offsets and segs
you can access more memory is that right?
do you use extended regesters ie
eax ebx ecx edx --- are these virtual regesters?
finnally how do i do vga programming in this mode with vidio bios (int
10h, function 13h)


Tue, 10 Dec 2002 03:00:00 GMT  
 whats p-mode??
Quote:
>from what I have heard it means protected mode
>and is a different way from accessing memory?

Yes, addressing is different, but memory is still accessed the same way [except
if you deal with paging, which divides memory by 4k "pages" and in the MBs on
pentiums+].

Quote:
>does it use offsets and segs

It has offsets, but instead of segments, you use a selector. Using segments,
you know what the base address is by seg*10h, therefore, you know that the
memory address you're accessing would be seg*10h + offset. In pmode, selectors
reference a table: either the gdt or ldt, which then gives you the base address
of that selector. The final address would be the base address of the selector
found in the gdt/ldt + offset.

Quote:
>you can access more memory is that right?

Yes.

Quote:
>do you use extended regesters ie
>eax ebx ecx edx --- are these virtual regesters?

You could use them, it's just that they're 32bit, an extra 16 bits. Not
necessarily "virtual".

Quote:
>finnally how do i do vga programming in this mode with vidio bios (int
>10h, function 13h)

For simply entering pmode, you can't, you'll have to write directly to the vga
regs or directly to vga memory, but by enabling some things in pmode you can
get to bios through v86 mode[like real mode under pmode]. You can't use bios
interrupts in pmode because some bioses are written for real mode.

I'm sure someone with more intelligence than me can explain in-depthly what
pmode is if this didn't help.




Tue, 10 Dec 2002 03:00:00 GMT  
 whats p-mode??
Quote:
>from what I have heard it means protected mode

Yes, but there's also a DOS extender with that name.

Quote:
>and is a different way from accessing memory?

Yes, in protected mode, the memory management
is different. Actually the only difference is how segment
values are handled. In Real Mode, the segment value
is multiplied with 16 (10h) and added to the offset.
In Protected mode, the segment value is used as an
index in a 'Segment Descriptor table' which not only
contains the linear start address of the segment
(which could be anything!!), but also some 'protection'
properties, such as 'Read/Execute Only' and Limit.
Also, in protected mode, new types of segments
are defined, e.g. a Task State segment. For system
calls and other privileged routines, call gates and
interrupt gates can be defined.

Quote:
>does it use offsets and segs

Yes, just like Real Mode. But be aware that in proteced
mode segment values have no direct relationship with
the linear start address of the segment.
A

Quote:
>you can access more memory is that right?

That depends on the CPU, but usually, yes. On
a 80286, the only way to address a location
above 1MB (+64KB) is to use the 24-bit segment
base field found in the segment descriptors.
On a 80386, offsets can be 32-bit, as large as
the address bus.
On the Pentium Pro and above, the address bus
is 36-bit, can only be fully used using segment
descriptors.

Quote:
>do you use extended regesters ie
>eax ebx ecx edx --- are these virtual regesters?

No, these are 32-bit registers found on 80386 and
newer CPU. 16/32 bit has nothing to do with real/protected mode.
You can use them as you please (as long you're sure your program
is running on a 32-bit CPU :-)

Quote:
>finnally how do i do vga programming in this mode with vidio bios (int
>10h, function 13h)

On the 80286, you can't. BIOS code use Real Mode addressing (assumes
Real Mode segment handling), and will usually generate faults in protected
mode. The only way for a 80286 to get back to Real Mode is to reset the
CPU. IBM used a trick in their BIOS, the BIOS will jump directly to a
'return'
address after a reset when a certain BIOS variable is set with a specific
value.
On the 80386 and above, switching back to real mode is possible. But
the 80386 has another feature: Virtual 8086 task. Using this specific
task, you can emulate 8086 (real mode) addressing without leaving
protected mode. Ideal for calling DOS/BIOS routines and emulating
DOS programs.

Oh, the 80386 and above have more features, incl. a paging unit
and I/O access fields in task segments, which adds easier
virtual memory management and addtional protection.

H



Wed, 11 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pmode in real mode

2. Pmode in real mode

3. VGA mode change from Pmode??

4. PMode vs Real Mode

5. Emulating real-mode interrupts in pmode

6. Using the real-mode IDT in pmode. :)

7. Pmode interupts and real mode

8. PMODE by Tran - CALL REAL MODE INTERRUPT BUG ?!?

9. Protected mode memory management (PMODE)

10. Pmode switching - pmode.asm (0/1)

11. Pmode switching - pmode.asm (0/1)

12. Real Mode vs. Protected Mode

 

 
Powered by phpBB® Forum Software