Page 1 of 1

Help with sti

Posted: Wed Apr 14, 2010 11:52 am
by Sv9toi
I try use asm("sti") and run in qemu.

and if i select my OS in grub all stopped
if I remove asm("sti") all work

Who may help me?

Sorry for my bad English I'm from Russia.

Re: Help with sti

Posted: Wed Apr 14, 2010 12:36 pm
by Coty
STI, re-enables interrupts, are you using it in a place that you need to have interrupts
disabled? If so that could cause a crash and reboot. Also make sure you disable interrupts
before re-enabling them (CLI) other wise the system may crash if they are already
enabled.

Kinda need more information than that. even a snippet code will help of where the code is
going faulty.

Re: Help with sti

Posted: Wed Apr 14, 2010 1:46 pm
by neon
Hello,

When GRUB passes control to your system it is running in protected mode with interrupts disabled. You need to re-initialize the PIC or APIC with your IDT before enabling hardware interrupts (sti).

If these are already set up perhaps posting some code and providing more information can help.

Re: Help with sti

Posted: Wed Apr 14, 2010 5:11 pm
by Owen
Coddy wrote:Also make sure you disable interrupts before re-enabling them (CLI) other wise the system may crash if they are already enabled.
Sorry, but this is patently wrong.

Re: Help with sti

Posted: Wed Apr 14, 2010 6:42 pm
by quanganht
Where did you put you 'sti' ?

Re: Help with sti

Posted: Thu Apr 15, 2010 4:08 am
by jal
Sv9toi wrote:Sorry for my bad English I'm from Russia.
Why do people appologize for their shoddy English, but not for their shoddy knowledge of the subject?


JAL

Re: Help with sti

Posted: Thu Apr 15, 2010 4:40 am
by -m32
jal wrote:
Sv9toi wrote:Sorry for my bad English I'm from Russia.
Why do people appologize for their shoddy English, but not for their shoddy knowledge of the subject?
No one should have to apologize for NOT knowing something. Anyone who expects them to is an @$$.

Re: Help with sti

Posted: Thu Apr 15, 2010 6:20 am
by jal
-m32 wrote:No one should have to apologize for NOT knowing something. Anyone who expects them to is an @$$.
You are aware that we have a certain "required knowledge" at this forum, right?


JAL

Re: Help with sti

Posted: Thu Apr 15, 2010 7:45 am
by Sv9toi
neon wrote:Hello,

When GRUB passes control to your system it is running in protected mode with interrupts disabled. You need to re-initialize the PIC or APIC with your IDT before enabling hardware interrupts (sti).

If these are already set up perhaps posting some code and providing more information can help.

OK) It's work :D .


Ps I'm 12 yo. my father S.O. programmer and he learn me. If you want say, that you have big brain, you may do it in other places.

Re: Help with sti

Posted: Thu Apr 15, 2010 12:33 pm
by jal
Sv9toi wrote:Ps I'm 12 yo. my father S.O. programmer and he learn me. If you want say, that you have big brain, you may do it in other places.
Knowing you're that young, and non-native English speaker, I applaud you for trying, but please, read the wiki on getting started, and the forum rules if you haven't done so yet. We are not here to teach youngsters.


JAL