Hi all,
I am working on EHCI Driver for real-mode platform, and I need to register the controller IRQ to an ISR.
When I look at the EHCI pci configuration space, I can see that the (for example) PCI register interrupt 0x0b to EHCI, then I need to register an ISR to be called when interrupt 0x0b called,
most of the OSs present an API to accomplish this, since in OS-less environment, I need to manually register the ISR, can I accomplish that without use lidt instruction? is there any easy & simpler method to do this?
thanks!
Real mode IRQ
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: Real mode IRQ
I would personally say that attempting USB in real mode would be not a good idea (not for a beginner).
What you want is the IVT (Interrupt Vector Table) which is used to handle interrupts in real-mode.
What you want is the IVT (Interrupt Vector Table) which is used to handle interrupts in real-mode.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: Real mode IRQ
Hi, thanks for your reply.
on my development board, the PCI assign IRQ 0x0b (11 decimal) to the EHCI controller.
when i try to bundle the IRQ to my ISR, after reading this wiki entry: http://wiki.osdev.org/PIC#Real_Mode
i assumed the interrupt vector in the IVT is 0x73 when i hook it to my ISR (writing isr pointer into offset 0:0x73*0x4)
when i execute int 0x73 my interrupt is called, but the EHCI controller don't seem to be jumping into my ISR.
another problem (that can be related to my prevuios problem) is that the ASYNC scheduler is not starting.
when i set to one the ASYNC_ENABLE and the ASYNC_DOORBELL bits in the CMD register, the Asynchronous Schedule Status bit in the USBSTS register
seems to be always off, i don't understand what can cause this problem, i know the controller doesn't have to set this USBSTS ASYNC bin immediately, but after several seconds the status dosen't change, it's worth mention that when i sets the ASYNC ENABLE and ASYNC DOORBELL bits in the USBCMD register, the SCHEDULER ENABLED bit (bit number 0) in the USBCMD
is on, but the same results occurred when it's on as well.
thank you very much for your help!
on my development board, the PCI assign IRQ 0x0b (11 decimal) to the EHCI controller.
when i try to bundle the IRQ to my ISR, after reading this wiki entry: http://wiki.osdev.org/PIC#Real_Mode
i assumed the interrupt vector in the IVT is 0x73 when i hook it to my ISR (writing isr pointer into offset 0:0x73*0x4)
when i execute int 0x73 my interrupt is called, but the EHCI controller don't seem to be jumping into my ISR.
another problem (that can be related to my prevuios problem) is that the ASYNC scheduler is not starting.
when i set to one the ASYNC_ENABLE and the ASYNC_DOORBELL bits in the CMD register, the Asynchronous Schedule Status bit in the USBSTS register
seems to be always off, i don't understand what can cause this problem, i know the controller doesn't have to set this USBSTS ASYNC bin immediately, but after several seconds the status dosen't change, it's worth mention that when i sets the ASYNC ENABLE and ASYNC DOORBELL bits in the USBCMD register, the SCHEDULER ENABLED bit (bit number 0) in the USBCMD
is on, but the same results occurred when it's on as well.
thank you very much for your help!