Switching to task
Posted: Tue Oct 22, 2013 5:25 pm
Hey, I have succesfully loaded task0 with ltr instruction.
I have also prepared task1, here are parts of code:
my gdt:
1. null
2. program, selector = 8
3. data, selector = 16
4. stack, sel = 24
5. screen, sel=32
6.my extra seg, sel=40
7. tss0, sel=48
8. tss1, sel=56
error:
I have also prepared task1, here are parts of code:
Code: Select all
...
mov word [tss_1+4ch], 8 ; cs
mov word [tss_1+20h], proc_1 ;eip
mov word [tss_1+50h], 24 ;ss
mov word [tss_1+38h], 128 ;esp
mov word [tss_1+54h], 16
mov word [tss_1+48h], 32
cli
;enter PM Mode here
mov ax, 48
ltr ax
call dword 0x00000038 ; selector = 56 for tss1
loopme:
jmp loopme
proc1:
mov ax, 1h
iret
my gdt:
1. null
2. program, selector = 8
3. data, selector = 16
4. stack, sel = 24
5. screen, sel=32
6.my extra seg, sel=40
7. tss0, sel=48
8. tss1, sel=56
error:
What is wrong ? It seems it didnt use my selector 56. Why ?00015175139e[CPU0 ] branch_near32: offset outside of CS limits
00015175139e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00015175139e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)