Author Topic: Flashing a new kernel from Japan into the SL-C760  (Read 7023 times)

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Flashing a new kernel from Japan into the SL-C760
« on: February 10, 2004, 11:04:58 pm »
Do you have a need for speed?  I don\'t know if you have already updated the kernel on your Zaurus SL-C760, but I successfully did it on mine after gathering information from various sites on the web.  There is a fast kernel available for the Zaurus SL-C760 from a Japanese web site.  It seems to make the video sample clip that is on my SL-C760 play smoother.
 
The latest kernel on that site is:

  http://tetsu.homelinux.org/zaurus/kernel/v...e-v13d-C760.bin
 
This file has to be saved and renamed to
 
  zImage
 
without any file name extension and placed on a Compact Flash card or SD or MMC card that has been formatted in Windows (DOS) format.  The capitalization of the file name has to be exact.
 
You also need to save the
 
  http://developer.ezaurus.com/sl_j/source/c...updater.sh.c760
 
file onto the same Compact Flash, SD, or MMC card and rename the file to
 
  updater.sh
 
without the c760 extension.  Once the two files
 
  zImage
  updater.sh
 
are on one of your memory cards, the steps to update your kernel are then:
 
1.  Make sure that there is NO file named \"initrd.bin\" on the same card unless you deliberately want to erase your file system with whatever \"initrd.bin\" provides.
2.  Unplug the AC adapter from the Zaurus SL-C760.
3.  Flip the battery switch to the left position.
4.  Remove the battery for 5 seconds or more.
5.  Put the battery back in.
6.  Flip the battery switch back to the right position.
7.  Plug the AC adapter back into the Zaurus SL-C760.
8.  Hold down the OK button on the bottom of the keyboard while turning the Zaurus SL-C760 on.
9.  Select the fourth option on the bottom of the Japanese menu.
10.  Select 2 or 3 for CF or SD depending on the card where the zImage and updater.sh files are located.
11. Select Y for Yes.
 
I got a message about a module named devinfo not being found, but that did not prevent the kernel from being updated.  A row of dots will appear showing the progress of the kernel update.  A message will then appear telling you to, \"Please reset.\"  Unplug the AC adapter from the Zaurus SL-C760.  Flip the battery switch to the remove position.  Remove the battery.  Wait 5 seconds or more.  Put the battery back in and flip the battery switch to the installed position.  Power the Zaurus back up.  The computer will display Linux start-up messages, pause, and then take about a minute or two to get back into the familiar windowing environment.
 
I think that you can reuse the
 
  updater.sh
 
file for updating any kernel on the Zaurus SL-C760 as long as the kernel file is renamed to
 
  zImage
 
first.  For some reason, the \"updater.sh\" file is encrypted with a simple cipher.  I guess that Sharp wanted to make it hard for people to update their systems.
 
In the future, if you want to get updates of the kernel from the same site, you can visit:
 
  http://tetsu.homelinux.org/zaurus/kernel
 
The web page can be translated from Japanese to English by entering the address in:
 
  http://babelfish.altavista.com
 
in the, \"Translate a Web Page\", section and selecting the Japanese to English translation.

fu-ga-zi

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • http://
Flashing a new kernel from Japan into the SL-C760
« Reply #1 on: February 12, 2004, 09:26:32 am »
What did this guy do to speed up the kernel? There is a possibility to make the Z faster (see other postings in this forum) but I would prefer non-hardware speedups to save battery and prolong CPU life.

Regards

Peter

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Flashing a new kernel from Japan into the SL-C760
« Reply #2 on: February 12, 2004, 09:21:49 pm »
The English translation from the http://babelfish.altavista.com site is rough, but it seems to indicate that the kernel has had the cache errata workaround for the earlier model of the Xscale processor removed.  It also seems to mention a buffer for the video.  There are also options to overclock the video and system bus, but those are only options.

Richjn

  • Full Member
  • ***
  • Posts: 121
    • View Profile
    • http://
Flashing a new kernel from Japan into the SL-C760
« Reply #3 on: February 13, 2004, 01:35:17 am »
Just for the record the 760 doesn\'t have cache errata turned on in the default kernel as this is for the PXA-250 the 750/760 860 have a PXA-255 processor.

I\'ve not used this kernel but I understand that it has pre-emptive and cpu overclock built in.

Richard

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Flashing a new kernel from Japan into the SL-C760
« Reply #4 on: February 13, 2004, 10:29:42 pm »
Yes.  The Japanese kernel is similar to the one that is available for download from the Zaurus Users Group download area.  Some of the start-up messages in the Japanese kernel are odd, though.  Some code somewhere in that kernel is detecting an attempt to set a block size smaller than 512 bytes for a FAT file system at start-up.  Perhaps the Japanese programmers do not understand what that error message means.

