Changeset 93


Ignore:
Timestamp:
04/10/07 16:00:18 (6 years ago)
Author:
vitalyb
Message:
  • GNU GPL Copyright
  • support for DISKBOOT
Location:
trunk
Files:
1 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r64 r93  
    2121             $(topdir)/bin/main.bin\ 
    2222            $(PLATFORMID) 
    23         rm $(topdir)/bin/main.bin 
     23        mv $(topdir)/bin/main.bin $(topdir)/bin/DISKBOOT.BIN 
    2424        @echo "**** Firmware creation completed successfully" 
    2525 
     
    3838        LANG=C echo -e "hdk-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:`date -R`" | \ 
    3939            zip -9jc $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
     40        zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB).zip $(topdir)bin/DISKBOOT.BIN > $(DEVNULL) 
    4041        rm -f $(topdir)bin/PS.FIR 
     42        rm -f $(topdir)bin/DISKBOOT.BIN 
    4143 
    4244batch-zip: 
  • trunk/core/entry.S

    r1 r93  
    44 
    55_start: 
    6  
     6        MOV     R0, #2 
    77        TEQ     R0, #2 
    88        LDR     SP, =0x1900 
  • trunk/core/gui.c

    r81 r93  
    2727 
    2828static void gui_menuproc_save(); 
     29static void gui_menuproc_mkbootdisk(); 
    2930 
    3031#define MENUSTACK_MAXDEPTH 2 
     
    7071    {"Scripting parameters ->", MENUITEM_SUBMENU, (int*)script_submenu }, 
    7172    {"Debug parameters ->", MENUITEM_SUBMENU, (int*)debug_submenu }, 
     73    {"Make card bootable...", MENUITEM_PROC, (int*)gui_menuproc_mkbootdisk }, 
    7274    {"Save options now...", MENUITEM_PROC, (int*)gui_menuproc_save }, 
    7375    {0} 
    7476}; 
     77 
    7578 
    7679static CMenuItem *curr_menu; 
     
    435438    conf_save(); 
    436439} 
     440 
     441void gui_menuproc_mkbootdisk() 
     442{ 
     443    mark_filesystem_bootable(); 
     444} 
  • trunk/core/main.c

    r81 r93  
    107107} 
    108108 
     109 
    109110void core_spytask() 
    110111{ 
     
    113114 
    114115    SleepTask(1000); 
     116 
     117    remount_filesystem(); 
    115118 
    116119    gui_init(); 
  • trunk/include/platform.h

    r81 r93  
    2727/******************************************************************/ 
    2828 
     29long get_tick_count(); 
     30 
     31void remount_filesystem(); 
     32void mark_filesystem_bootable(); 
     33 
     34/******************************************************************/ 
     35 
    2936long get_parameter_data(long id, void *buf, long bufsize); 
    3037long set_parameter_data(long id, void *buf, long bufsize); 
    31  
    32 long get_tick_count(); 
    3338 
    3439long get_next_photo_dirfile_num(); 
  • trunk/loader/a610/entry.S

    r1 r93  
    44 
    55_start: 
     6 
     7// LED on (debug indicator) 
     8        LDR     R3, =0xc0220084 
     9        MOV     R2, #0x46 
     10        STR     R2, [R3] 
     11 
     12 
     13// Turn OFF SD Card power 
     14// to support autostart 
     15 
     16        LDR     R3, =0xC02200BC 
     17        MOV     R2, #0x44 
     18        STR     R2, [R3] 
     19 
     20 
     21// looks like idle cycle is required for proper shutdown 
     22        MOV     R3, #0x8000 
     23wait1: 
     24        SUB     R3, R3, #1 
     25        CMP     R3, #0 
     26        BNE     wait1 
     27 
     28// LED off 
     29        LDR     R3, =0xc0220084 
     30        MOV     R2, #0x44 
     31        STR     R2, [R3] 
     32 
    633        MOV     SP, #0x1900 
    734        MOV     R11, #0 
  • trunk/loader/a620/entry.S

    r1 r93  
    44 
    55_start: 
     6 
     7// LED on (debug indicator) 
     8        LDR     R3, =0xc0220084 
     9        MOV     R2, #0x46 
     10        STR     R2, [R3] 
     11 
     12 
     13// Turn OFF SD Card power 
     14// to support autostart 
     15 
     16        LDR     R3, =0xC02200BC 
     17        MOV     R2, #0x44 
     18        STR     R2, [R3] 
     19 
     20 
     21// looks like idle cycle is required for proper shutdown 
     22        MOV     R3, #0x8000 
     23wait1: 
     24        SUB     R3, R3, #1 
     25        CMP     R3, #0 
     26        BNE     wait1 
     27 
     28// LED off 
     29        LDR     R3, =0xc0220084 
     30        MOV     R2, #0x44 
     31        STR     R2, [R3] 
     32 
    633        MOV     SP, #0x1900 
    734        MOV     R11, #0 
  • trunk/loader/a630/entry.S

    r34 r93  
    44 
    55_start: 
     6 
     7// LED on (debug indicator) 
     8        LDR     R3, =0xc0220084 
     9        MOV     R2, #0x46 
     10        STR     R2, [R3] 
     11 
     12 
     13// Turn OFF SD Card power 
     14// to support autostart 
     15 
     16        LDR     R3, =0xC02200BC 
     17        MOV     R2, #0x44 
     18        STR     R2, [R3] 
     19 
     20 
     21// looks like idle cycle is required for proper shutdown 
     22        MOV     R3, #0x8000 
     23wait1: 
     24        SUB     R3, R3, #1 
     25        CMP     R3, #0 
     26        BNE     wait1 
     27 
     28// LED off 
     29        LDR     R3, =0xc0220084 
     30        MOV     R2, #0x44 
     31        STR     R2, [R3] 
     32 
    633        MOV     SP, #0x1900 
    734        MOV     R11, #0 
  • trunk/loader/a640/entry.S

    r64 r93  
    44 
    55_start: 
     6 
     7// LED on (debug indicator) 
     8        LDR     R3, =0xc0220084 
     9        MOV     R2, #0x46 
     10        STR     R2, [R3] 
     11 
     12 
     13// Turn OFF SD Card power 
     14// to support autostart 
     15 
     16        LDR     R3, =0xC02200BC 
     17        MOV     R2, #0x44 
     18        STR     R2, [R3] 
     19 
     20 
     21// looks like idle cycle is required for proper shutdown 
     22        MOV     R3, #0x8000 
     23wait1: 
     24        SUB     R3, R3, #1 
     25        CMP     R3, #0 
     26        BNE     wait1 
     27 
     28// LED off 
     29        LDR     R3, =0xc0220084 
     30        MOV     R2, #0x44 
     31        STR     R2, [R3] 
     32 
    633        MOV     SP, #0x1900 
    734        MOV     R11, #0 
  • trunk/loader/a710/entry.S

    r6 r93  
    44 
    55_start: 
     6 
     7// LED on (debug indicator) 
     8        LDR     R3, =0xc0220084 
     9        MOV     R2, #0x46 
     10        STR     R2, [R3] 
     11 
     12 
     13// Turn OFF SD Card power 
     14// to support autostart 
     15 
     16        LDR     R3, =0xC02200BC 
     17        MOV     R2, #0x44 
     18        STR     R2, [R3] 
     19 
     20 
     21// looks like idle cycle is required for proper shutdown 
     22        MOV     R3, #0x8000 
     23wait1: 
     24        SUB     R3, R3, #1 
     25        CMP     R3, #0 
     26        BNE     wait1 
     27 
     28// LED off 
     29        LDR     R3, =0xc0220084 
     30        MOV     R2, #0x44 
     31        STR     R2, [R3] 
     32 
    633        MOV     SP, #0x1900 
    734        MOV     R11, #0 
  • trunk/platform/a610/main.c

    r81 r93  
    2626extern void RefreshPhysicalScreen(long f); 
    2727extern long IsStrobeChargeCompleted(); 
    28  
     28extern void Unmount_FileSystem(); 
     29extern void Mount_FileSystem(); 
     30 
     31/* Canon stuff with nonoriginal naming */ 
    2932extern long GetParameterData(long id, void *buf, long size); 
    3033extern long SetParameterData(long id, void *buf, long size); 
     34extern void UpdateMBROnFlash(int driveno, long offset, char *str); 
    3135 
    3236/* Ours stuff */ 
     
    3640extern void boot(); 
    3741extern void *get_parameter_data_magic_pointer(); 
     42 
     43#define SD_READONLY_FLAG (0x20000) 
    3844 
    3945/* 
     
    288294#endif 
    289295 
     296 
    290297    if (kbd_process() == 0){ 
    291298        // leave it alone... 
     
    293300        physw_status[1] = kbd_new_state[1]; 
    294301        physw_status[2] = kbd_new_state[2]; 
    295 #if 1 
     302#if 0 
    296303        kbd_mod_state = kbd_new_state[2]; 
    297304#endif 
    298305    } else { 
    299306        // override keys 
    300 #if 1 
     307#if 0 
    301308        physw_status[2] = kbd_mod_state; 
    302309#else 
     
    308315    } 
    309316 
    310     kbd_read_keys_r2(physw_status); // have no idea what's that 
    311      
     317    kbd_read_keys_r2(physw_status); 
     318    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG; 
     319 
    312320    kbd_pwr_off(); 
     321 
    313322} 
    314323 
     
    686695    return (dirnum << 16) | (filenum); 
    687696} 
     697 
     698void remount_filesystem() 
     699{ 
     700    Unmount_FileSystem(); 
     701    Mount_FileSystem(); 
     702} 
     703 
     704 
     705void mark_filesystem_bootable() 
     706{ 
     707    UpdateMBROnFlash(0, 0x40, "BOOTDISK"); 
     708} 
  • trunk/platform/a610/sub/100e/boot.c

    r63 r93  
    77extern int taskCreateHookAdd (void *createHook); 
    88extern int taskDeleteHookAdd (void *deleteHook); 
     9extern long iosDevAdd(void*,void*,int); 
     10extern long iosDrvInstall(void*,void*,void*,void*,void*,void*,void*); 
    911 
    1012/* Ours stuff */ 
     
    112114} 
    113115 
     116static long drv_struct[16]; 
     117 
     118long dh_err() 
     119{ 
     120    return -1; 
     121} 
     122 
     123void drv_self_hide() 
     124{ 
     125    long drvnum; 
     126     
     127    drvnum = iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); 
     128    if (drvnum >= 0) 
     129        iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum); 
     130} 
    114131 
    115132void  h_usrRoot() 
     
    140157    taskDeleteHookAdd(deleteHook); 
    141158 
     159    drv_self_hide(); 
     160 
    142161    asm volatile ( 
    143162        "LDMFD   SP!, {R4,R5,LR}\n" 
     
    146165} 
    147166 
    148  
  • trunk/platform/a610/sub/100e/stubs_entry.S

    r79 r93  
    2525NSTUB(ints_enable, 0xffc0d5f8) 
    2626NSTUB(ioctl, 0xffebbf9c) 
     27NSTUB(iosDevAdd, 0xffebd07c) 
     28NSTUB(iosDrvInstall, 0xffebd340) 
    2729NSTUB(IsStrobeChargeCompleted, 0xffcebe00) 
    2830NSTUB(kbd_p1_f_cont, 0xffc16190) 
     
    4042NSTUB(memset, 0xffeb5a84) 
    4143NSTUB(mkdir, 0xffc5c8f4) 
     44NSTUB(Mount_FileSystem, 0xffc5b9c0) 
    4245NSTUB(open, 0xffebc4a0) 
    4346NSTUB(Open, 0xffc5c6e4) 
     
    6366NSTUB(taskSuspend, 0xffeccbe8) 
    6467NSTUB(taskUnlock, 0xffecd244) 
     68NSTUB(Unmount_FileSystem, 0xffc5bac8) 
     69NSTUB(UpdateMBROnFlash, 0xffc5bc20) 
    6570NSTUB(write, 0xffebbf2c) 
    6671NSTUB(Write, 0xffc5c7ac) 
  • trunk/platform/a610/sub/100f/boot.c

    r63 r93  
    77extern int taskCreateHookAdd (void *createHook); 
    88extern int taskDeleteHookAdd (void *deleteHook); 
     9extern long iosDevAdd(void*,void*,int); 
     10extern long iosDrvInstall(void*,void*,void*,void*,void*,void*,void*); 
    911 
    1012/* Ours stuff */ 
     
    112114} 
    113115 
     116static long drv_struct[16]; 
     117  
     118long dh_err() 
     119{ 
     120    return -1; 
     121} 
     122 
     123void drv_self_hide() 
     124{ 
     125    long drvnum; 
     126     
     127    drvnum = iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); 
     128    if (drvnum >= 0) 
     129        iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum); 
     130} 
     131 
    114132 
    115133void  h_usrRoot() 
     
    139157    taskDeleteHookAdd(deleteHook); 
    140158 
     159    drv_self_hide(); 
     160 
    141161    asm volatile ( 
    142162        "LDMFD   SP!, {R4,R5,LR}\n" 
  • trunk/platform/a610/sub/100f/stubs_entry.S

    r79 r93  
    2525NSTUB(ints_enable, 0xffc0d5f8) 
    2626NSTUB(ioctl, 0xffebc324) 
     27NSTUB(iosDevAdd, 0xffebd404) 
     28NSTUB(iosDrvInstall, 0xffebd6c8) 
    2729NSTUB(IsStrobeChargeCompleted, 0xffcec188) 
    2830NSTUB(kbd_p1_f_cont, 0xffc16190) 
     
    4042NSTUB(memset, 0xffeb5e0c) 
    4143NSTUB(mkdir, 0xffc5cc7c) 
     44NSTUB(Mount_FileSystem, 0xffc5bd48) 
    4245NSTUB(open, 0xffebc828) 
    4346NSTUB(Open, 0xffc5ca6c) 
     
    6366NSTUB(taskSuspend, 0xffeccf70) 
    6467NSTUB(taskUnlock, 0xffecd5cc) 
     68NSTUB(Unmount_FileSystem, 0xffc5be50) 
     69NSTUB(UpdateMBROnFlash, 0xffc5bfa8) 
    6570NSTUB(write, 0xffebc2b4) 
    6671NSTUB(Write, 0xffc5cb34) 
  • trunk/platform/a620/main.c

    r79 r93  
    2525extern void RefreshPhysicalScreen(long f); 
    2626extern long IsStrobeChargeCompleted(); 
     27extern void Unmount_FileSystem(); 
     28extern void Mount_FileSystem(); 
    2729 
    2830extern long GetParameterData(long id, void *buf, long size); 
    2931extern long SetParameterData(long id, void *buf, long size); 
     32extern void UpdateMBROnFlash(int driveno, long offset, char *str); 
    3033 
    3134/* Ours stuff */ 
     
    3538extern void boot(); 
    3639 
     40#define SD_READONLY_FLAG (0x20000) 
    3741 
    3842/* 
     
    280284        physw_status[1] = kbd_new_state[1]; 
    281285        physw_status[2] = kbd_new_state[2]; 
    282 #if 1 
     286#if 0 
    283287        kbd_mod_state = kbd_new_state[2]; 
    284288#endif 
    285289    } else { 
    286290        // override keys 
    287 #if 1 
     291#if 0 
    288292        physw_status[2] = kbd_mod_state; 
    289293#else 
     
    295299    } 
    296300 
    297     kbd_read_keys_r2(physw_status); // have no idea what's that 
     301    kbd_read_keys_r2(physw_status); 
     302    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG; 
    298303     
    299304    kbd_pwr_off(); 
     
    645650} 
    646651 
     652/* stub */ 
     653long get_next_photo_dirfile_num()  
     654{ 
     655    return (100 << 16) | (0); 
     656} 
     657 
     658void remount_filesystem() 
     659{ 
     660    Unmount_FileSystem(); 
     661    Mount_FileSystem(); 
     662} 
     663 
     664void mark_filesystem_bootable() 
     665{ 
     666    UpdateMBROnFlash(0, 0x40, "BOOTDISK"); 
     667} 
  • trunk/platform/a620/sub/100f/boot.c

    r63 r93  
    77extern int taskCreateHookAdd (void *createHook); 
    88extern int taskDeleteHookAdd (void *deleteHook); 
     9extern long iosDevAdd(void*,void*,int); 
     10extern long iosDrvInstall(void*,void*,void*,void*,void*,void*,void*); 
    911 
    1012/* Ours stuff */ 
     
    112114} 
    113115 
     116static long drv_struct[16]; 
     117  
     118long dh_err() 
     119{ 
     120    return -1; 
     121} 
     122 
     123void drv_self_hide() 
     124{ 
     125    long drvnum; 
     126     
     127    drvnum = iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); 
     128    if (drvnum >= 0) 
     129        iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum); 
     130} 
     131 
    114132 
    115133void  h_usrRoot() 
     
    139157    taskDeleteHookAdd(deleteHook); 
    140158 
     159    drv_self_hide(); 
     160 
    141161    asm volatile ( 
    142162        "LDMFD   SP!, {R4,R5,LR}\n" 
  • trunk/platform/a620/sub/100f/stubs_entry.S

    r79 r93  
    2525NSTUB(ints_enable, 0xffc0d5d8) 
    2626NSTUB(ioctl, 0xffec2cc0) 
     27NSTUB(iosDevAdd, 0xffec3da0) 
     28NSTUB(iosDrvInstall, 0xffec4064) 
    2729NSTUB(IsStrobeChargeCompleted, 0xffcec238) 
    2830NSTUB(kbd_p1_f_cont, 0xffc16170) 
     
    4042NSTUB(memset, 0xffebc7a8) 
    4143NSTUB(mkdir, 0xffc5d074) 
     44// Best match: 85% 
     45NSTUB(Mount_FileSystem, 0xffc5c140) 
     46// ALT: NSTUB(Mount_FileSystem, 0xffc5c140) // 17/3 
    4247NSTUB(open, 0xffec31c4) 
    4348NSTUB(Open, 0xffc5ce64) 
     
    6469NSTUB(taskSuspend, 0xffed390c) 
    6570NSTUB(taskUnlock, 0xffed3f68) 
     71NSTUB(Unmount_FileSystem, 0xffc5c248) 
     72NSTUB(UpdateMBROnFlash, 0xffc5c3a0) 
    6673NSTUB(write, 0xffec2c50) 
    6774NSTUB(Write, 0xffc5cf2c) 
  • trunk/platform/a630/main.c

    r79 r93  
    2525extern void RefreshPhysicalScreen(long f); 
    2626extern long IsStrobeChargeCompleted(); 
     27extern void Unmount_FileSystem(); 
     28extern void Mount_FileSystem(); 
    2729 
    2830extern long GetParameterData(long id, void *buf, long size); 
    2931extern long SetParameterData(long id, void *buf, long size); 
     32extern void UpdateMBROnFlash(int driveno, long offset, char *str); 
    3033 
    3134/* Ours stuff */ 
     
    3538extern void boot(); 
    3639 
     40#define SD_READONLY_FLAG (0x20000) 
    3741 
    3842/* 
     
    280284        physw_status[1] = kbd_new_state[1]; 
    281285        physw_status[2] = kbd_new_state[2]; 
    282 #if 1 
     286#if 0 
    283287        kbd_mod_state = kbd_new_state[2]; 
    284288#endif 
    285289    } else { 
    286290        // override keys 
    287 #if 1 
     291#if 0 
    288292        physw_status[2] = kbd_mod_state; 
    289293#else 
     
    295299    } 
    296300 
    297     kbd_read_keys_r2(physw_status); // have no idea what's that 
     301    kbd_read_keys_r2(physw_status); 
     302    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG; 
    298303     
    299304    kbd_pwr_off(); 
     
    644649} 
    645650 
     651/* stub */ 
     652long get_next_photo_dirfile_num()  
     653{ 
     654    return (100 << 16) | (0); 
     655} 
     656 
     657void remount_filesystem() 
     658{ 
     659    Unmount_FileSystem(); 
     660    Mount_FileSystem(); 
     661} 
     662 
     663void mark_filesystem_bootable() 
     664{ 
     665    UpdateMBROnFlash(0, 0x40, "BOOTDISK"); 
     666} 
  • trunk/platform/a630/sub/100c/boot.c

    r63 r93  
    77extern int taskCreateHookAdd (void *createHook); 
    88extern int taskDeleteHookAdd (void *deleteHook); 
     9extern long iosDevAdd(void*,void*,int); 
     10extern long iosDrvInstall(void*,void*,void*,void*,void*,void*,void*); 
    911 
    1012/* Ours stuff */ 
     
    112114} 
    113115 
     116static long drv_struct[16]; 
     117  
     118long dh_err() 
     119{ 
     120    return -1; 
     121} 
     122 
     123void drv_self_hide() 
     124{ 
     125    long drvnum; 
     126     
     127    drvnum = iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); 
     128    if (drvnum >= 0) 
     129        iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum); 
     130} 
     131 
    114132 
    115133void  h_usrRoot() 
     
    136154    taskDeleteHookAdd(deleteHook); 
    137155 
     156    drv_self_hide(); 
     157 
    138158    asm volatile ( 
    139159        "LDMFD   SP!, {R4,R5,LR}\n" 
  • trunk/platform/a630/sub/100c/stubs_entry.S

    r79 r93  
    2929NSTUB(ints_enable, 0xffc0debc) 
    3030NSTUB(ioctl, 0xffef0378) 
     31NSTUB(iosDevAdd, 0xffef1458) 
     32NSTUB(iosDrvInstall, 0xffef171c) 
    3133// Best match: 94% 
    3234NSTUB(IsStrobeChargeCompleted, 0xffd08620) 
     
    4547NSTUB(memset, 0xffeeb348) 
    4648NSTUB(mkdir, 0xffc61740) 
     49// Best match: 85% 
     50NSTUB(Mount_FileSystem, 0xffc60810) 
     51// ALT: NSTUB(Mount_FileSystem, 0xffc60810) // 17/3 
    4752NSTUB(open, 0xffef087c) 
    4853NSTUB(Open, 0xffc614c0) 
     
    7075NSTUB(taskSuspend, 0xffefffa8) 
    7176NSTUB(taskUnlock, 0xfff00604) 
     77NSTUB(Unmount_FileSystem, 0xffc608b4) 
     78NSTUB(UpdateMBROnFlash, 0xffc60a08) 
    7279NSTUB(write, 0xffef0308) 
    7380NSTUB(Write, 0xffc61588) 
  • trunk/platform/a640/main.c

    r79 r93  
    2525extern void RefreshPhysicalScreen(long f); 
    2626extern long IsStrobeChargeCompleted(); 
     27extern void Unmount_FileSystem(); 
     28extern void Mount_FileSystem(); 
    2729 
    2830extern long GetParameterData(long id, void *buf, long size); 
    2931extern long SetParameterData(long id, void *buf, long size); 
     32extern void UpdateMBROnFlash(int driveno, long offset, char *str); 
    3033 
    3134/* Ours stuff */ 
     
    3538extern void boot(); 
    3639 
     40#define SD_READONLY_FLAG (0x20000) 
    3741 
    3842/* 
     
    280284        physw_status[1] = kbd_new_state[1]; 
    281285        physw_status[2] = kbd_new_state[2]; 
    282 #if 1 
     286#if 0 
    283287        kbd_mod_state = kbd_new_state[2]; 
    284288#endif 
    285289    } else { 
    286290        // override keys 
    287 #if 1 
     291#if 0 
    288292        physw_status[2] = kbd_mod_state; 
    289293#else 
     
    295299    } 
    296300 
    297     kbd_read_keys_r2(physw_status); // have no idea what's that 
     301    kbd_read_keys_r2(physw_status); 
     302    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG; 
    298303     
    299304    kbd_pwr_off(); 
     
    644649} 
    645650 
     651/* stub */ 
     652long get_next_photo_dirfile_num()  
     653{ 
     654    return (100 << 16) | (0); 
     655} 
     656 
     657void remount_filesystem() 
     658{ 
     659    Unmount_FileSystem(); 
     660    Mount_FileSystem(); 
     661} 
     662 
     663void mark_filesystem_bootable() 
     664{ 
     665    UpdateMBROnFlash(0, 0x40, "BOOTDISK"); 
     666} 
  • trunk/platform/a640/sub/100b/boot.c

    r64 r93  
    77extern int taskCreateHookAdd (void *createHook); 
    88extern int taskDeleteHookAdd (void *deleteHook); 
     9extern long iosDevAdd(void*,void*,int); 
     10extern long iosDrvInstall(void*,void*,void*,void*,void*,void*,void*); 
    911 
    1012/* Ours stuff */ 
     
    112114} 
    113115 
     116static long drv_struct[16]; 
     117  
     118long dh_err() 
     119{ 
     120    return -1; 
     121} 
     122 
     123void drv_self_hide() 
     124{ 
     125    long drvnum; 
     126     
     127    drvnum = iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); 
     128    if (drvnum >= 0) 
     129        iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum); 
     130} 
     131 
    114132 
    115133void  h_usrRoot() 
     
    136154    taskDeleteHookAdd(deleteHook); 
    137155 
     156    drv_self_hide(); 
     157 
    138158    asm volatile ( 
    139159        "LDMFD   SP!, {R4,R5,LR}\n" 
  • trunk/platform/a640/sub/100b/stubs_entry.S

    r79 r93  
    3333NSTUB(ints_enable, 0xffc0debc) 
    3434NSTUB(ioctl, 0xffefa2a0) 
     35NSTUB(iosDevAdd, 0xffefb380) 
     36NSTUB(iosDrvInstall, 0xffefb644) 
    3537// Best match: 94% 
    3638NSTUB(IsStrobeChargeCompleted, 0xffd0a4a8) 
     
    4951NSTUB(memset, 0xffef5270) 
    5052NSTUB(mkdir, 0xffc62800) 
     53// Best match: 85% 
     54NSTUB(Mount_FileSystem, 0xffc618d0) 
     55// ALT: NSTUB(Mount_FileSystem, 0xffc618d0) // 17/3 
    5156NSTUB(open, 0xffefa7a4) 
    5257NSTUB(Open, 0xffc62580) 
     
    7479NSTUB(taskSuspend, 0xfff09ed0) 
    7580NSTUB(taskUnlock, 0xfff0a52c) 
     81NSTUB(Unmount_FileSystem, 0xffc61974) 
     82NSTUB(UpdateMBROnFlash, 0xffc61ac8) 
    7683NSTUB(write, 0xffefa230) 
    7784NSTUB(Write, 0xffc62648) 
  • trunk/platform/a710/main.c

    r79 r93  
    2525extern void RefreshPhysicalScreen(long f); 
    2626extern long IsStrobeChargeCompleted(); 
     27extern void Unmount_FileSystem(); 
     28extern void Mount_FileSystem(); 
    2729 
    2830extern long GetParameterData(long id, void *buf, long size); 
    2931extern long SetParameterData(long id, void *buf, long size); 
     32extern void UpdateMBROnFlash(int driveno, long offset, char *str); 
    3033 
    3134/* Ours stuff */ 
     
    3538extern void boot(); 
    3639 
     40#define SD_READONLY_FLAG (0x20000) 
    3741 
    3842/* 
     
    280284        physw_status[1] = kbd_new_state[1]; 
    281285        physw_status[2] = kbd_new_state[2]; 
    282 #if 1 
     286#if 0 
    283287        kbd_mod_state = kbd_new_state[2]; 
    284288#endif 
    285289    } else { 
    286290        // override keys 
    287 #if 1 
     291#if 0 
    288292        physw_status[2] = kbd_mod_state; 
    289293#else 
     
    295299    } 
    296300 
    297     kbd_read_keys_r2(physw_status); // have no idea what's that 
     301    kbd_read_keys_r2(physw_status); 
     302    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG; 
    298303     
    299304    kbd_pwr_off(); 
     
    644649} 
    645650 
     651/* stub */ 
     652long get_next_photo_dirfile_num()  
     653{ 
     654    return (100 << 16) | (0); 
     655} 
     656 
     657void remount_filesystem() 
     658{ 
     659    Unmount_FileSystem(); 
     660    Mount_FileSystem(); 
     661} 
     662 
     663void mark_filesystem_bootable() 
     664{ 
     665    UpdateMBROnFlash(0, 0x40, "BOOTDISK"); 
     666} 
  • trunk/platform/a710/sub/100a/boot.c

    r65 r93  
    77extern int taskCreateHookAdd (void *createHook); 
    88extern int taskDeleteHookAdd (void *deleteHook); 
     9extern long iosDevAdd(void*,void*,int); 
     10extern long iosDrvInstall(void*,void*,void*,void*,void*,void*,void*); 
    911 
    1012/* Ours stuff */ 
     
    112114} 
    113115 
     116static long drv_struct[16]; 
     117  
     118long dh_err() 
     119{ 
     120    return -1; 
     121} 
     122 
     123void drv_self_hide() 
     124{ 
     125    long drvnum; 
     126     
     127    drvnum = iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err); 
     128    if (drvnum >= 0) 
     129        iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum); 
     130} 
     131 
    114132 
    115133void  h_usrRoot() 
     
    136154    taskDeleteHookAdd(deleteHook); 
    137155 
     156    drv_self_hide(); 
     157 
    138158    asm volatile ( 
    139159        "LDMFD   SP!, {R4,R5,LR}\n" 
  • trunk/platform/a710/sub/100a/stubs_entry.S

    r79 r93  
    2828NSTUB(ints_enable, 0xffc0debc) 
    2929NSTUB(ioctl, 0xffefdbc0) 
     30NSTUB(iosDevAdd, 0xffefeca0) 
     31NSTUB(iosDrvInstall, 0xffefef64) 
    3032// Best match: 94% 
    3133NSTUB(IsStrobeChargeCompleted, 0xffd11b24) 
     
    4446NSTUB(memset, 0xffef8b90) 
    4547NSTUB(mkdir, 0xffc6121c) 
     48NSTUB(Mount_FileSystem, 0xffc602ec) 
    4649NSTUB(open, 0xffefe0c4) 
    4750NSTUB(Open, 0xffc60f9c) 
     
    6972NSTUB(taskSuspend, 0xfff0d7f0) 
    7073NSTUB(taskUnlock, 0xfff0de4c) 
     74NSTUB(Unmount_FileSystem, 0xffc60390) 
     75NSTUB(UpdateMBROnFlash, 0xffc604e4) 
    7176NSTUB(write, 0xffefdb50) 
    7277NSTUB(Write, 0xffc61064) 
  • trunk/tools/sig_ref_1.txt

    r79 r93  
    6060SetParameterData 0xFFD4E21C 
    6161GetParameterData 0xFFD4E2FC 
     62iosDevAdd 0xFFEBD07C 
     63iosDrvInstall 0xFFEBD340 
     64Unmount_FileSystem 0xFFC5BAC8 
     65Mount_FileSystem 0xFFC5B9C0 
     66UpdateMBROnFlash 0xFFC5BC20 
  • trunk/tools/sig_ref_2.txt

    r79 r93  
    66SetParameterData 0xFFD75FB0 
    77GetParameterData 0xFFD76090 
     8Mount_FileSystem 0xffc602ec 
  • trunk/tools/signatures.h

    r79 r93  
    14971497}; 
    14981498 
     1499static FuncSig func_sig_iosDevAdd_1[] = { 
     1500        {   1, 0xe1a0a000, 0xfdffffff }, 
     1501        {   2, 0xe1a0b001, 0xfdffffff }, 
     1502        {   3, 0xe1a09002, 0xfdffffff }, 
     1503        {   4, 0xe1a00001, 0xfdffffff }, 
     1504        {   5, 0xeb000000, 0xff000000 }, 
     1505        {   6, 0xe1b01000, 0xfdffffff }, 
     1506        {   7, 0x0a000000, 0xff000000 }, 
     1507        {   9, 0xe1a0100b, 0xfdffffff }, 
     1508        {  10, 0xeb000000, 0xff000000 }, 
     1509        {  11, 0xe1500000, 0xfdffffff }, 
     1510        {  12, 0x1a000000, 0xff000000 }, 
     1511        {  14, 0xeb000000, 0xff000000 }, 
     1512        {  16, 0xea000000, 0xff000000 }, 
     1513        {  17, 0xe1a0000b, 0xfdffffff }, 
     1514        {  18, 0xeb000000, 0xff000000 }, 
     1515        {  19, 0xe0800001, 0xfdffffff }, 
     1516        {  20, 0xeb000000, 0xff000000 }, 
     1517        {  21, 0xe1b01000, 0xfdffffff }, 
     1518        {  22, 0xe1ca90b8, 0xfdffffff }, 
     1519        {  25, 0x0a000000, 0xff000000 }, 
     1520        {  26, 0xe1a00001, 0xfdffffff }, 
     1521        {  27, 0xe1a0100b, 0xfdffffff }, 
     1522        {  28, 0xeb000000, 0xff000000 }, 
     1523        {  29, 0xeb000000, 0xff000000 }, 
     1524        {  31, 0xe1a0100a, 0xfdffffff }, 
     1525        { -1, -1, -1 }, 
     1526        /* 25/32 */ 
     1527}; 
     1528 
     1529static FuncSig func_sig_iosDrvInstall_1[] = { 
     1530        {   3, 0xe1a0b000, 0xfdffffff }, 
     1531        {   4, 0xe1a07000, 0xfdffffff }, 
     1532        {   5, 0xe1a06001, 0xfdffffff }, 
     1533        {   6, 0xe1a05002, 0xfdffffff }, 
     1534        {   7, 0xe1a04003, 0xfdffffff }, 
     1535        {   8, 0xeb000000, 0xff000000 }, 
     1536        {  11, 0xe1500001, 0xfdffffff }, 
     1537        {  12, 0xda000000, 0xff000000 }, 
     1538        {  14, 0xe040a001, 0xfdffffff }, 
     1539        {  16, 0xe08c1020, 0xfdffffff }, 
     1540        {  18, 0xe15c0000, 0xfdffffff }, 
     1541        {  19, 0x01a0b001, 0xfdffffff }, 
     1542        {  20, 0x0a000000, 0xff000000 }, 
     1543        {  21, 0xe05aa001, 0xfdffffff }, 
     1544        {  22, 0xe0811020, 0xfdffffff }, 
     1545        {  23, 0x1a000000, 0xff000000 }, 
     1546        {  24, 0xe15b0000, 0xfdffffff }, 
     1547        {  25, 0xe040a00a, 0xfdffffff }, 
     1548        {  26, 0x1a000000, 0xff000000 }, 
     1549        {  28, 0xeb000000, 0xff000000 }, 
     1550        {  29, 0xeb000000, 0xff000000 }, 
     1551        {  31, 0xea000000, 0xff000000 }, 
     1552        { -1, -1, -1 }, 
     1553        /* 22/32 */ 
     1554}; 
     1555 
     1556static FuncSig func_sig_Unmount_FileSystem_1[] = { 
     1557        {   1, 0xe04dd004, 0xfdffffff }, 
     1558        {   2, 0xe1a0600d, 0xfdffffff }, 
     1559        {   4, 0xe1a02002, 0xfdffffff }, 
     1560        {   5, 0xe1a00006, 0xfdffffff }, 
     1561        {   6, 0xeb000000, 0xff000000 }, 
     1562        {   9, 0xe1a03000, 0xfdffffff }, 
     1563        {  12, 0xe0835041, 0xfdffffff }, 
     1564        {  13, 0xe08c1054, 0xfdffffff }, 
     1565        {  15, 0xe1a00006, 0xfdffffff }, 
     1566        {  18, 0xeb000000, 0xff000000 }, 
     1567        {  19, 0xe08dd004, 0xfdffffff }, 
     1568        {  21, 0xe1a0f00e, 0xfdffffff }, 
     1569        /* RET found, stopping... */ 
     1570        { -1, -1, -1 }, 
     1571        /* 12/32 */ 
     1572}; 
     1573 
     1574static FuncSig func_sig_Mount_FileSystem_1[] = { 
     1575        {   1, 0xe1a05000, 0xfdffffff }, 
     1576        {   3, 0xe1a00005, 0xfdffffff }, 
     1577        {   4, 0xeb000000, 0xff000000 }, 
     1578        {   6, 0xeb000000, 0xff000000 }, 
     1579        {   7, 0xe0501000, 0xfdffffff }, 
     1580        {   8, 0xe1a00005, 0xfdffffff }, 
     1581        {   9, 0x1a000000, 0xff000000 }, 
     1582        {  16, 0xeb000000, 0xff000000 }, 
     1583        {  17, 0xe1a00005, 0xfdffffff }, 
     1584        {  18, 0xeb000000, 0xff000000 }, 
     1585        {  19, 0xe1a04000, 0xfdffffff }, 
     1586        {  20, 0xe1a00005, 0xfdffffff }, 
     1587        {  21, 0xeb000000, 0xff000000 }, 
     1588        {  22, 0xe0044000, 0xfdffffff }, 
     1589        {  23, 0xe1a02004, 0xfdffffff }, 
     1590        {  24, 0xe1a00006, 0xfdffffff }, 
     1591        {  26, 0xeb000000, 0xff000000 }, 
     1592        {  29, 0x0002e008, 0xfdffffff }, 
     1593        {  30, 0x00002830, 0xfdffffff }, 
     1594        {  31, 0x00002828, 0xfdffffff }, 
     1595        { -1, -1, -1 }, 
     1596        /* 20/32 */ 
     1597}; 
     1598 
     1599static FuncSig func_sig_UpdateMBROnFlash_1[] = { 
     1600        {   1, 0xe1a04000, 0xfdffffff }, 
     1601        {   2, 0xe1a09002, 0xfdffffff }, 
     1602        {   3, 0xe1a07001, 0xfdffffff }, 
     1603        {   4, 0xe1a02000, 0xfdffffff }, 
     1604        {   5, 0xe1a01c02, 0xfdffffff }, 
     1605        {   6, 0xe1a00003, 0xfdffffff }, 
     1606        {   7, 0xeb000000, 0xff000000 }, 
     1607        {   9, 0xe0843084, 0xfdffffff }, 
     1608        {  11, 0xe1a04104, 0xfdffffff }, 
     1609        {  12, 0xe1a06000, 0xfdffffff }, 
     1610        {  13, 0xe0858038, 0xfdffffff }, 
     1611        {  14, 0xe085a044, 0xfdffffff }, 
     1612        {  15, 0xe085c04c, 0xfdffffff }, 
     1613        {  16, 0xe1a03006, 0xfdffffff }, 
     1614        {  18, 0xe1a02001, 0xfdffffff }, 
     1615        {  20, 0xe1a0e00f, 0xfdffffff }, 
     1616        {  22, 0xe1a00009, 0xfdffffff }, 
     1617        {  23, 0xeb000000, 0xff000000 }, 
     1618        {  24, 0xe0867007, 0xfdffffff }, 
     1619        {  25, 0xe1a02000, 0xfdffffff }, 
     1620        {  26, 0xe1a01009, 0xfdffffff }, 
     1621        {  27, 0xe1a00007, 0xfdffffff }, 
     1622        {  28, 0xeb000000, 0xff000000 }, 
     1623        {  29, 0xe0855050, 0xfdffffff }, 
     1624        { -1, -1, -1 }, 
     1625        /* 24/32 */ 
     1626}; 
     1627 
    14991628static FuncSig func_sig_GetSystemTime_2[] = { 
    15001629        {   3, 0xe1550000, 0xfdffffff }, 
     
    16761805        { -1, -1, -1 }, 
    16771806        /* 25/32 */ 
     1807}; 
     1808 
     1809static FuncSig func_sig_Mount_FileSystem_2[] = { 
     1810        {   1, 0xe1a05000, 0xfdffffff }, 
     1811        {   3, 0xe1a00005, 0xfdffffff }, 
     1812        {   4, 0xeb000000, 0xff000000 }, 
     1813        {   6, 0xeb000000, 0xff000000 }, 
     1814        {   7, 0xe0501000, 0xfdffffff }, 
     1815        {   8, 0xe1a00005, 0xfdffffff }, 
     1816        {   9, 0x1a000000, 0xff000000 }, 
     1817        {  16, 0xeb000000, 0xff000000 }, 
     1818        {  17, 0xe1a00005, 0xfdffffff }, 
     1819        {  18, 0xeb000000, 0xff000000 }, 
     1820        {  19, 0xe1a04000, 0xfdffffff }, 
     1821        {  20, 0xe1a00005, 0xfdffffff }, 
     1822        {  21, 0xeb000000, 0xff000000 }, 
     1823        {  22, 0xe0044000, 0xfdffffff }, 
     1824        {  23, 0xe1a02004, 0xfdffffff }, 
     1825        {  24, 0xe1a00006, 0xfdffffff }, 
     1826        {  26, 0xeb000000, 0xff000000 }, 
     1827        {  29, 0x0002c4a8, 0xfdffffff }, 
     1828        {  30, 0x00002750, 0xfdffffff }, 
     1829        {  31, 0x00002748, 0xfdffffff }, 
     1830        { -1, -1, -1 }, 
     1831        /* 20/32 */ 
    16781832}; 
    16791833 
     
    17061860        { "ints_enable", func_sig_ints_enable_1 }, 
    17071861        { "ioctl", func_sig_ioctl_1 }, 
     1862        { "iosDevAdd", func_sig_iosDevAdd_1 }, 
     1863        { "iosDrvInstall", func_sig_iosDrvInstall_1 }, 
    17081864        { "IsStrobeChargeCompleted", func_sig_IsStrobeChargeCompleted_1 }, 
    17091865        { "kbd_p1_f_cont", func_sig_kbd_p1_f_cont_1 }, 
     
    17191875        { "memset", func_sig_memset_1 }, 
    17201876        { "mkdir", func_sig_mkdir_1 }, 
     1877        { "Mount_FileSystem", func_sig_Mount_FileSystem_1 }, 
     1878        { "Mount_FileSystem", func_sig_Mount_FileSystem_2 }, 
    17211879        { "open", func_sig_open_1 }, 
    17221880        { "Open", func_sig_Open_1 }, 
     
    17451903        { "taskSuspend", func_sig_taskSuspend_1 }, 
    17461904        { "taskUnlock", func_sig_taskUnlock_1 }, 
     1905        { "Unmount_FileSystem", func_sig_Unmount_FileSystem_1 }, 
     1906        { "UpdateMBROnFlash", func_sig_UpdateMBROnFlash_1 }, 
    17471907        { "write", func_sig_write_1 }, 
    17481908        { "Write", func_sig_Write_1 }, 
Note: See TracChangeset for help on using the changeset viewer.