org 0x10000

use32

	cli
	mov ax,0x10
	mov ds,ax
	mov gs,ax
	mov fs,ax
	mov es,ax
	mov esp, 0x90000	    ; stack begins from 90000h

	;--------------------------------;
	;PIC, map to 32-47 int number    ;
	;--------------------------------;

	mov	al,0x11
	out	0x20,al
	out	0xa0,al
       ;where to store irq in IVT, from 0-7
	mov	al,0x20 		       ; original: 20
	out	0x21,al
       ;where to store irq in IVT, from 8-15
	mov	al,0x28 		       ; original: 28
	out	0xa1, al

	mov	al, 0x4 		; 0x04 => 0100, second bit (IR line 2)
	out	0x21, al
	mov	al, 0x2 		; 010=> IR line 2
	out	0xa1, al
	mov	al, 1			; bit 0 enables 80x86 mode
	out	0x21, al
	out	0xa1, al
	xor	ax,ax
	out	0x21, al
	out	0xa1, al
	hlt







include '/parts/isr.asm'
include '/parts/idt.asm'
include '/parts/keyboard.asm'
