X-Git-Url: https://git.wirehaze.ovh/BOS.git/blobdiff_plain/9eee6999d9d27301b73f604c9978677c9794d717..359bb65a0ed9dbb75a208db4675db689877a85b9:/kernel/init/pic.asm?ds=sidebyside diff --git a/kernel/init/pic.asm b/kernel/init/pic.asm index 6076213..9e6bb61 100755 --- a/kernel/init/pic.asm +++ b/kernel/init/pic.asm @@ -8,128 +8,131 @@ ;-------------------------------------------; -; remap PICs to: cl = pic1 ch = pic2 ; +; remap PICs ; +; in: cl = pic1 ; +; ch = pic2 ; ;-------------------------------------------; remap_pics: - push ax - push dx + push ax + push dx - mov al, 0x11 ; IWC1 - out 0x20, al - out 0xA0, al + mov al, 0x11 ; IWC1 + out 0x20, al + out 0xA0, al - mov al, cl ; IWC2 - out 0x21, al - mov al, ch - out 0xA1, al + mov al, cl ; IWC2 + out 0x21, al + mov al, ch + out 0xA1, al - mov al, 0x04 ; IWC3 - out 0x21, al - mov al, 0x02 - out 0xA1, al + mov al, 0x04 ; IWC3 + out 0x21, al + mov al, 0x02 + out 0xA1, al - mov al, 0x01 ; IWC4 - out 0x21, al - out 0xA1, al + mov al, 0x01 ; IWC4 + out 0x21, al + out 0xA1, al - pop dx - pop ax - ret + pop dx + pop ax + ret ;----------------------; ; disable all IRQs. ; ;----------------------; disable_irqs: - push ax + push ax - mov al, 0xFF - out 0x21, al - out 0xA1, al + mov al, 0xFF + out 0x21, al + out 0xA1, al - pop ax - ret + pop ax + ret ;---------------------; ; enable all IRQs. ; ;---------------------; enable_irqs: - push ax + push ax - mov al, 0x00 - out 0x21, al - out 0xA1, al + mov al, 0x00 + out 0x21, al + out 0xA1, al - pop ax - ret + pop ax + ret ;-----------------------------; ; enable an IRQ. cl = irq ; ;-----------------------------; enable_irq: - push ax - push cx + push ax + push cx - cmp cl, 8 - jb .master + cmp cl, 8 + jb .master - sub cl, 8 - mov ah, 1 - shl ah, cl - xor ah, 0xFF + sub cl, 8 + mov ah, 1 + shl ah, cl + xor ah, 0xFF - in al, 0xA1 - and al, ah - out 0xA1, al + in al, 0xA1 + and al, ah + out 0xA1, al - pop cx - pop ax - ret - .master: - mov ah, 1 - shl ah, cl - xor ah, 0xFF + pop cx + pop ax + ret + .master: + mov ah, 1 + shl ah, cl + xor ah, 0xFF - in al, 0x21 - and al, ah - out 0x21, al + in al, 0x21 + and al, ah + out 0x21, al - pop cx - pop ax - ret + pop cx + pop ax + ret ;------------------------------; -; disable an IRQ. cl = irq ; +; disable an IRQ. ; +; in: cl = irq ; ;------------------------------; disable_irq: - push ax - push cx - - cmp cl, 8 - jb .master - - sub cl, 8 - mov ah, 1 - shl ah, cl - - in al, 0xA1 - or al, ah - out 0xA1, al - - pop cx - pop ax - ret - .master: - mov ah, 1 - shl ah, cl - - in al, 0x21 - or al, ah - out 0x21, al - - pop cx - pop ax - ret \ No newline at end of file + push ax + push cx + + cmp cl, 8 + jb .master + + sub cl, 8 + mov ah, 1 + shl ah, cl + + in al, 0xA1 + or al, ah + out 0xA1, al + + pop cx + pop ax + ret + .master: + mov ah, 1 + shl ah, cl + + in al, 0x21 + or al, ah + out 0x21, al + + pop cx + pop ax + ret \ No newline at end of file