protected mode - Linux

This is a discussion on protected mode - Linux ; Hi! Would someone please help me understand this piece of code which I found online: http://ringzero.free.fr/os/protected%20mode/Pm/PM9.ASM First of all, I think it doesn't work the way it should, because when you run it (needs to be run under dos with ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: protected mode

  1. protected mode

    Hi!
    Would someone please help me understand this piece of code which I
    found online:
    http://ringzero.free.fr/os/protected%20mode/Pm/PM9.ASM
    First of all, I think it doesn't work the way it should, because when
    you run it (needs to be run under dos with himem disabled), you never
    actually get to see the message "(Hello from task 1 )".
    I think that is because the "jmp USER_TSS:0" is never successfully
    executed.
    Also,what I don't really understand is why the processor is first
    switched to ring3 before doing the jump to task 1. Why can't the jump
    to task 1 be done directly from ring 0??
    And the last point that I dont get is the following: the task selector
    USER_TSS is defined as "USER_TSS equ $-gdt"
    Now, imagine the gdt was at position 0 in memory..then USER_TSS in this
    case would be at position 48..whereas "actually" it should be 6 because
    it is the 6th selector in the gdt and as far as I know, the offset is
    later multiplied by the size of the descriptor..see what I mean? Also,
    as far as I understand, the last three bits in a selector are not for
    the offset but for the selector pl and I dont see where these are set
    in this code...Does anyone understnad what i mean?
    Can you please tell me what needs to be changed here in order to run
    this the way it should?
    Thanx very much!
    Martin


  2. Re: protected mode

    "sancho1980" writes:

    > (needs to be run under dos with himem disabled)


    Methinks a Linux kernel newsgroup might be the wrong place to ask.

    --
    Måns Rullgård
    mru@inprovide.com

+ Reply to Thread