flat assembler
Message board for the users of flat assembler.

Index > Main > How to get int number inside it's handler ?

Author
Thread Post new topic Reply to topic
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden
Yep... this is it... I write my own OS, just for debugging I print exception number to display in every single exception handler... But this is takes so much space Sad I want to write something like "universal handler"... Is it possible to get interrupt number inside the handler ? Then all I have to do is to print it... There must be some bit or something in APIC controller, but I can't find it somehow Sad HELP !

_________________
Image
Post 22 Nov 2004, 12:35
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4
Are you in realmode or pmode.
If i read your ? right, in my pmode os i do this:
Code:
div_error:        pushad        push es        mov ax,8h mov es,ax     mov byte [es:0xB809C], "D"        pop es        popad       iret    


\\\\||////
(@@)
ASHLEY4.

Batteries not included, Some assembly required.
Post 22 Nov 2004, 17:30
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
Tyler Durden wrote:
Yep... this is it... I write my own OS, just for debugging I print exception number to display in every single exception handler... But this is takes so much space Sad I want to write something like "universal handler"... Is it possible to get interrupt number inside the handler ? Then all I have to do is to print it... There must be some bit or something in APIC controller, but I can't find it somehow Sad HELP !

Yes you can check the pic ,but only for ints generated by external hardware.
this method don´t need too much memory
Code:
_int0: push 0 jmp generic_int  
_int1: push 1 jmp generic_int 
_int2: push 2 jmp generic_int 

    

in 32bit mode only 4-7 bytes for each interrupt.
Post 22 Nov 2004, 20:51
View user's profile Send private message Visit poster's website Reply with quote
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden
Quote:
in my pmode os i do this:

I do the same way... But it's suck Sad how to get this exceptions numbers ? May be from one of the MSRs ?

_________________
Image
Post 23 Nov 2004, 09:57
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.