As I mentioned, the Japanese kernel has the option to overclock the bus speed.  The root user can do this by issuing the command:

echo 162 > /proc/cccr_change

However, this setting gets changed back to the factory 161 setting whenever the computer is allowed to automatically go into suspend mode.  The Japanese kernel is still actively in development with yet another version mentioned on the web site but not yet available for download.  I have switched to the pre-emptive kernel and 162 overclock kernel that is available from the Zaurus Users Group download area.  Contrary to the HowTo instructions, you must rename the kernel to zImage without the \".bin\" file name extension if you use the updater.sh for the C760 that I mentioned at the start of this thread.

For people who understand shell scripts, the decrypted updater.sh.c760 shell script reads as follows:

Code: [Select]
#!/bin/sh





DATAPATH=$1

TMPPATH=/tmp/update

TMPDATA=$TMPPATH/tmpdata.bin

TMPHEAD=$TMPPATH/tmphead.bin





RO_MTD_LINE=`cat /proc/mtd | grep "root" | tail -n 1`

if [ "$RO_MTD_LINE" = "" ]; then

    RO_MTD_LINE=`cat /proc/mtd | grep ".*<2>" | tail -n 1`

fi

RO_MTD_NO=`echo $RO_MTD_LINE | cut -d: -f1 | cut -dd -f2`

RO_MTD_SIZE_HEX=`echo $RO_MTD_LINE | cut -d" " -f2`

RO_MTD=/dev/mtd$RO_MTD_NO

RO_MTDBLK=/dev/mtdblock$RO_MTD_NO

RO_MTD_SIZE=`dc 0x$RO_MTD_SIZE_HEX 1024 /`



RW_MTD_LINE=`cat /proc/mtd | grep "home" | tail -n 1`

if [ "$RW_MTD_LINE" = "" ]; then

    RW_MTD_LINE=`cat /proc/mtd | grep ".*<2>" | tail -n 1`

fi

RW_MTD_NO=`echo $RW_MTD_LINE | cut -d: -f1 | cut -dd -f2`

RW_MTD_SIZE_HEX=`echo $RW_MTD_LINE | cut -d" " -f2`

RW_MTD=/dev/mtd$RW_MTD_NO

RW_MTDBLK=/dev/mtdblock$RW_MTD_NO

RW_MTD_SIZE=`dc 0x$RW_MTD_SIZE_HEX 1024 /`



LOGOCAL_MTD=/dev/mtd1



VERBLOCK=0x48000

MVRBLOCK=0x70000



RESULT=0



