This codepiece is taken from GazOS:
"lgdtl (loadgdt) \n" /* Load our own GDT */
"movw $0x10,%%ax \n" /* Init data registers with flat_data */
"movw %%ax,%%ds \n"
"movw %%ax,%%es \n"
"movw %%ax,%%fs \n"
"movw %%ax,%%gs \n"
"movw %%ax,%%ss \n" /* ... and the stack, too */
I don't understand what 0x10 means here, the GDT
has only three entries ...
Thanks in advance,
The Legend
Why 0x10?
RE:Why 0x10?
>On 2002-04-14 07:45:08, The Legend wrote:
>This codepiece is taken from GazOS:
>
>"lgdtl (loadgdt) \n" /* Load our own GDT */
>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>"movw %%ax,%%ds \n"
>"movw %%ax,%%es \n"
>"movw %%ax,%%fs \n"
>"movw %%ax,%%gs \n"
>"movw %%ax,%%ss \n" /* ... and the stack, too */
>
>I don't understand what 0x10 means here, the GDT
>has only three entries ...
>
>Thanks in advance,
>The Legend
Each entry is 8 bytes long so :
offset 0x00 in GTD : null descriptor
offset 0x08 in GTD : code segment
offset 0x10( = 16 decimal) in GTD : data segment
>This codepiece is taken from GazOS:
>
>"lgdtl (loadgdt) \n" /* Load our own GDT */
>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>"movw %%ax,%%ds \n"
>"movw %%ax,%%es \n"
>"movw %%ax,%%fs \n"
>"movw %%ax,%%gs \n"
>"movw %%ax,%%ss \n" /* ... and the stack, too */
>
>I don't understand what 0x10 means here, the GDT
>has only three entries ...
>
>Thanks in advance,
>The Legend
Each entry is 8 bytes long so :
offset 0x00 in GTD : null descriptor
offset 0x08 in GTD : code segment
offset 0x10( = 16 decimal) in GTD : data segment
RE:Why 0x10?
>On 2002-04-14 08:04:18, Gertfaller wrote:
>>On 2002-04-14 07:45:08, The Legend wrote:
>>This codepiece is taken from GazOS:
>>
>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>"movw %%ax,%%ds \n"
>>"movw %%ax,%%es \n"
>>"movw %%ax,%%fs \n"
>>"movw %%ax,%%gs \n"
>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>
>>I don't understand what 0x10 means here, the GDT
>>has only three entries ...
>>
>>Thanks in advance,
>>The Legend
>
>Each entry is 8 bytes long so :
>offset 0x00 in GTD : null descriptor
>offset 0x08 in GTD : code segment
>offset 0x10( = 16 decimal) in GTD : data segment
Oh, thanks
>>On 2002-04-14 07:45:08, The Legend wrote:
>>This codepiece is taken from GazOS:
>>
>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>"movw %%ax,%%ds \n"
>>"movw %%ax,%%es \n"
>>"movw %%ax,%%fs \n"
>>"movw %%ax,%%gs \n"
>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>
>>I don't understand what 0x10 means here, the GDT
>>has only three entries ...
>>
>>Thanks in advance,
>>The Legend
>
>Each entry is 8 bytes long so :
>offset 0x00 in GTD : null descriptor
>offset 0x08 in GTD : code segment
>offset 0x10( = 16 decimal) in GTD : data segment
Oh, thanks
RE:Why 0x10? (another small question)
>On 2002-04-14 08:04:18, Gertfaller wrote:
>>On 2002-04-14 07:45:08, The Legend wrote:
>>This codepiece is taken from GazOS:
>>
>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>"movw %%ax,%%ds \n"
>>"movw %%ax,%%es \n"
>>"movw %%ax,%%fs \n"
>>"movw %%ax,%%gs \n"
>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>
>>I don't understand what 0x10 means here, the GDT
>>has only three entries ...
>>
>>Thanks in advance,
>>The Legend
>
>Each entry is 8 bytes long so :
>offset 0x00 in GTD : null descriptor
>offset 0x08 in GTD : code segment
>offset 0x10( = 16 decimal) in GTD : data segment
And why doesn't this code piece load a value for cs (0x8 then)?
The Legend
>>On 2002-04-14 07:45:08, The Legend wrote:
>>This codepiece is taken from GazOS:
>>
>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>"movw %%ax,%%ds \n"
>>"movw %%ax,%%es \n"
>>"movw %%ax,%%fs \n"
>>"movw %%ax,%%gs \n"
>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>
>>I don't understand what 0x10 means here, the GDT
>>has only three entries ...
>>
>>Thanks in advance,
>>The Legend
>
>Each entry is 8 bytes long so :
>offset 0x00 in GTD : null descriptor
>offset 0x08 in GTD : code segment
>offset 0x10( = 16 decimal) in GTD : data segment
And why doesn't this code piece load a value for cs (0x8 then)?
The Legend
RE:Why 0x10? (another small question)
>On 2002-04-14 10:41:13, The Legend wrote:
>>On 2002-04-14 08:04:18, Gertfaller wrote:
>>>On 2002-04-14 07:45:08, The Legend wrote:
>>>This codepiece is taken from GazOS:
>>>
>>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>>"movw %%ax,%%ds \n"
>>>"movw %%ax,%%es \n"
>>>"movw %%ax,%%fs \n"
>>>"movw %%ax,%%gs \n"
>>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>>
>>>I don't understand what 0x10 means here, the GDT
>>>has only three entries ...
>>>
>>>Thanks in advance,
>>>The Legend
>>
>>Each entry is 8 bytes long so :
>>offset 0x00 in GTD : null descriptor
>>offset 0x08 in GTD : code segment
>>offset 0x10( = 16 decimal) in GTD : data segment
>And why doesn't this code piece load a value for cs (0x8 then)?
>
>The Legend
cs can't de loaded directly.
It is loaded when you jump to the code
to be executed.
Here it's with :
"ljmp $0x08,$next\n"
"nop\n"
"nop\n"
"next: \n" /* Continue here
then cs points to the code segment.
>>On 2002-04-14 08:04:18, Gertfaller wrote:
>>>On 2002-04-14 07:45:08, The Legend wrote:
>>>This codepiece is taken from GazOS:
>>>
>>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>>"movw %%ax,%%ds \n"
>>>"movw %%ax,%%es \n"
>>>"movw %%ax,%%fs \n"
>>>"movw %%ax,%%gs \n"
>>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>>
>>>I don't understand what 0x10 means here, the GDT
>>>has only three entries ...
>>>
>>>Thanks in advance,
>>>The Legend
>>
>>Each entry is 8 bytes long so :
>>offset 0x00 in GTD : null descriptor
>>offset 0x08 in GTD : code segment
>>offset 0x10( = 16 decimal) in GTD : data segment
>And why doesn't this code piece load a value for cs (0x8 then)?
>
>The Legend
cs can't de loaded directly.
It is loaded when you jump to the code
to be executed.
Here it's with :
"ljmp $0x08,$next\n"
"nop\n"
"nop\n"
"next: \n" /* Continue here
then cs points to the code segment.
RE:Why 0x10? (another small question)
>On 2002-04-14 17:33:05, GertFaller wrote:
>>On 2002-04-14 10:41:13, The Legend wrote:
>>>On 2002-04-14 08:04:18, Gertfaller wrote:
>>>>On 2002-04-14 07:45:08, The Legend wrote:
>>>>This codepiece is taken from GazOS:
>>>>
>>>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>>>"movw %%ax,%%ds \n"
>>>>"movw %%ax,%%es \n"
>>>>"movw %%ax,%%fs \n"
>>>>"movw %%ax,%%gs \n"
>>>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>>>
>>>>I don't understand what 0x10 means here, the GDT
>>>>has only three entries ...
>>>>
>>>>Thanks in advance,
>>>>The Legend
>>>
>>>Each entry is 8 bytes long so :
>>>offset 0x00 in GTD : null descriptor
>>>offset 0x08 in GTD : code segment
>>>offset 0x10( = 16 decimal) in GTD : data segment
>>And why doesn't this code piece load a value for cs (0x8 then)?
>>
>>The Legend
>cs can't de loaded directly.
>It is loaded when you jump to the code
>to be executed.
>Here it's with :
>
> "ljmp $0x08,$next\n"
> "nop\n"
> "nop\n"
> "next: \n" /* Continue here
>
>then cs points to the code segment.
>
Okay, thank you!
The Legend
>>On 2002-04-14 10:41:13, The Legend wrote:
>>>On 2002-04-14 08:04:18, Gertfaller wrote:
>>>>On 2002-04-14 07:45:08, The Legend wrote:
>>>>This codepiece is taken from GazOS:
>>>>
>>>>"lgdtl (loadgdt) \n" /* Load our own GDT */
>>>>"movw $0x10,%%ax \n" /* Init data registers with flat_data */
>>>>"movw %%ax,%%ds \n"
>>>>"movw %%ax,%%es \n"
>>>>"movw %%ax,%%fs \n"
>>>>"movw %%ax,%%gs \n"
>>>>"movw %%ax,%%ss \n" /* ... and the stack, too */
>>>>
>>>>I don't understand what 0x10 means here, the GDT
>>>>has only three entries ...
>>>>
>>>>Thanks in advance,
>>>>The Legend
>>>
>>>Each entry is 8 bytes long so :
>>>offset 0x00 in GTD : null descriptor
>>>offset 0x08 in GTD : code segment
>>>offset 0x10( = 16 decimal) in GTD : data segment
>>And why doesn't this code piece load a value for cs (0x8 then)?
>>
>>The Legend
>cs can't de loaded directly.
>It is loaded when you jump to the code
>to be executed.
>Here it's with :
>
> "ljmp $0x08,$next\n"
> "nop\n"
> "nop\n"
> "next: \n" /* Continue here
>
>then cs points to the code segment.
>
Okay, thank you!
The Legend