STI doesn't work [SOLVED]

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.
rdos
Member
Member
Posts: 3329
Joined: Wed Oct 01, 2008 1:55 pm

Re: STI doesn't work

Post by rdos »

I can't see that you reprogram the IRQ bases in the PIC/APIC anywhere. Normally, IR0-7 is at ISR 8-0F while IRQ8-15 is at ISR 78-7F (if I remember it correctly). You seem to assume that IRQs start a 0x20.
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: STI doesn't work

Post by System123 »

Thats the code from brans kernel dev tutorial. I found the cause of the execution never continuing, it is a Stack Fault that keeps occuring and this causes and infinite loop of errors.
rdos wrote:I can't see that you reprogram the IRQ bases in the PIC/APIC anywhere. Normally, IR0-7 is at ISR 8-0F while IRQ8-15 is at ISR 78-7F (if I remember it correctly). You seem to assume that IRQs start a 0x20.
What would the code be to that then? This is my first kernel and all the tutorials I have read just do it that way
Gizmic OS
Currently - Busy with FAT12 driver and VFS
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Re: STI doesn't work

Post by inflater »

it is a Stack Fault that keeps occuring and this causes and infinite loop of errors.
Change your kernel source code that RIGHT on your kernel boot up, set a fixed 16kB stack on a high address and then, don't mess with it anymore. I'm sure that all will work then. :)

BTW if you managed to catch IRQ's from a floppy, keyboard or anything else - your IDT/ISRs and PIC reprogram routines are working correctly.

Regards
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: STI doesn't work

Post by System123 »

Yeah i manage to capture keyboard and timer irqs not sure about floppy because my driver has never run due to this stack fault.. When u say a high address u mean put the stack above the end of my kernel?
Gizmic OS
Currently - Busy with FAT12 driver and VFS
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: STI doesn't work

Post by System123 »

Ok I fixed the stack fault but the kernel still does not load past sti instruction. I can not use bochs debug any more to find the problem as the kernel is running properly in bochs with no unhandled interrupts or faults. Please can someone try run the kernel on their pc and let me know if it working? The bin's and source file link is on page one.

Brans example kernel works perfectly however mine does not. I have used his tutorial to code a Pascal kernel so maybe I made a stupid error somewhere. you wil know the kernel works if it ends on a clear screen with "Gizmic OS" printed at the top.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: STI doesn't work [SOLVED]

Post by System123 »

The problem was a page fault that occurred but due to a small ISR error it never cause the kernel to panic.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Post Reply