Bona Fide OS Developer
View unanswered posts | View active topics It is currently Thu Dec 13, 2018 7:53 am



Post new topic Reply to topic  [ 6 posts ] 
 trying to hook a interrupt locks the machine 
Author Message
Post trying to hook a interrupt locks the machine
:x I am writing a real mode operating system in C and decided to use interrupts for system calls but my code to hook the vector is not working:
Code:
void setvector(unsigned char inter, unsigned seg, unsigned off){
unsigned char far *data=0;
data[inter*4] = (seg & 0xFF00) >> 8;
data[inter*4 + 1] = (seg & 0x00FF);
data[inter*4 + 2] = (off & 0xFF00) >> 8;
data[inter*4 + 3] = (off & 0x00FF);
}

but the machine freezes when the hooked interrupt is fired!
for example:
Code:
setvector(0x32, FP_SEG(hello_world), FP_OFF(hello_world));
asm {int 0x32} //Freeze here


Sat Nov 07, 2009 7:08 pm
Post Re: trying to hook a interrupt locks the machine
fixed it! the compiler thought i loaded the kernel at 0000:0100 insted of 4000:0100 :) :) :)


Sat Nov 07, 2009 9:49 pm

Joined: Sat Jul 25, 2009 9:15 am
Posts: 257
Post Re: trying to hook a interrupt locks the machine
I see you went the route of settin up soft interrupts instead of calling them directly...
...cool 8-)


Mon Nov 09, 2009 1:24 pm
Profile

Joined: Sat Jul 25, 2009 11:26 am
Posts: 81
Post Re: trying to hook a interrupt locks the machine
DudeOfX wrote:
I see you went the route of settin up soft interrupts instead of calling them directly...
...cool 8-)


This doesn't even mean anything... :!: He only gave an example where an interrupt handler would be called.

Cheers,
Bogdan


Tue Nov 10, 2009 10:28 am
Profile

Joined: Sat Jul 25, 2009 9:15 am
Posts: 257
Post Re: trying to hook a interrupt locks the machine
WTF man... the likelyhood of that being the reason of using interrupts is high due to the problems he had in the past... it was a safe assumption to make.


Tue Nov 10, 2009 5:43 pm
Profile
Post Re: trying to hook a interrupt locks the machine
its so so much easier then calling directly.


Fri Nov 13, 2009 5:18 pm
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.