SX720 Porting thread - page 6 - DryOS Development - CHDK Forum

SX720 Porting thread

  • 154 Replies
  • 38938 Views
*

Offline reyalp

  • ******
  • 12000
Re: SX720 Porting thread
« Reply #50 on: 01 / April / 2016, 15:55:45 »
Advertisements
EDIT: I also make the blinker going with this at my_restart, so the the led address are right  :D
That confirms the dancing bits is correct at least.
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #51 on: 02 / April / 2016, 14:04:20 »

I have trouble finding TurnOnBackLight  & TurnOffBackLight  will it show anything if these two are nullsubs?




TurnOnBackLight  looks like 0xbfe1565d from j_TurnOnBackLight but not sure




thanks

*

Offline srsa_4c

  • ******
  • 3943
Re: SX720 Porting thread
« Reply #52 on: 02 / April / 2016, 14:19:57 »
I have trouble finding TurnOnBackLight  & TurnOffBackLight  will it show anything if these two are nullsubs?
These are no-op lately*:
Code: [Select]
; DispCon_TurnOnBackLight_FW 0xfc42c423
fc42c422: 2000      movs r0, #0
fc42c424: 4770      bx lr
; DispCon_TurnOffBackLight_FW 0xfc42c427
fc42c426: 2000      movs r0, #0
fc42c428: 4770      bx lr
so nullsubs are quite appropriate.
Quote
0xbfe1565d
I would not expect to find anything non-time-critical in that memory area.

edit:
*That means these functions are (or were?) misdetected by the sigfinder. The disassembly I have is a few days old.
« Last Edit: 02 / April / 2016, 14:33:15 by srsa_4c »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #53 on: 02 / April / 2016, 14:55:23 »

Thanks srsa_4c will go for nullsub then


The 0xbfe1565d came from:


capdis.exe PRIMARY.BIN 0xfc000000 -stubs=./ -s=j_TurnOnBackLight -c=100
Code: [Select]
; j_TurnOnBackLight 0xfc2ed6ec
    ldr     pc, =0xbfe1565d ;  TurnOnBackLight
    svclt   #0xe1565d
    ldr     pc, =0xbfe154ed ;  GiveSemaphore
    svclt   #0xe154ed
; j_TakeSemaphore 0xfc2ed6fc
    ldr     pc, =0xbfe15475 ;  TakeSemaphore
    svclt   #0xe15475
; j_WaitForAllEventFlag 0xfc2ed704
    ldr     pc, =0xbfe14df7 ;  WaitForAllEventFlag
    svclt   #0xe14df7
; j_ReceiveMessageQueue 0xfc2ed70c
    ldr     pc, =0xbfe1518f ;  ReceiveMessageQueue
    svclt   #0xe1518f




What is the best way to debug boot.c inserting a "BL     debug_led\n" to see where it goes, will be safe or or have to store first the reg states?
« Last Edit: 02 / April / 2016, 15:01:43 by asm1989 »


*

Offline reyalp

  • ******
  • 12000
Re: SX720 Porting thread
« Reply #54 on: 02 / April / 2016, 15:06:15 »

Thanks srsa_4c will go for nullsub then


The 0xbfe1565d came from:
Your stubs / csv files are out of date. I fixed this in r4572

edit:
As srsa_4c says, these eventprocs are no-op on some cameras (sx720hs and g5x, at least.) The sign finder now ignores them, so they will show up as not found. You can safely nullsub them. Previously, it would run off the end of the no-op function and pick up something else.
« Last Edit: 02 / April / 2016, 15:08:34 by reyalp »
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #55 on: 02 / April / 2016, 15:34:47 »
Thanks reyalp swithed to 4580
boot fails now at "ldr     r0, =hook_CreateTask\n" 

*

Offline reyalp

  • ******
  • 12000
Re: SX720 Porting thread
« Reply #56 on: 02 / April / 2016, 15:46:08 »
Thanks reyalp swithed to 4580
boot fails now at "ldr     r0, =hook_CreateTask\n"
It's pretty unlikely that this instruction can fail on by itself, it would require the address the constant is stored at to be invalid, or CHDK code to be corrupted.

However, CreateTask on your camera is in the second RAM area, so the related code will probably be a little bit different from g7x and sx280hs.

It will need to go after the Canon code that copies ROM to this area, after   "blo     loc_fc020046"

You can try booting without the task hooking enabled, since that is not required for basic stuff like spytask or kbd_task.

Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #57 on: 03 / April / 2016, 05:18:09 »
Thanks reyalp, moving that was helpfull now crashes later,


It is safe to do   *(volatile int*)0xd20b0994 = 0x4d0002; to light the led  inside any asm volatile{  locations or registries must be saved first?


*

Offline reyalp

  • ******
  • 12000
Re: SX720 Porting thread
« Reply #58 on: 03 / April / 2016, 05:56:55 »
It is safe to do   *(volatile int*)0xd20b0994 = 0x4d0002; to light the led  inside any asm volatile{  locations
No. You must ensure the registers are not trashed. Mixing C and asm blocks isn't really safe, unless the ASM block fully specifies the clobbers. Using C at all in a naked function is not  actually safe either. If you turn on the LED in ASM, you can control which registers are used. You can also put it in a function and call it with BL. You still have to pay attention to which registers your function call trashes.
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #59 on: 03 / April / 2016, 11:59:54 »
I am calling that with a BL but not sure which registers are trashed, will use better ASM_SAFE("BL...
« Last Edit: 03 / April / 2016, 12:49:17 by asm1989 »

 

Related Topics