Coming back!
well, i have read a lot during this time, and I somewhat-know what I need. The i386 stub for gbd is written in C, i need to link it along with my code and i need to provide to the C written stub, the following functions:
-int getDebugChar()
-void putDebugChar(int)
so i need some guidance, i don't know if i really need that C written stub(can I write my own in Assembly or Pascal?). I'm writing now the interrupt-based-serial-driver in NASM assembly to provide those functions later, but i don't know what calling convention FPC generated code uses. Also i don't know if freepascal uses the C underscore for calls. Also i need to link C and pascal code in the same "executable", what i need to know when I do things like that?
Also, i have some problems when writing the interrupt routine. Now i have something like this...
....
proc far int_16550
pusha
;intID
mov dx, ioIIR+iobase
in ax, dx
cmp ax, INTYPE1
je int_type_1
cmp ax, INTYPE2
je int_type_2
cmp ax, INTYPE3
je int_type_3
cmp ax, INTYPE4
je int_type_4
falsa_alarma:
mov al, 020h
out 020h, al
popa
iret
INTYPE1:
mov ax, seg buffer
mov bx, buffer
mov es, ax
mov di, bx
mov cx, INT_TRIGGER_LEVEL
rep insb
mov al, 020h
out 020h, al
popa
iret
....
however, GDB says that i need to check a control-C received at UART interrupt. searching for a control-C can be made in buffer, or must be done when i take data from FIFO?