Kernel restoration

The sample buildfile for kernel restoration on the EDOSK7780 reference platform is as follows:

#################################################################
## START OF BUILD SCRIPT for Renesas EDOSK7780 Board
#################################################################
[image=0x88010000]
[virtual=shle/binary +compress] .bootstrap = {
    startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -vv -I1

    PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot procnto -vvvv
}

[+script] .script = {
    procmgr_symlink ../../proc/boot/libc.so.2 /usr/lib/ldqnx.so.2

    display_msg Welcome to QNX Neutrino on the Renesas EDOSK-7780

    devc-sersci -e -F -x -b115200 -c1843200/16 scif0 scif1 &
    reopen /dev/ser1

    SYSNAME=nto
    TERM=qansi

    [+session] PATH=:/proc/boot LD_LIBRARY_PATH=/proc/boot ksh &
}

[type=link] /dev/console=/dev/ser1
[type=link] /tmp=/dev/shmem
libc.so

[data=c]
devc-sersci
ls
ksh
pidin
###################################################################
## END OF BUILD SCRIPT
###################################################################

To build the image:

# mkifs -v edosk7780.build edosk7780.ifs

The sample output is as follows:

QNX Neutrino IPL for the EDOSK-7780                 
Press 'd' to download an OS image serially              
Press any other key to boot from flash 

Press a key other than d; the output continues:

Downloading from Flash                                  
Restore IFS searching for valid IFS in RAM...
         
rifs_info PADDR = 0x08008000                            
rifs_info ADDR = 0x88008000                             
INVALID IFS signature                                   
Restore IFS failed - Reload entire IFS.
               
PT_LOAD RW: 0004b000 size is 000030b0                   
Found procnto Elf header                                
bootable exec data: offset 0004b000, size 000030b0      
Compressed image, store data                            
Calculate restore info checksum    

System page at phys:081d1000 user:081d1000 kern:881d1000                
Starting next program at v8803c258                                      
Welcome to QNX Neutrino on the Renesas EDOSK-7780

The board has booted; run an application:

#                                                
# ls
dev     proc    tmp     usr     

Press the reset button to simulate wake-up:

# QNX Neutrino IPL for the EDOSK-7780                                   
Press 'd' to download an OS image serially                              
Press any other key to boot from flash        

Press a key other than d. The output continues:

Downloading from Flash                                                  
Restore IFS searching for valid IFS in RAM...
                         
rifs_info PADDR = 0x08008000                                            
rifs_info ADDR = 0x88008000                                             
FOUND valid IFS signature                                               
FOUND valid RIFS signature                                              
FOUND valid RIFS info                                                   
FOUND valid IFS signature and RIFS info in RAM.
                       
IFS pre checksum = 0x7bbb7898 (shouldn't be 0x0)                       
bootable exec 0 offset: 0x0004bef8                                      
bootable exec 0 size: 0x000030b0                                        
Compressed image src = 0x0800a000                                       
IFS post checksum = 0x00000000 (should be 0x0)                          
PT_LOAD RW: 0004b000 size is 000030b0                                   
Found procnto Elf header                                                
bootable exec data: offset 0004b000, size 000030b0                      
Compressed image, store data                                            
Calculate restore info checksum                                         
                                                                        
System page at phys:081d1000 user:081d1000 kern:881d1000                
Starting next program at v8803c258                                      
Welcome to QNX Neutrino on the Renesas EDOSK-7780  
# ls                                                                   
dev     proc    tmp     usr                    

To disable the checksum verification on the IFS after it has been restored, modify the buildfile to:

startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -vv —I0

On subsequent boots, you will see the additional output (with debug enabled):

WARNING: Skipped image checksum verification  
Note: With debugging enabled, the checksum value is still calculated so that it can be displayed. However, the checksum value isn't used to determine if the IFS has been restored properly (it's assumed that it was).

If you're working with uncompressed images, the buildfile looks like:

[virtual=shle/binary] .bootstrap = {
    startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -vv -I1

    PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot procnto -vvvv
}

The sample output looks something like:

Restore IFS searching for valid IFS in RAM...
        
rifs_info PADDR = 0x08008000                           
rifs_info ADDR = 0x88008000                            
INVALID IFS signature                                  
Restore IFS failed - Reload entire IFS.
              
PT_LOAD RW: 0004b000 size is 000030b0                  
Found procnto Elf header                               
bootable exec data: offset 0004b000, size 000030b0     
Calculate restore info checksum            

Press the reset button to simulate wake-up. The output continues:

Restore IFS searching for valid IFS in RAM...
         
rifs_info PADDR = 0x08008000                            
rifs_info ADDR = 0x88008000                             
FOUND valid IFS signature                               
FOUND valid RIFS signature                              
FOUND valid RIFS info                                   
FOUND valid IFS signature and RIFS info in RAM.
       
IFS pre checksum = 0x7a82a8f2 (shouldn't be 0x0)       
bootable exec 0 offset: 0x0004bef8                      
bootable exec 0 size: 0x000030b0                        
Uncompressed image paddr_src = 0x00059000               
IFS post checksum = 0x00000000 (should be 0x0)          
PT_LOAD RW: 0004b000 size is 000030b0                   
Found procnto Elf header                                
bootable exec data: offset 0004b000, size 000030b0      
Calculate restore info checksum