350d boot from cf card - page 43 - DSLR Hack development - CHDK Forum

350d boot from cf card

  • 510 Replies
  • 279462 Views
Re: 350d boot from cf card
« Reply #420 on: 19 / September / 2012, 06:25:21 »
Advertisements
in funclist.txt we do have fopen/fwrite/fseek that should do the trick.
to be honest I have no idea what fwrite can do for us ;)
all I've ever wanted was reanding and writing files and that works just fine with FIO_WriteFile and its brothers

would need to have a new menu option that u scroll left/right to select fat16/fat32 and then write the settings out on pressing SET or something?
that was my idea, but automatic detection of FAT16/32 would really be much better. if we would succeed to write a new MBR it shouldn't be a problem to read out the old one and check either.

*unless* we can cunningly copy the hack from memory back to the card? may also work possibly if what we copy in init.c can basically be copied back to the card? not sure of that tho...
that was my first thought. i have no idea if it would work. alternatively since we would control the sequence of events we could TRY to send another complete autoexec.bin into RAM first and get it back after formatting.

Re: 350d boot from cf card
« Reply #421 on: 19 / September / 2012, 06:36:37 »
to be honest I have no idea what fwrite can do for us ;)
all I've ever wanted was reanding and writing files and that works just fine with FIO_WriteFile and its brothers

i doubt that the FIO_* functions would be able to write to the raw block device itself. more likely that fopen/fseek/fwrite would be able to,  tho still maybe not. would need to see if we could open "A:" as a file which should/could be the partition.

it's probably just easier to use the "delete images" option on the camera tho to delete all images? shouldn't touch the hacked firmware or presets?

i'm still curious to see if we can find a way to fire the shutter in bulb mode - would be able to do some cool bulb ramping then and other stuff.

edit: would also be cool to see if 400plus could be ported to it. personally i really like the way the 350d hack works atm, esp with my added 'info jumps' as it's really fast to find the stuff i want to change. an interesting project tho to port 400plus. gui stuff would probably be the sticky area.
« Last Edit: 19 / September / 2012, 06:38:17 by zestoi »

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 350d boot from cf card
« Reply #422 on: 19 / September / 2012, 07:18:53 »
If the 350D uses intercom for changing camera settings, 400plus is a great choice.

If it doesn't, but it has prop_request_change (pRequestChange) and similar property stuff, you may consider porting the 5D classic ML.

Either way, high level stuff is similar in many cases, we are exchanging code with them. FIO, GUI, task API, properties, state objects and most other low level things are identical or very similar from 5Dc (digic II) to 5D3 (digic V).

GUI stuff shouldn't be a big problem, bitmap buffer should be easy to find (Coutts can help here).

If you need to restore the hack after formatting the card from the camera, ML does that, look in bootflags.c and debug.c. FAT16/32 code included, you only need to find how to do low-level I/O on the card and a place where to copy the files temporarily. You can't just write the RAM copy of autoexec, as it contains some variables too, not just read-only code.

We couldn't trigger bulb exposures in 5Dc.

Hope this helps.

Re: 350d boot from cf card
« Reply #423 on: 19 / September / 2012, 07:39:29 »
If the 350D uses intercom for changing camera settings, 400plus is a great choice.

yep, we have a function called SendToIntercom() that 400plus also uses.

Quote
GUI stuff shouldn't be a big problem, bitmap buffer should be easy to find (Coutts can help here)

cool. i may give it a go then. he's on this forum? i really don't know how many people are still using 350d's but it'd be an interesting project anyway.

Quote
If you need to restore the hack after formatting the card from the camera, ML does that, look in bootflags.c and debug.c. FAT16/32 code included, you only need to find how to do low-level I/O on the card and a place where to copy the files temporarily. You can't just write the RAM copy of autoexec, as it contains some variables too, not just read-only code.

cheers - i'll grab the ML code then and have a dig...

Quote
We couldn't trigger bulb exposures in 5Dc.

