Page 2 of 2

Re: How to enter user mode?

Posted: Mon May 20, 2013 6:38 am
by halofreak1990
gabemaiberger wrote:I have the code to switch to user mode ready. However, I have one problem: (I know I already asked but...) I would like to know what the TSS structure:

Code: Select all

<snip>
looks like in nasm syntax with db, dw, dd and dq preferably.
somewhat like this:

Code: Select all

struc TSS
    .prevTss    resd 1
    .esp0       resd 1
    .ss0        resd 1
    .esp1       resd 1
    .ss1        resd 1
    .esp2       resd 1
    .ss2        resd 1
    .cr3        resd 1
    .eip        resd 1
    .eflags     resd 1
    .eax        resd 1
    .ecx        resd 1
    .edx        resd 1
    .ebx        resd 1
    .esp        resd 1
    .ebp        resd 1
    .esi        resd 1
    .edi        resd 1
    .es         resd 1
    .cs         resd 1
    .ss         resd 1
    .ds         resd 1
    .fs         resd 1
    .gs         resd 1
    .ldt        resd 1
    .trap       resw 1
    .iomap      resw 1
endstruc

Re: How to enter user mode?

Posted: Mon May 20, 2013 10:24 am
by Combuster
gabemaiberger wrote:I have the code to switch to user mode ready. However, I have one problem: (I know I already asked but...) I would like to know what the TSS structure:

Code: Select all

(...)
looks like in nasm syntax with db, dw, dd and dq preferably.
An excellent homework question! Practice reading manuals ;)