I finally got to enable interrupts correctly (using my code and code of some other people, no errors or warnings using -Wextra/-Wall). However, my code sometimes fails to enable interrupts, and so i need something like a jc to repeat if the carry flag was set, or a rfics (repeat function if carry flag set).
How would i do this in C (or C++)? Yes, i use inline assembly to do lidt.
(C/C++) How can i try to use something like jc?
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
(C/C++) How can i try to use something like jc?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
Re: (C/C++) How can i try to use something like jc?
What has the carry flag got to do with enabling interrupts?
Techel
Why would you want to check the carry flag?
Simply use the jc instruction with a destination label.
Simply use the jc instruction with a destination label.
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: Techel
My loading interrupts function fails a lot, and since i try to use the PIC right after, it triple-faults (obviously).Techel wrote:Why would you want to check the carry flag?
Simply use the jc instruction with a destination label.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: (C/C++) How can i try to use something like jc?
lidt can fail sometimes (and it does, it sometimes takes like 5 times until it finally does it succesfully).iansjack wrote:What has the carry flag got to do with enabling interrupts?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
Re: (C/C++) How can i try to use something like jc?
But what has that got to do with the carry flag? And what is difficult about enabling interrupts - it's a single instruction.NunoLava1998 wrote:lidt can fail sometimes (and it does, it sometimes takes like 5 times until it finally does it succesfully).iansjack wrote:What has the carry flag got to do with enabling interrupts?
Techel
Did you clear the interrupt enabled flag before lidt'ing the idt? If not, the pit keeps triggering interrupts, but if you're lucky, this doesn't happen until you got the interrupt part successfully set up.
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: Techel
Looks like that is , sometimes i can get it for a bit before PIT screws up.Techel wrote:Did you clear the interrupt enabled flag before lidt'ing the idt? If not, the pit keeps triggering interrupts, but if you're lucky, this doesn't happen until you got the interrupt part successfully set up.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS