DryOS task and context structures - DryOS Development - CHDK Forum supplierdeeply

DryOS task and context structures

  • 2 Replies
DryOS task and context structures
« on: 16 / May / 2009, 19:44:11 »
Are there any CHDK headers that have the layout of the task and context structures used by DryOS?  The chdk code that I see that overloads the dispatch hook just uses hard-coded offsets based on the pointer passed in.

Based on my work in reversing the 5D Mark 2 firmware, they look like this:
Code: (c) [Select]
struct context
        uint32_t                cpsr;
        uint32_t                r[13];
        uint32_t                lr;
        uint32_t                pc;

Code: (c) [Select]
struct task
        uint32_t                off_0x00;       // always 0?
        uint32_t                off_0x04;       // stack maybe?
        uint32_t                off_0x08;       // flags?
        void *                  entry;          // off 0x0c
        uint32_t                off_0x10;
        uint32_t                off_0x14;
        uint32_t                off_0x18;
        uint32_t                off_0x1c;
        uint32_t                off_0x20;
        char *                  name;           // off_0x24;
        uint32_t                off_0x28;
        uint32_t                off_0x2c;
        uint32_t                off_0x30;
        uint32_t                off_0x34;
        uint32_t                off_0x38;
        uint32_t                off_0x3c;
        uint32_t                off_0x40;
        uint32_t                off_0x44;
        uint32_t                off_0x48;
        struct context *        context;        // off 0x4C
        uint32_t                pad_1[12];

My dispatch hook looks like this:
Code: (c) [Select]
        struct context **       context
        if( !context )

        // Determine the task address
        struct task * task =
                ((uint32_t)context) - offsetof(struct task, context);

        // Do nothing unless a new task is starting via the trampoile
        if( task->context->pc != (uint32_t) task_trampoline )

        // Try to replace the sound device task
        // The trampoline will run our entry point instead
        if( task->entry == (uint32_t) sound_dev_task )
                task->entry = (uint32_t) my_sound_dev_task;

Re: DryOS task and context structures
« Reply #1 on: 07 / November / 2009, 09:21:56 »

on page 55 of this Canon document
it is said that Dryos is based on/compliant with micro itron 4.0 RTOS

which specifications are here

and a compatible implementation (TOPPER/JSP) is here

with source code and documentation


Re: DryOS task and context structures
« Reply #2 on: 29 / November / 2009, 22:32:12 »
I am the newest of the newbies. I have just followed the step-by-step progress from Beta to now in creating CHDK for the Canon SD880. Wow! and Thanks! to all who made this possible.
A month ago I loaded the appropriate CHDK for my Canon SD850. Should I expect similar happy results?


Related Topics