Hi people, I have finally working, I have rewrited all form scratch.
I attach the source, make it typing in the uncompresed folder "do t7".
I dont know really what was the error, I will take later a look again at my old code, but sure that I miss something there.
Ok, also I write, because I have watched a little extrange behaviour, tought the programm run in quemu and bochs ok (havent tested on computer), if I move the las two lines of t7.asm that are string declarations, there is a error there that is catched in some way by the exception handler... by the way, if you look at the exception handler
Code: Select all
%macro WRAPPERHE 1 ; Have error
isr_%1_wrapper:
push ax
mov ax, %1
jmp exc_common16
%endmacro
%macro WRAPPERNE 1
isr_%1_wrapper:
push word 0
push ax
mov ax, %1
jmp exc_common16
%endmacro
exc_common16:
invk exc_handler16
pop ax
add sp, 4
iret
exc_handler16:
%define e_BP bp
%define e_RetAddr bp+2
%define e_AX bp+4
%define e_Error bp+6
%define e_EIP bp+8
%define e_CS bp+ 10
%define e_Flags bp+ 12
That is because it is PM16 and not 32 I guess (I see that I have missed in rename e_EIP to e_IP). About the error code, I have watchd that is only pushed if the interrupt is generated by the CPU, for example the exception 0x0D have error, but if I do int 0xD, the exception will be generated, but the error code will not be inserted, causing that the stack frame refer to incorrect displacements respec bp, and also because it is assumed that there will be a push (the error code), then add sp, 2 will fail and trash for the instruction iret.... (this is correct.. isnt it?)
By the way, in the tut, the guy put that exception 0x12 have a error code (in the list of errors have a 1 there), but in
http://osdever.net/bkerndev/index.php?the_id=90 say 18 (0x12) Machine Check Exception (Pentium/586+) No (have error code). You know wich of this two is right?
OK, returning to the behaviour if I move the lines at the end of t7.asm
msgWelcome db ...., 10, 0
msgTimer db "Ti...", ..., 0
to any place above a exception 3 is generated at 0x8:ffef, by the way, the size of the code are at much 13 sectors (if Im not wrong), and that is far from 0xFFFF... I dont understand this behaviour, if some one of you know what is, pleca dont doubt in say it
.
Apart, the only rude code that I hae tried to read is the source of the mesa lib some day, I have finding things extrange to me ...
, bye the way, 35Mb the src of Linux, where I start?, do you have a place where I can download src for kernels (like a list?) ?