plzurgent!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




hi ,
plz tell me where am i going wrong in hacking timer0
first i'm setting counter0 to generate square wave at
approx 500 microsecind
set_pit_count
{
 cli()
outb(0x36,0x40)
outb((char)counter&0xff)
outb((char(counter>>8)
sti():
}

i'm saving old stub's address as
void *get_old_stub(int n) //here n=32
{
cli();
struct descriptor_idt *idte=&((struct descriptor     
 idt*)ptr_idt_table)[n]
return((void*)(idte->offset_high<<16)+idte_offset_low))//this
returns old_stub
sti();
}
The PROBLEM is here in my calling my interrupt routine
and original stub
void stub(void)
{
 asm("
  .globl stub
  align 4,0x90
  stub:
  pushal
  call *func_ptr
//func_ptr=(unsigned long)&func interrupt handler i
have to invoke every 500 microsecond
  popal
  movb $0x20,%al
  outb %al,$0x20
//sending EOI to i8253
  iret
")
//in stack we have eflags,return EIP
void func(void)
{
 temp_pit_counter-=1;
 
//required as for 500 micro second and 10 ms original
(schesuler call)
//this has value around 20 means when it is 0 i have
to call scheduler

if(!temp_pit_counter)
{
 temp_pit_counter=compensation_count//reset it to 20
for next call
 asm("addl $4,%esp                 //this is return
EIP
  popal
  jmp old_stub                       //old address
  ")
}
return
}
my program is not running i checked the old_stub value
with original value 
all is right but my calling sequence somewhere wrong
it is giving error bad EIP value
plz help
thanks

 
 


	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux