Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
00241772720e[CPU0 ] interrupt(): gate descriptor is not valid sys seg
00241772720e[CPU0 ] interrupt(): gate descriptor is not valid sys seg
00241772720e[CPU0 ] interrupt(): gate descriptor is not valid sys seg
00241772720i[CPU0 ] protected mode
00241772720i[CPU0 ] CS.d_b = 32 bit
00241772720i[CPU0 ] SS.d_b = 32 bit
00241772720i[CPU0 ] | EAX=0010c8a0 EBX=00108000 ECX=0019ae0f EDX=00000000
00241772720i[CPU0 ] | ESP=0019ae08 EBP=0019ae18 ESI=0002be83 EDI=0002be88
00241772720i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df IF tf sf ZF af PF cf
00241772720i[CPU0 ] | SEG selector base limit G D
00241772720i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00241772720i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 000fffff 1 1
00241772720i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00241772720i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00241772720i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00241772720i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00241772720i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00241772720i[CPU0 ] | EIP=00104d9a (00104d9a)
00241772720i[CPU0 ] | CR0=0x00000011 CR1=0 CR2=0x00000000
00241772720i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00241772720i[CPU0 ] >> leave : C9
00241772720e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
I think it may be a problem in my GDT, but I haven't had any trouble up until now. The only reason I can think of that would have caused this is a recent modification to my multitasker, which I took out after this started appearing.
Last edited by pcmattman on Tue Mar 13, 2007 3:55 pm, edited 1 time in total.
Have you considered disabling interrupts when you don't have a functional IDT?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
pcmattman wrote:I think it may be a problem in my GDT, but I haven't had any trouble up until now. The only reason I can think of that would have caused this is a recent modification to my multitasker, which I took out after this started appearing.
This happened to me, when I added the system call interrupt, but the GDT wasn't big enough.
00241772720e[CPU0 ] interrupt(): gate descriptor is not valid sys seg
In itself this is not a problem. Enabling interrupts is on itself not a problem.
However, this combination of circumstances forces the processors to use a broken IDT which will obviously not work.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
void SetClockRate( int hz )
{
int divisor = 1193180 / hz; /* Calculate our divisor */
outportb(0x43, 0x36); /* Set our command byte 0x36 */
outportb(0x40, divisor & 0xFF); /* Set low byte of divisor */
outportb(0x40, divisor >> 8); /* Set high byte of divisor */
}
I have no idea what went wrong there . Either way, I'm still really confused as to why this is happening. There's got to be a way of fixing this... and to think I was so close to beta testing .
At what rate is your RTC? I remember having a problem like that when I tried to get nanoseconds with the RTC and ended up with miliseconds, and I don't remember if the PC locked or it restarted, but it was giving problems, maybe was more than the RTC could handle.
Try commenting out that routine call or use a lower rate; if that doesn't work it should be some change you don't remember having done that you did to test code and was forgotten and now is giving problems.
I commented out changing the clock rate, and I've checked over all of the code of my OS (that's not an easy task, either). All of the test code has been removed.
Hang on a second, I just figured it out! My memset, memcpy etc... functions disable interrupts before they start. Afterwards, they enable them again! I think I did this because my GUI was halting during mem* function calls, which may instead be a problem with the multitasker and not the calls.
Edit: fixed the problem, took out the interrupt stuff in mem* functions and replaced it with disabling and enabling multitasking. Everything works properly now...
I just found a good use for this: whenever I need to restart the computer, I just enable interrupts (just in case they weren't already) and then do this:
Write a pair of functions, one of which disables interrupts, and returns 1 if interrupts where enabled, 0 if not. The other takes one arguments, and enables interrupts if the argument is true.