jump_protected: gate type 11 unsupported
jump_protected: gate type 11 unsupported
Hi everybody.
Does anyone know what subj means (Bochs error message). I'm trying find bug in tasks, but don't know where start. The sense of this message will help me.
If you have Bochs error message list, please, let me to know or just give a link ( google didn't help me).
Does anyone know what subj means (Bochs error message). I'm trying find bug in tasks, but don't know where start. The sense of this message will help me.
If you have Bochs error message list, please, let me to know or just give a link ( google didn't help me).
Last edited by Igor1024 on Mon May 23, 2011 11:59 pm, edited 1 time in total.
Re: jump_protected: gate type 11 unsupported
Show the code.
If you have seen bad English in my words, tell me what's wrong, please.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: jump_protected: gate type 11 unsupported
It's usually a broken gdt/idt. Other than that: egos +1: there's little more to tell without code and/or memory dumps of the relevant areas.
Re: jump_protected: gate type 11 unsupported
Memory at addresses 109000h-112000h - TSS's area. It has descriptor at GDT and rises no problems. Then there is one TSS, located at 109000h, size>67h. I fill parts of it by
'hi_string' just prints string and ends by iret.
Code: Select all
set_TSS:
push es
mov ax,20h;TSS_area selector;
mov es,ax
xor eax,eax
xor edi,edi
mov cx,26
cld
rep stosd
xor edi,edi
mov eax,cr3
mov ebx,print_hi;function
xor ecx,ecx ;EFLAGS. Can leave it unsaved?
mov edx,500h ;New ESP value
mov [es:di+28],eax;CR3
mov [es:di+32],ebx;EIP
mov [es:di+36],ecx;EFLAGS
mov [es:di+56],edx;ESP
mov al,8h
mov [es:di+76],al;code
mov al,10h
mov [es:di+84],al;ds
pop es
ret
Code: Select all
call set_TSS;prepare structure
mov ax,28h;TSS selector
ltr ax
mov bx,GDT+(8*5)
and byte [es:bx+5],11111101b;clear busy flag
jmp 28h:0;start task execution
Last edited by Igor1024 on Tue May 24, 2011 1:44 am, edited 1 time in total.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: jump_protected: gate type 11 unsupported
Tasks are not reentrant. You are trying to hack your way around the protection that was designed to prevent you from doing stupid things in the first place...;clear busy flag
Re: jump_protected: gate type 11 unsupported
It is usually necesary to do this "hack" when doing software-taskswitching and having one TSS per task. As soon as you load TR with a TSS selector, it would be marked as busy. However, there is no work-around for switching to yourself.Combuster wrote:Tasks are not reentrant. You are trying to hack your way around the protection that was designed to prevent you from doing stupid things in the first place...;clear busy flag
Re: jump_protected: gate type 11 unsupported
What else could have caused error?
About busy flag: I've read that it's set when load TR, but deleting code of unsetting B flag doesn't help;
Error occurs when jump to task; Have no ideas about where made mistake.
About busy flag: I've read that it's set when load TR, but deleting code of unsetting B flag doesn't help;
Error occurs when jump to task; Have no ideas about where made mistake.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: jump_protected: gate type 11 unsupported
No and no. One TSS per task is usually an indication of hardware task switching. If you are modifying busy bits means you plan on changing TR at any point, and therefore perform hardware task switches.rdos wrote:It is usually necesary to do this "hack" when doing software-taskswitching and having one TSS per task.
And even hardware task switching, including cooperative and preemptive scheduling, can be done without repeated toggling of busy bits.
Error occurs when jump to task; Have no ideas about where made mistake.
Tasks are not reentrant
Re: jump_protected: gate type 11 unsupported
You mean that task is executed since ltr? So, when jump to new task #GP is generated because that TSS is taken by another task.
Sorry if I grasp slowly, want sleep very much...
Sorry if I grasp slowly, want sleep very much...
Re: jump_protected: gate type 11 unsupported
TSS descriptor or TSS? Show hardcoded TSS descriptor or how you are initializing it.Then there is one TSS descriptor, located at 109000h
Code: Select all
mov [es:di+28],eax;CR3
mov [es:di+32],ebx;EIP
mov [es:di+36],ecx;EFLAGS
mov [es:di+56],edx;ESP
mov al,8h
mov [es:di+76],al;code
mov al,10h
mov [es:di+84],al;ds
Code: Select all
jmp 28h:0;start task execution
If you use software task switching just set fields for kernel stack pointer and TSS terminator.
The primary task is executed since initial code was started. ltr just validates task environment for multitasking.You mean that task is executed since ltr?
If you have seen bad English in my words, tell me what's wrong, please.
Re: jump_protected: gate type 11 unsupported
To egos:
1)TSS:
2)SS holds nothing. 'Task' doesn't use stack at all.
1)TSS:
Code: Select all
db 0FFh,0FFh,0,90h,10h,89h,8Fh,0;don't care about the limit - code is just example
Re: jump_protected: gate type 11 unsupported
You first load current task with a TSS, then you try to switch to this same TSS, which is not valid.Igor1024 wrote:What else could have caused error?
About busy flag: I've read that it's set when load TR, but deleting code of unsetting B flag doesn't help;
Error occurs when jump to task; Have no ideas about where made mistake.
Re: jump_protected: gate type 11 unsupported
Cool size for TSS: (0FFFFFh+1)*4096Igor1024 wrote:1)TSS:Code: Select all
db 0FFh,0FFh,0,90h,10h,89h,8Fh,0;don't care about the limit - code is just example
Try to use limit 67h and this terminator:
Code: Select all
dw 0,68h
Code: Select all
dw 0,68h
db 0FFh
If you will switch to this task the registers will be loaded automatically including ss. And what's happens when ss will be loaded with NULL selector?Igor1024 wrote:2)SS holds nothing. 'Task' doesn't use stack at all.
If you have seen bad English in my words, tell me what's wrong, please.
Re: jump_protected: gate type 11 unsupported
Not so. Software taskwitching still needs to save registers somewhere, still need IO-permission bitmaps in the TR, as well as stacks for all used rings. There is no reason not to save the registers in the usual TSS-area, and by reloading TR there is no need to patch IO bitmap and stacks on every context switch.Combuster wrote:No and no. One TSS per task is usually an indication of hardware task switching. If you are modifying busy bits means you plan on changing TR at any point, and therefore perform hardware task switches.rdos wrote:It is usually necesary to do this "hack" when doing software-taskswitching and having one TSS per task.
Re: jump_protected: gate type 11 unsupported
I meant the same thing, but my English is far to be perfect.You first load current task with a TSS, then you try to switch to this same TSS, which is not valid.
Yep. Epic mega helloworld Seriously it had normal size; I just experimented with descriptor; I thought the problem is in it;Cool size for TSS: (0FFFFFh+1)*4096
#GP!If you will switch to this task the registers will be loaded automatically including ss. And what's happens when ss will be loaded with NULL selector?Igor1024 wrote:2)SS holds nothing. 'Task' doesn't use stack at all.