#include "lolevel.h"#include "platform.h"#include "core.h"const long new_sa = MEMISOSTART + MEMISOSIZE;/* Ours stuff */extern long wrs_kernel_bss_start;extern long wrs_kernel_bss_end;extern void createHook (void *pNewTcb);extern void deleteHook (void *pTcb);void boot();/* "relocated" functions */void __attribute__((naked,noinline)) h_usrInit();void __attribute__((naked,noinline)) h_usrKernelInit();void __attribute__((naked,noinline)) h_usrRoot();void boot(){ long *canon_data_src = (void*)0xFFEC54F0; long *canon_data_dst = (void*)0x1900; long canon_data_len = 0xE460 - 0x1900; long *canon_bss_start = (void*)0xE460; // just after data long canon_bss_len = 0x95730 - 0xE460; long i; asm volatile ( "MRC p15, 0, R0,c1,c0\n" "ORR R0, R0, #0x1000\n" "ORR R0, R0, #4\n" "ORR R0, R0, #1\n" "MCR p15, 0, R0,c1,c0\n" :::"r0"); for(i=0;i<canon_data_len/4;i++) canon_data_dst[i]=canon_data_src[i]; for(i=0;i<canon_bss_len/4;i++) canon_bss_start[i]=0; asm volatile ( "MRC p15, 0, R0,c1,c0\n" "ORR R0, R0, #0x1000\n" "BIC R0, R0, #4\n" "ORR R0, R0, #1\n" "MCR p15, 0, R0,c1,c0\n" :::"r0"); h_usrInit();}void h_usrInit(){ asm volatile ( "STR LR, [SP,#-4]!\n" "BL sub_FFC01968\n" "MOV R0, #2\n" "MOV R1, R0\n" "BL sub_FFEAB86C\n" //unknown_libname_206 ; "Canon A-Series Firmware" "BL sub_FFE9CEDC\n" //excVecInit "BL sub_FFC011C4\n" "BL sub_FFC01728\n" "LDR LR, [SP],#4\n" "B h_usrKernelInit\n" );}void h_usrKernelInit(){ asm volatile ( "STMFD SP!, {R4,LR}\n" "SUB SP, SP, #8\n" "BL sub_FFEABD6C\n" //classLibInit "BL sub_FFEBEB54\n" //taskLibInit "LDR R3, =0xDBD8\n" "LDR R2, =0x9C460\n" "LDR R1, [R3]\n" "LDR R0, =0x9F190\n" "MOV R3, #0x100\n" "BL sub_FFEB7C64\n" //qInit "LDR R3, =0xDB98\n" "LDR R0, =0xE3E0\n" "LDR R1, [R3]\n" "BL sub_FFEB7C64\n" //qInit "LDR R3, =0xDC54\n" "LDR R0, =0x9F164\n" "LDR R1, [R3]\n" "BL sub_FFEB7C64\n" //qInit "BL sub_FFEC36D4\n" //workQInit "BL sub_FFC012B0\n" "MOV R4, #0\n" "MOV R3, R0\n" "MOV R12, #0x800\n" "LDR R0, =h_usrRoot\n" "MOV R1, #0x4000\n" ); // "LDR R2, =0xDF7D0\n" // 0x9F7D0 + 0x40000 asm volatile ( "LDR R2, =new_sa\n" "LDR R2, [R2]\n" ); asm volatile ( "STR R12, [SP]\n" "STR R4, [SP,#4]\n" "BL sub_FFEBBD94\n" //kernelInit "ADD SP, SP, #8\n" "LDMFD SP!, {R4,PC}\n" );}static long drv_struct[16]; static long dh_err(){ return -1;}static void drv_self_hide(){ long drvnum; drvnum = _iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); if (drvnum >= 0) _iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum);}void h_usrRoot(){ asm volatile ( "STMFD SP!, {R4,R5,LR}\n" "MOV R5, R0\n" "MOV R4, R1\n" "BL sub_FFC019D0\n" "MOV R1, R4\n" "MOV R0, R5\n" "BL sub_FFEB0A00\n" //memInit "MOV R1, R4\n" "MOV R0, R5\n" "BL sub_FFEB1478\n" //memPartLibInit "BL sub_FFC017E8\n" "BL sub_FFC01A10\n" "BL sub_FFC019F4\n" "BL sub_FFC01A3C\n" "BL sub_FFC019C4\n" ); _taskCreateHookAdd(createHook); _taskDeleteHookAdd(deleteHook); drv_self_hide(); asm volatile ( "LDMFD SP!, {R4,R5,LR}\n" "B sub_FFC07518\n" //IsEmptyWriteCache_2 );}
#30F8 PLATFORMID=12536PLATFORMOS=vxworksMEMBASEADDR=0x1900RESTARTSTART=0x50000MEMISOSTART=0x9F7D0MEMISOSIZE=0x40000ROMBASEADDR=0xffc00000TARGET_PRIMARY=$(topdir)platform/$(PLATFORM)/sub/$(PLATFORMSUB)/PRIMARY.BINPLFLAGS=-DMEMBASEADDR=$(MEMBASEADDR) -DMEMISOSTART=$(MEMISOSTART) -DMEMISOSIZE=$(MEMISOSIZE)PLFLAGS+=-DRESTARTSTART=$(RESTARTSTART)
// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!#include "stubs_asm.h"NSTUB(AllocateMemory, 0xffc01ab4)NSTUB(AllocateUncacheableMemory, 0xffc048f4)NSTUB(Close, 0xffc5d7a8)NSTUB(CreatePhysicalVram, 0xffd0c9f4)NSTUB(CreateTask, 0xffc11260)NSTUB(CreateTaskStrict, 0xffc12300)NSTUB(DisableDispatch, 0xffc11084)// Best match: 96%NSTUB(DisplayImagePhysicalScreen, 0xffd0bca0)NSTUB(EnableDispatch, 0xffc11110)NSTUB(ExecuteEventProcedure, 0xffc0680c)NSTUB(ExitTask, 0xffc11620)NSTUB(Fclose_Fut, 0xffc56a84)NSTUB(Fopen_Fut, 0xffc56a48)NSTUB(Fread_Fut, 0xffc56b68)NSTUB(FreeMemory, 0xffc01ac0)NSTUB(FreeUncacheableMemory, 0xffc04928)NSTUB(Fseek_Fut, 0xffc56c50)NSTUB(Fwrite_Fut, 0xffc56bb8)NSTUB(GetCurrentAvValue, 0xffe694a0)NSTUB(GetCurrentTargetDistance, 0xffe69448)// Best match: 96%NSTUB(GetFocusLensSubjectDistance, 0xffe5bc90)// Best match: 52%NSTUB(GetFocusLensSubjectDistanceFromLens, 0xffe5c230)// Best match: 86%NSTUB(GetParameterData, 0xffd40e2c)NSTUB(GetPropertyCase, 0xffc14518)// Best match: 96%NSTUB(GetSystemTime, 0xffc04b2c)// ALT: NSTUB(GetSystemTime, 0xffc04b2c) // 26/1// Best match: 93%NSTUB(GetZoomLensCurrentPoint, 0xffe4c738)// ALT: NSTUB(GetZoomLensCurrentPoint, 0xffe4c738) // 27/2// Best match: 93%NSTUB(GetZoomLensCurrentPosition, 0xffe4c74c)// ALT: NSTUB(GetZoomLensCurrentPosition, 0xffe4c74c) // 27/2NSTUB(IsStrobeChargeCompleted, 0xffce7fac)NSTUB(LockMainPower, 0xffd3c1f4)NSTUB(MakeDirectory, 0xffc5da4c)// Best match: 90%NSTUB(Mount_FileSystem, 0xffc5ca48)// ALT: NSTUB(Mount_FileSystem, 0xffc5ca48) // 27/3// Best match: 96%NSTUB(MoveFocusLensToDistance, 0xffe696e8)NSTUB(MoveZoomLensWithPoint, 0xffe4c618)// ALT: NSTUB(MoveZoomLensWithPoint, 0xffe4c618) // 25/0NSTUB(Open, 0xffc5d780)// Best match: 96%NSTUB(PhySw_testgpio, 0xffc17bc8)NSTUB(ProtectFile, 0xffc560b0)// Best match: 92%NSTUB(PutInNdFilter, 0xffe674bc)// ALT: NSTUB(PutInNdFilter, 0xffe674bc) // 25/2// ALT: NSTUB(PutInNdFilter, 0xffe6904c) // 25/2// ALT: NSTUB(PutInNdFilter, 0xffe6904c) // 25/2// ALT: NSTUB(PutInNdFilter, 0xffe69094) // 25/2// ALT: NSTUB(PutInNdFilter, 0xffe69094) // 25/2// Best match: 94%NSTUB(PutOutNdFilter, 0xffe67504)// ALT: NSTUB(PutOutNdFilter, 0xffe67504) // 16/1NSTUB(Read, 0xffc5d83c)NSTUB(RefreshPhysicalScreen, 0xffd52390)NSTUB(Remove, 0xffc5d7c8)NSTUB(SetAutoShutdownTime, 0xffd3c0ec)// Best match: 86%NSTUB(SetParameterData, 0xffd40d4c)NSTUB(SetPropertyCase, 0xffc143ec)NSTUB(SleepTask, 0xffc11174)NSTUB(TakeSemaphore, 0xffc10c70)NSTUB(UnlockMainPower, 0xffd3c2a8)NSTUB(Unmount_FileSystem, 0xffc5cb60)// Best match: 89%NSTUB(UnsetZoomForMovie, 0xffd76190)NSTUB(UpdateMBROnFlash, 0xffc5ccb4)// ERROR: VbattGet is not found!NSTUB(Write, 0xffc5d848)NSTUB(_log, 0xffea2c50)// ALT: NSTUB(_log, 0xffea2c50) // 27/0NSTUB(_log10, 0xffe9f128)// ALT: NSTUB(_log10, 0xffe9f128) // 27/0NSTUB(_pow, 0xffe9f2b0)// ALT: NSTUB(_pow, 0xffe9f2b0) // 25/0NSTUB(_sqrt, 0xffea104c)// ALT: NSTUB(_sqrt, 0xffea104c) // 24/0NSTUB(chdir, 0xffeaf524)// ALT: NSTUB(chdir, 0xffeaf524) // 27/0NSTUB(close, 0xffeaee64)NSTUB(closedir, 0xffeac2ec)// ERROR: free is not found!NSTUB(ints_disable, 0xffc0d6e0)NSTUB(ints_enable, 0xffc0d6ec)NSTUB(ioctl, 0xffeaefa4)NSTUB(iosDevAdd, 0xffeb0084)NSTUB(iosDrvInstall, 0xffeb0348)NSTUB(iosDevFind, 0xffeb0010)NSTUB(isalpha, 0xffea6390)// ALT: NSTUB(isalpha, 0xffea6390) // 4/0NSTUB(isdigit, 0xffea63c0)// ALT: NSTUB(isdigit, 0xffea63c0) // 4/0NSTUB(islower, 0xffea63f0)// ALT: NSTUB(islower, 0xffea63f0) // 4/0NSTUB(isspace, 0xffea6438)// ALT: NSTUB(isspace, 0xffea6438) // 4/0NSTUB(isupper, 0xffea6450)// ALT: NSTUB(isupper, 0xffea6450) // 4/0NSTUB(kbd_p1_f, 0xffc16914)NSTUB(kbd_p1_f_cont, 0xffc16920)NSTUB(kbd_p2_f, 0xffc16cf0)// Best match: 83%NSTUB(kbd_pwr_off, 0xffc18e98)// ALT: NSTUB(kbd_pwr_off, 0xffc18eb4) // 5/1// ERROR: kbd_pwr_on is not found!NSTUB(kbd_read_keys_r2, 0xffc17678)// Best match: 93%NSTUB(localtime, 0xffeaaae0)NSTUB(lseek, 0xffeaefa8)// Best match: 53%NSTUB(malloc, 0xffeb1ea4)// ALT: NSTUB(malloc, 0xffeb1ea4) // 15/13NSTUB(memcmp, 0xffea9ec0)// ALT: NSTUB(memcmp, 0xffeb6064) // 9/0NSTUB(memcpy, 0xffea9efc)NSTUB(memset, 0xffea9f74)NSTUB(mkdir, 0xffc5d990)NSTUB(open, 0xffeaf4a8)NSTUB(opendir, 0xffeac320)NSTUB(qsort, 0xffea9720)NSTUB(rand, 0xffea9744)// ALT: NSTUB(rand, 0xffea9744) // 8/0NSTUB(read, 0xffeaeec4)NSTUB(readdir, 0xffeac2b8)NSTUB(rename, 0xffeaf4b0)// ALT: NSTUB(rename, 0xffeaf4b0) // 26/0NSTUB(rewinddir, 0xffeac2e0)NSTUB(srand, 0xffea9768)// ALT: NSTUB(srand, 0xffea9768) // 4/0NSTUB(stat, 0xffeac3b4)NSTUB(strcat, 0xffea9f94)NSTUB(strchr, 0xffea9fc0)NSTUB(strcmp, 0xffea9fe4)NSTUB(strcpy, 0xffeaa178)NSTUB(strlen, 0xffeaa2dc)NSTUB(strncmp, 0xffeaa340)NSTUB(strncpy, 0xffeaa384)// ALT: NSTUB(strncpy, 0xffeaa384) // 24/0NSTUB(strpbrk, 0xffeaa3cc)NSTUB(strrchr, 0xffeaa408)// ALT: NSTUB(strrchr, 0xffeaa408) // 8/0NSTUB(strtol, 0xffea9b5c)NSTUB(taskCreateHookAdd, 0xffeb4b04)NSTUB(taskDeleteHookAdd, 0xffeb4a40)// Best match: 82%NSTUB(taskIdListGet, 0xffebeacc)NSTUB(taskLock, 0xffebf188)NSTUB(taskName, 0xffebe9c4)NSTUB(taskResume, 0xffebeda8)NSTUB(taskSuspend, 0xffebebd4)NSTUB(taskUnlock, 0xffebf230)NSTUB(time, 0xffeab82c)// ALT: NSTUB(time, 0xffeab82c) // 25/0NSTUB(utime, 0xffeac448)// ALT: NSTUB(utime, 0xffeac448) // 26/0NSTUB(vsprintf, 0xffeadc0c)NSTUB(write, 0xffeaef34)NSTUB(fprintf, 0xffea6cf0)NSTUB(fputs, 0xffea6e10)NSTUB(puts, 0xffeadfc8)
#include "stubs_asm.h"NHSTUB(VbattGet, 0xffc1bca0)NHSTUB(free, 0xFFC01B38)NHSTUB(kbd_pwr_off, 0xFFC017E8) //null stubNHSTUB(kbd_pwr_on, 0xFFC017E8) //null stubNHSTUB(SetZoomActuatorSpeedPercent, 0xFFC017E8) //null stubNHSTUB(GetDrive_ClusterSize, 0xFFE1CFBC)NHSTUB(GetDrive_TotalClusters, 0xFFE1CFF8)NHSTUB(GetDrive_FreeClusters, 0xFFE1D034)
Have you succeed porting on A430 now?Just found about CHDK a few days ago. I have A430.I have everything (I think) needed to do porting after digging this forum, just don't know where to start.
Started by xcaogu CHDK Releases
Started by jodern Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by bowkers General Help and Assistance on using CHDK stable releases
Started by PollyWell General Help and Assistance on using CHDK stable releases
Started by psxpetey DryOS Development