How can i remap IRQ1? [SOLVED: Stop replying.]
Posted: Mon Dec 19, 2016 1:06 pm
For my keyboard handler, i need to remap IRQ1. However, i find barely any code on this, and the code that is provided doesn't work.
I tried doing the following:
However, this gives out this during my build.bat (i'm in windows so instead of using a makefile i will use a batch file):
How do i successfully remap IRQ1? (I only need IRQ1, as i don't find a use for IRQ2 and what i need relies on IRQ1 anyway).
My keyboard handler is complete, it only needs a working IRQ remapper. And yes, i did write most of the additional code that was needed in order for it to stop spamming 7's ("7 "'s if nulls are not ignored in putchar) when the mouse was moved and filled the screen with whatever character was pressed.
I tried doing the following:
Code: Select all
void PIC_remap(void) {
asm(".intel_syntax noprefix");
asm("mov al, 0x11");
asm("out 0x20, al");
asm("out 0xA0, al");
asm("mov al, 0x20");
asm("out 0x21, al");
asm("mov al, 0x28");
asm("out 0xA1, al");
asm("mov al, 0x04");
asm("out 0x21, al");
asm("mov al, 0x02");
asm("out 0xA1, al");
asm("mov al, 0x01");
asm("out 0x21, al");
asm("out 0xA1, al");
}
Code: Select all
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s: Assembler messages:
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:330: Error: no such instruction: `subl $4,%esp'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:334: Error: operand size mismatch for `in'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:337: Error: operand type mismatch for `movzbl'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:338: Error: junk `(%eax)' after expression
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:339: Error: no such instruction: `movl %eax,(%esp)'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:341: Error: no such instruction: `addl $4,%esp'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:355: Error: operand size mismatch for `in'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:363: Error: no such instruction: `subl $4,%esp'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:367: Error: operand size mismatch for `in'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:370: Error: operand type mismatch for `movzbl'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:371: Error: junk `(%eax)' after expression
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:372: Error: no such instruction: `movl %eax,(%esp)'
C:\Users\Nuno\AppData\Local\Temp\ccyCmahd.s:374: Error: no such instruction: `addl $4,%esp'
i686-elf-gcc: error: kernel.o: No such file or directory
My keyboard handler is complete, it only needs a working IRQ remapper. And yes, i did write most of the additional code that was needed in order for it to stop spamming 7's ("7 "'s if nulls are not ignored in putchar) when the mouse was moved and filled the screen with whatever character was pressed.