IRQ error on qemu

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.
Post Reply
aemgoborges
Posts: 4
Joined: Fri May 27, 2016 4:45 pm
Libera.chat IRC: aemgborgess

IRQ error on qemu

Post by aemgoborges »

Hello guys , my IRQ's are not working when i remap the pic and register the Interrupt routines and call irq_install in main function i got this message from qemu : Booting From ROM , and my os not boot

code of error:

Code: Select all

void remap_pic()
{
outportb (0x20, 0x11);
outportb (0xA0, 0x11);
outportb (0x21, 0x20);
outportb (0xA1, 0x28);
outportb (0x21, 0x04);
outportb (0xA1, 0x02);
outportb (0x21, 0x01);
outportb (0xA1, 0x01);
outportb (0x21, 0x0);
outportb (0xA1, 0x0);
}



void irq_install()
{

  remap_pic();

  idt_set_gate (32, (unsigned)irq0, 0x08, 0x8E);
  idt_set_gate (33, (unsigned)irq1, 0x08, 0x8E);
  idt_set_gate (34, (unsigned)irq2, 0x08, 0x8E);
  idt_set_gate (35, (unsigned)irq3, 0x08, 0x8E);
  idt_set_gate (36, (unsigned)irq4, 0x08, 0x8E);
  idt_set_gate (37, (unsigned)irq5, 0x08, 0x8E);
  idt_set_gate (38, (unsigned)irq6, 0x08, 0x8E);
  idt_set_gate (39, (unsigned)irq7, 0x08, 0x8E);
  idt_set_gate (40, (unsigned)irq8, 0x08, 0x8E);
  idt_set_gate (41, (unsigned)irq9, 0x08, 0x8E);
  idt_set_gate (42, (unsigned)irq10, 0x08, 0x8E);
  idt_set_gate (43, (unsigned)irq11, 0x08, 0x8E);
  idt_set_gate (44, (unsigned)irq12, 0x08, 0x8E);
  idt_set_gate (45, (unsigned)irq13, 0x08, 0x8E);
  idt_set_gate (46, (unsigned)irq14, 0x08, 0x8E);
  idt_set_gate (47, (unsigned)irq15, 0x08, 0x8E);



}
when i not call irq_install , on main my os work , what's is happening?
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: IRQ error on qemu

Post by BrightLight »

Does it triple fault? Is a different IRQ handler called? Do you have software interrupts working before hardware IRQs? You need to give more information than a code snippet.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
aemgoborges
Posts: 4
Joined: Fri May 27, 2016 4:45 pm
Libera.chat IRC: aemgborgess

Re: IRQ error on qemu

Post by aemgoborges »

yes i have software interrupts working , not triple fault
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: IRQ error on qemu

Post by BrightLight »

Then define "IRQ error". What does IRQ error mean? What happens on IRQ?
You know your OS is advanced when you stop using the Intel programming guide as a reference.
aemgoborges
Posts: 4
Joined: Fri May 27, 2016 4:45 pm
Libera.chat IRC: aemgborgess

Re: IRQ error on qemu

Post by aemgoborges »

irq error that i said is because when every time a call irq set up routine in my kernel main qemu not boot my system its says boot from rom
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: IRQ error on qemu

Post by BrightLight »

QEMU says "Booting from ROM..." whenever you boot your kernel using the -kernel command-line option. What IRQ are you waiting to receive? Without calling your IRQ initialization code, what happens? What does QEMU show?
You know your OS is advanced when you stop using the Intel programming guide as a reference.
aemgoborges
Posts: 4
Joined: Fri May 27, 2016 4:45 pm
Libera.chat IRC: aemgborgess

Re: IRQ error on qemu

Post by aemgoborges »

without irq initialization code my os on qemu works fine . i`m not waiting an interrupt . i'm just put irqs on idt and call the code of initialization on kernel main
User avatar
Combuster
Member
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: IRQ error on qemu

Post by Combuster »

Do you happen to have a CLI; HLT; pair somewhere in your code? In QEMU this is an infamous way to prevent any updates to the screen from showing.
"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 ]
Post Reply