ah ok... i've seen that 400plus has defined a shutter_release_bulb() function that ends up calling IntercomHandlerButton() in the firmware.  we have a PressButtonHandler() defined in funclist.txt. how would i go about seeing what it does etc or what the function signature may be? name sounds similar to the 400plus one. don't mind too much if i brick my 350d tho would mean an end to my hacking fun with it...

Quote
Hope this helps.

indeed it does ;) are there tools that help with the creation of the funclist.txt file? i presume people don't manually look for functions in each firmware dump?


*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 350d boot from cf card
« Reply #424 on: 19 / September / 2012, 08:01:45 »
I use this to browse the firmware: http://magiclantern.wikia.com/wiki/GPL_Tools/ARM_console

Most functions can be found from strings. Others can be found by similarity with other firmwares (e.g. called from the same place), or just... you figure out what it does. Small ones can be decompiled. The firmwares from different cameras are very similar in many places, so you can find them just by comparing 350D with 400D firmwares, for example.

Coutts is more active on the ML forum, he has a 5Dc now, but he inspired a lot from the 350D hack, especially with the boot process. I have yet to look inside the 350D firmware.

There's lots of info floating around, feel free to browse and try things. Be careful with changing camera settings, they are persistent and there's no easy way to reset them if something goes wrong. Many things can be ported from compacts or from newer DSLRs.

I think you can use the 5Dc graphics routines for drawing on the screen. I remember 400plus guys also tried them, but I'm not sure if they are present in the main source tree.

About bulb exposure, once you figure out how to trigger it, should be easy to do some manual ramping. And even if the timing won't be perfect, you can solve that in post. I'm writing a deflickering script here: http://www.magiclantern.fm/forum/index.php?topic=2553

Re: 350d boot from cf card
« Reply #425 on: 20 / September / 2012, 03:12:24 »
I think you can use the 5Dc graphics routines for drawing on the screen. I remember 400plus guys also tried them, but I'm not sure if they are present in the main source tree.
Yes, it is in out main source tree; we have only used it experimentally so far, but it seems to work as expected.
« Last Edit: 20 / September / 2012, 03:15:27 by eduperez »

Re: 350d boot from cf card
« Reply #426 on: 30 / September / 2012, 22:19:54 »
Thanks for the amazing updates! How difficult would it be to add an option to control exposure time?

Re: 350d boot from cf card
« Reply #427 on: 01 / October / 2012, 07:16:14 »
Thanks for the amazing updates! How difficult would it be to add an option to control exposure time?
what exactly do you mean with that?


I'm back from vacation and while there I've played a bit with the timelapse function for the first time.
It's much nicer than I thought. I can remember that the code is not nearly as elegant as I would have liked when I wrote it, but it works quite reliably.

It's especially nice for self shots/group shots with a tripod - a very convenient and practical alternative.

I didn't have any problems with the relatively high power consumption because I run my camera from an external battery pack that gives me A LOT of shots.


Re: 350d boot from cf card
« Reply #428 on: 13 / October / 2012, 20:12:08 »
what exactly do you mean with that?

I didn't get a chance to dig into the code, but is it possible to code in an exposure control beyond 30 seconds?

*

Offline Sergei

  • ***
  • 114
Re: 350d boot from cf card
« Reply #429 on: 21 / October / 2012, 15:07:24 »
ah ok... i've seen that 400plus has defined a shutter_release_bulb() function that ends up calling IntercomHandlerButton() in the firmware.  we have a PressButtonHandler() defined in funclist.txt. how would i go about seeing what it does etc or what the function signature may be? name sounds similar to the 400plus one. don't mind too much if i brick my 350d tho would mean an end to my hacking fun with it...
I think you can use SendToIntercom(0xB6,0,0); In 400d 0xB6 and 0xB7 are codes for remote control buttons.
Camera must be in Tv or M mode and shutter set to "Bulb".
   SendToIntercom(0xB6,0,0); // to open a shutter
   SleepTask(long_exposure_time); // exposure time
   SendToIntercom(0xB6,0,0); // to close a shutter

 

Related Topics