DryOS "task hook" - General Discussion and Assistance - CHDK Forum  

DryOS "task hook"

  • 1 Replies
  • 3995 Views
*

Offline reyalp

  • ******
  • 14080
DryOS "task hook"
« on: 03 / April / 2011, 18:49:07 »
Advertisements
This is something I've suspected for a while, but finally verified.

The *(int*)0x1934=(int)taskHook thing we use to hook task start on DryOS is not a task create hook. It's more like a context switch hook, I think. Trying to debug the startup file crash, I logged the first 128 task names called with this function.

As you can see, many appear multiple times. It might be a good idea to not do strcmp() on all the task names every time.

Also, assuming this is a context switch hook, there may be other interesting ways to abuse it.
Code: [Select]
init
WdtReset
(null tcb->name)
WdtPrint
(null tcb->name)
ImageSensorTask
(null tcb->name)
Thermometer
(null tcb->name)
ZoomLens
(null tcb->name)
ZoomEvent
(null tcb->name)
FocusLens
(null tcb->name)
FocusEvent
(null tcb->name)
MechaShutter
(null tcb->name)
Nd
(null tcb->name)
CZ
(null tcb->name)
ISComTask
(null tcb->name)
ISComTask
(null tcb->name)
LEDCon
(null tcb->name)
ImgPlayDrv
(null tcb->name)
ASIF
(null tcb->name)
BeepTask
(null tcb->name)
CtrlSrv
(null tcb->name)
PhySw
(null tcb->name)
SsTask
(null tcb->name)
CaptSeqTask
(null tcb->name)
Bye
(null tcb->name)
SpyTask
AudioTsk
(null tcb->name)
PhySw
(null tcb->name)
InitCHDKPTP
SpyTask
TempCheck
(null tcb->name)
TempCheck
ClockSave
(null tcb->name)
CtrlSrv
(null tcb->name)
CtrlSrv
(null tcb->name)
CtrlSrv
(null tcb->name)
CtrlSrv
(null tcb->name)
PhySw
(null tcb->name)
InitFileModules
FsIoNotifyTask
InitFileModules
SpyTask
CommonDrivers
ReadScheduleTas
PhySw
CtrlSrv
InitFileModules
SpyTask
CommonDrivers
Fencing
CommonDrivers
MotionVector
CommonDrivers
SceneDetectTask
CommonDrivers
DevelopModule
CommonDrivers
DetectVerticalW
CommonDrivers
SynchTask
CommonDrivers
SyncPeriod
CommonDrivers
AfIntSrvTask
CommonDrivers
AFTask
CommonDrivers
WBIntegTask
CommonDrivers
OBCtrlTask
CommonDrivers
ExpDrvTask
CommonDrivers
ExpDrvSubTask
CommonDrivers
BrtMsrTask
CommonDrivers
EFChargeT
CommonDrivers
CntFlashTask
CommonDrivers
PhySw
InitFileModules
SpyTask
CommonDrivers
InitFileModules
CommonDrivers
InitFileModules
CommonDrivers
InitFileModules
CommonDrivers
InitFileModules
CommonDrivers
InitFileModules
CommonDrivers
InitFileModules
CommonDrivers
InitFileModules
CommonDrivers


Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: DryOS "task hook"
« Reply #1 on: 03 / April / 2011, 18:53:13 »
That's why I switched to comparing to firmware function addresses rather than task names in the G12 & SX30 code. I noticed how many times the taskhook was being called too.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics