Would this code remap the pic ?
Posted: Sat Apr 28, 2007 9:42 pm
Code: Select all
pic_remap:
mov al, 0x11
OUT 0x20, al
mov al, 0x11
OUT 0xA0, al
mov al, 0x20
OUT 0x20 + 1, al
mov al, 0x28
OUT 0xA0 + 1, al
mov al, 4
OUT 0x20 + 1, al
mov al, 2
OUT 0xA0 + 1, al
mov al, 0x01
OUT 0x20 + 1, al
mov al, 0x01
OUT 0xA0 + 1, al
mov al, 0xFF
OUT 0x20 + 1, al
Do you guys think this would work ? I need to know so when I try it if it crashes after setting up IDT I will know this is not the problem. Im using NASM if that matters for syntax... I don't know if NASM uses that syntax of destination, src or src, destination... as you can see I tried destination, source for OUT. I tried this on my VM by calling it and it did not crash me Im going to attempt to make the GDT and IDT now so if it crashes I would like to know if its due to an error in my remapping code not doing what its supposed to or what.
(Update:)
Im guessing it works because it did not crash when I called STI however I would like reassurance by other computer scientists that this code is correct and that the PIC has been remapped...