Cleanup(){

    rm -f $VTMPNAME > /dev/null 2>&1

    rm -f $MTMPNAME > /dev/null 2>&1

    rm $CTRLPATH/* > /dev/null 2>&1

    rm $DATAPATH/* > /dev/null 2>&1

    exit $1

}

trap \'Cleanup 1\' 1 15

trap \'\' 2 3





### Check model ###

/sbin/writerominfo

MODEL=`cat /proc/deviceinfo/product`

if [ "$MODEL" != "SL-C760" ] > /dev/null 2>&1

then

    echo \'MODEL:\'$MODEL

    echo \'ERROR:Invalid model!\'

    echo \'Please reset\'

    while true

    do

    done

fi



mkdir -p $TMPPATH > /dev/null 2>&1



cd $DATAPATH/



if [ -e consolescroll ]

then

    ./consolescroll

fi



for TARGETFILE in zImage initrd.bin mversion.bin

do

    if [ -e $TARGETFILE ]

    then

  rm -f $TMPPATH/*.bin > /dev/null 2>&1

  DATASIZE=`wc -c $TARGETFILE`

  DATASIZE=`echo $DATASIZE | cut -d\' \' -f1`



  #echo $TARGETFILE\':\'$DATASIZE\'bytes\'

  case "$TARGETFILE" in

  zImage)

      echo \'kernel\'

      ISLOGICAL=1

      MODULEID=5

      MODULESIZE=0x13C000

      ADDR=`dc 0xE0000`

      ISFORMATTED=1

      DATAPOS=0

      ONESIZE=524288

      HDTOP=`expr $DATASIZE - 16`

      /sbin/bcut -a $HDTOP -s 16 -o $TMPHEAD $TARGETFILE

  ;;

  initrd.bin)

      echo \'RO file system\'

      ISLOGICAL=0

      MODULEID=6

      MODULESIZE=0x3500000

      ADDR=0

      ISFORMATTED=0

      TARGET_MTD=$RO_MTD

      DATAPOS=16

      ONESIZE=1048576

      /sbin/bcut -s 16 -o $TMPHEAD $TARGETFILE

  ;;

  mversion.bin)

      echo \'Maser version\'

      MTMPNAME=$TMPPATH\'/mtmp\'`date \'+%s\'`\'.tmp\'

      /sbin/nandlogical $LOGOCAL_MTD READ $MVRBLOCK 0x4000 $MTMPNAME > /dev/null 2>&1

      /sbin/verchg -m $MTMPNAME $TARGETFILE 0 0 > /dev/null 2>&1

      /sbin/nandlogical $LOGOCAL_MTD WRITE $MVRBLOCK 0x4000 $MTMPNAME > /dev/null 2>&1

      rm -f $MTMPNAME > /dev/null 2>&1

      echo \'Success!\'

      continue

  ;;

  *)

      continue;

  ;;

  esac



  #check version

  /sbin/bcut -s 6 -o $TMPDATA $TMPHEAD

  if [ `cat $TMPDATA` != "SHARP!" ] > /dev/null 2>&1

  then

      #no version info...

      rm -f $TMPHEAD > /dev/null 2>&1

      DATAPOS=0

  fi



  #format?

  if [ $ISFORMATTED = 0 ]

  then

      echo -n \'Flash erasing...\'

      /sbin/eraseall $TARGET_MTD 2> /dev/null > /dev/null

      #/sbin/eraseall $TARGET_MTD 2

      echo \'done\'

      ISFORMATTED=1

  fi



  echo \'\'

  echo \'0%                                          100%\'

  PROGSTEP=`expr $DATASIZE / $ONESIZE + 1`

  PROGSTEP=`expr 48 / $PROGSTEP`

  if [ $PROGSTEP = 0 ]

  then

      PROGSTEP=1

  fi



  #header information

  if [ -e $TMPHEAD ]

  then

      VTMPNAME=$TMPPATH\'/vtmp\'`date \'+%s\'`\'.tmp\'

      MTMPNAME=$TMPPATH\'/mtmp\'`date \'+%s\'`\'.tmp\'

      /sbin/nandlogical $LOGOCAL_MTD READ $VERBLOCK 0x4000 $VTMPNAME > /dev/null 2>&1

      /sbin/nandlogical $LOGOCAL_MTD READ $MVRBLOCK 0x4000 $MTMPNAME > /dev/null 2>&1



      #echo \'found header\'

      /sbin/verchg -v $VTMPNAME $TMPHEAD $MODULEID $MODULESIZE > /dev/null 2>&1

      /sbin/verchg -m $MTMPNAME $TMPHEAD $MODULEID $MODULESIZE > /dev/null 2>&1

  fi



  #loop

  while [ $DATAPOS -lt $DATASIZE ]

  do

      #data create

      bcut -a $DATAPOS -s $ONESIZE -o $TMPDATA $TARGETFILE

      TMPSIZE=`wc -c $TMPDATA`

      TMPSIZE=`echo $TMPSIZE | cut -d\' \' -f1`

      DATAPOS=`expr $DATAPOS + $TMPSIZE`



      #handle data file

      #echo \'ADDR=\'$ADDR

      #echo \'SIZE=\'$TMPSIZE

      if [ $ISLOGICAL = 0 ]

      then

    next_addr=`/sbin/nandcp -a $ADDR $TMPDATA $TARGET_MTD  2>/dev/null | fgrep "mtd address" | cut -d- -f2 | cut -d( -f1`

    if [ "$next_addr" = "" ]; then

        echo "ERROR:flash write"

        rm $TMPDATA > /dev/null 2>&1

        RESULT=3

        break;

    fi

    ADDR=$next_addr

      else

    /sbin/nandlogical $LOGOCAL_MTD WRITE $ADDR $DATASIZE $TMPDATA > /dev/null 2>&1

    ADDR=`expr $ADDR + $TMPSIZE`

      fi



      rm $TMPDATA > /dev/null 2>&1



      #progress

      SPNUM=0

      while [ $SPNUM -lt $PROGSTEP ]

      do

    echo -n \'.\'

    SPNUM=`expr $SPNUM + 1`

      done

  done



  echo \'\'



#finish

  rm -f $TMPPATH/*.bin > /dev/null 2>&1



  if [ $RESULT = 0 ]

  then

      if [ -e $VTMPNAME ]

      then

    /sbin/nandlogical $LOGOCAL_MTD WRITE $VERBLOCK 0x4000 $VTMPNAME > /dev/null 2>&1

    rm -f $VTMPNAME > /dev/null 2>&1

      fi

      if [ -e $MTMPNAME ]

      then

    /sbin/nandlogical $LOGOCAL_MTD WRITE $MVRBLOCK 0x4000 $MTMPNAME > /dev/null 2>&1

    rm -f $MTMPNAME > /dev/null 2>&1

      fi

      echo \'Success!\'

  else

      echo \'Error!\'

#      exit $RESULT

  fi

    fi

done



#exit 0



echo \'Please reset\'

while true

do

done


This shell script looks for three files named

zImage
initrd.bin
mversion.bin

It ignores any files that are missing, so that you can update the kernel by itself.  I do not know what mversion.bin is supposed to be.

vanstrien

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://www.vanstrien.net
Flashing a new kernel from Japan into the SL-C760
« Reply #5 on: August 13, 2004, 10:06:37 am »
Any suggestions on flashing the kernel under the 860?  I've used the same script that worked fine for me to flash Elena, but I always get the same "Invalid Model" error.

If I change the updater.sh posted above so that it does not check the version, is there something I need to do to 'reencrypt' it?
C860 Cacko ROM | 5500 tkcROM
256MB SD | 128MB SD
512MB CF | 256MB CF
D-Link DWL 660 WiFi| Linksys WCF12 WiFi
Socket Bluetooth | Socket Ethernet

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Flashing a new kernel from Japan into the SL-C760
« Reply #6 on: August 13, 2004, 10:32:01 am »
Quote
Any suggestions on flashing the kernel under the 860?  I've used the same script that worked fine for me to flash Elena, but I always get the same "Invalid Model" error.

If I change the updater.sh posted above so that it does not check the version, is there something I need to do to 'reencrypt' it?
You'll have to go to the site and download the C860 version of the kernel - everything is the same except it has the model number as 860 instead of 760

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Flashing a new kernel from Japan into the SL-C760
« Reply #7 on: August 13, 2004, 07:55:55 pm »
I used a program called tench to decode the updater.sh file.  I am attaching the source code to this message.  The same program can also be used to re-encode the updater.sh file.

If a kernel works on the c760, then it should work on the c860, since the hardware is identical.
« Last Edit: August 13, 2004, 07:57:51 pm by qx773 »

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Flashing a new kernel from Japan into the SL-C760
« Reply #8 on: August 13, 2004, 08:00:43 pm »
Here is a compiled version of the tench program for MSDOS or Windows.

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Flashing a new kernel from Japan into the SL-C760
« Reply #9 on: August 13, 2004, 08:04:43 pm »
Here is the updater.sh script in downloadable form, attached to this message.

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Flashing a new kernel from Japan into the SL-C760
« Reply #10 on: August 14, 2004, 08:33:22 am »
Quote
If a kernel works on the c760, then it should work on the c860, since the hardware is identical.
Ah, my mistake it's not the kernel version that is being checked it's the updater.sh that's looking for a specific version

From updater.sh you linked too
Code: [Select]
### Check model ###
/sbin/writerominfo
MODEL=`cat /proc/deviceinfo/product`
if [ "$MODEL" != "SL-C760" ] > /dev/null 2>&1
then
    echo 'MODEL:'$MODEL
    echo 'ERROR:Invalid model!'
    echo 'Please reset'
    while true
    do
    done
fi

As you can see it's hard coded for installing only on the C760, you will have to edit it or get the C860 version of updater.sh

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

vanstrien

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://www.vanstrien.net
Flashing a new kernel from Japan into the SL-C760
« Reply #11 on: August 15, 2004, 04:45:46 am »
My mistake--I had multiple copies of the updater.sh around.  The one I was trying was similiar to the one posted here.  I've just found one that specifically references the 860.

I'll give it a go this weekend.
C860 Cacko ROM | 5500 tkcROM
256MB SD | 128MB SD
512MB CF | 256MB CF
D-Link DWL 660 WiFi| Linksys WCF12 WiFi
Socket Bluetooth | Socket Ethernet

vanstrien

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://www.vanstrien.net
Flashing a new kernel from Japan into the SL-C760
« Reply #12 on: August 15, 2004, 07:07:38 am »
Oddly enought the updater.sh which comes with the latest Cacko installs the rom fine but if I try just the kernel it fails.

I took the updater.sh above and just removed the hardware check and it worked perfectly.
C860 Cacko ROM | 5500 tkcROM
256MB SD | 128MB SD
512MB CF | 256MB CF
D-Link DWL 660 WiFi| Linksys WCF12 WiFi
Socket Bluetooth | Socket Ethernet