Code/data segments
Posted: Tue Jul 06, 2004 5:47 pm
Honestly Im a bit confused...I read in the Intel manual that you need at last two segments(Protected Mode).
And a tutorial said that you need the code segment where instructions are being stored, and a data segment where variables will be stored. But I dont get it, do I need
to store my variabels in a special segment and my code in another? How do I do this?
I got a working kernel, and I havent think about this. Will all my variables be
stored in the data segment automaticlly? I thought variables are stored "in the
program", or at least in the end of it.
OR is it just that when the processor gets an instruction that requires a variable, e.g. on adress 0x10, it will start to check from the data segment?s base adress for the variabel?
And a tutorial said that you need the code segment where instructions are being stored, and a data segment where variables will be stored. But I dont get it, do I need
to store my variabels in a special segment and my code in another? How do I do this?
I got a working kernel, and I havent think about this. Will all my variables be
stored in the data segment automaticlly? I thought variables are stored "in the
program", or at least in the end of it.
OR is it just that when the processor gets an instruction that requires a variable, e.g. on adress 0x10, it will start to check from the data segment?s base adress for the variabel?