problem with virtual functions




problem with virtual functions

Postby paul » 25. Mar 2018, 21:37

Hello!

Awesome tutorials! Thank you!

I have a problem with keyboard processing.
If I use a virtual function call
esp = handlers[interruptNumber]->HandleInterrupt(esp);
in InterruptManager::DoHandleInterrupt(uint8_t interruptNumber, uint32_t esp)
then on exit from DoHandleInterrupt(...) function MyOS crashes.

If I replace the line with call to
handlers[interruptNumber]->HandleInterrupt(esp)
with code doing the same port operation:
//esp = handlers[interruptNumber]->HandleInterrupt(esp);
Port8Bit dataPort(0x60);
uint8_t key = dataPort.Read();
printf(" KEY ");
printHex(key);
printf("\n");
everyting works fine.

I can't guess what may be wrong with virtual function call, that it makes such problems.
Thank you for any help in advance!
paul
 
Posts: 1
Joined: 25. Mar 2018, 21:28

by Advertising » 25. Mar 2018, 21:37

Advertising
 

Return to Keyboard & Mouse

Who is online

No registered users

cron