Re: doubt in protected mode
- From: "SpooK" <keith@xxxxxxxxxxx>
- Date: 22 Nov 2006 08:01:19 -0800
OS wrote:
Hi all,
I have doubt about the memory manager. When i compile any asm
program
*assembly* code gets *assembled* by an *assembler*... not *compiled* by
a *compiler* ;)
1) if the base address for code and data segment is zero and paging is
disabled , which part of memory will the code and data will be copied
Zeroing-out CS/DS is a 16-bit Real Mode concept. In 32-bit Protected
Mode, Segment Selector Registers point to an entry in the GDT, which in
itself specifies how memory is to be accessed. If you did indeed
zero-out CS/DS (and even SS) in 32-bit Protected Mode, you'd probably
run into a GPF due to CS/DS/SS addressing the mandatory "null" entry in
the GDT. Depending on how critical this access is, you could easily
triple-fault the computer.
2) will the content of the data segment in the real mode, copied to the
data segment in the
protected or how to know whether the content of code and data segment
belongs to real or
protected mode,
That is the job of the OS programmer.
3) which part of code segment and data segment will be copied in real
mode and
which part of code and data segment will be copied to protected
mode ? when i executed a
asm program
Redundant question. All-in-all, it sounds like you do not have an
understanding of OS basics. It takes much more than simply setting
registers to have an OS Kernel.
CLI
STI
GDT/GDTR
IDT/IDTR
EOI
TSS
If you don't thoroughly understanding what those acronyms/instructions
are, what they mean and what they do... and you are serious about OS
Dev, then you need to Google for material like Dark Fiber's OS Faq
and/or search sites like osdev.org... get a copy of Intel's processor
docs (PDF) and start reading.
Good luck.
.
- References:
- doubt in protected mode
- From: OS
- doubt in protected mode
- Prev by Date: Re: WhichAsm.html
- Next by Date: Re: doubt in protected mode
- Previous by thread: doubt in protected mode
- Next by thread: Re: doubt in protected mode
- Index(es):
Relevant Pages
|