Silvercrest SL-65 Firmware Extractor  v0.02  2007/03/22
====================================


Introduction
------------
The serial port on the SL-65 receiver runs at 115200bps. Evidently there is
no ACK/NAK protocol with the data transfer, and my little 466MHz computer
can't always keep up with that speed.

For me, the "AliEditor" software doesn't work, so I had to figure out the
protocol to talk to the receiver to try to write something in Windows.

Well, here it is. A little DOS program (written in C) which attempts to
connect with the receiver and ask it to dump the firmware.

There are some outstanding issues, but this computer - including with the
serial FIFO enabled, still can't always keep up with the data, and it seems
like the receiver may not support RTS/CTS 'cos data gets lost.

Well, here, try it. Fiddle with the code. Whatever.



Firmware
--------
It is a shame this doesn't work. The official firmware available on the
website is version 1084h-A65GB, dated 2006-03-24. The firmware currently
in my receiver is 1084h-B65GB, also dated 2006-03-24.

And, obviously, I am not entirely happy about playing with my firmware
without either keeping a copy of my current, or knowing in the 'A'/'B'
differences are important.



Compatibility
-------------
Your receiver must be the later model of the Silvercrest SL-65 digital
SATELLITE receiver (not the DTT box) which is based upon the ALI chip.
How to tell?

Apparently the early model has the screws on the SIDE of the box, while
the later model has them on the BACK.

Failing that, give it a whirl, either it'll fail completely or it won't.



Using this software
-------------------

Connect up your receiver. Go to DOS. Type:
  sl65
and press SPACE when asked. After a while, it should create a file called
"firmware.bin".

NOTE: If your computer has two serial ports, you'll be asked to choose
      COM1 or COM2. If it only has one serial port, that'll be assumed.

But, chances are that it may fail at some point. That's okay, this
software has a way to pick up the process. Use:
  sl65 -h
or
  sl65 /?
to remind yourself of these options.

Look at the LED display of your receiver. If it says a channel number,
like "0001" or somesuch, run this software normally.

If the display says a time, like "20.05", then you'll need to switch the
receiver out of standby, and then run this software normally.

If the display says "ASH", the initial serial connection has been
started, but not completed, so run this with:
  sl65 -ash

If the display says "conn", you will need to finish establishing the
serial link, so run this software with:
  sl65 -conn

If the display says "dup" or "| | " (the vertical bars are static, NOT
moving), run this software with:
  sl65 -dump
Note that this means you can request the firmware multiple times in a row
(it'll be given the same filename) in case of problems.

Alternatively, if the display is "| | " (not moving), you can use:
  sl65 -reset
to save turning your receiver off and back on again.

If the display says something odd, like "r105", this appears to be some
sort of error code for when you provide incorrect input (i.e. if the
display stopped at "conn" and you tried running this software from the
start).
You may be able to use:
  sl65 -dump
or:
  sl65 -reset
but if not, you'll need to switch off and back on again.

If the display shows the vertical bars, but they are MOVING, there is
nothing you can do. The receiver is in the process of spitting data to
a computer it believes to be attached - you must wait for it to finish
sending. [this is why I believe it does not respond to CTS/RTS]
The receiver sends 2Mb at ~9K/sec (115200bps). Just short of four minutes,
all in.



What you'll see on-screen
-------------------------
A typical, successful, run of the software will look as follows:
  ======================================================================
  Silvercrest SL-65 Firmware Extractor - 0.02                 2007/03/22
  by Rick Murray  http://www.heyrick.co.uk/ricksworld/digibox/sl65f.html

  There appears to be only one serial port, so using COM1:
  Linking into serial port (addr=0x03F8)

  Please ensure your receiver is ON and active, and the serial lead is
  correctly connected. Then press [SPACE]...

  Verifying serial port...okay.
  Awaiting receiver reset...okay.
  Engaging receiver's communications mode...okay.
  Switching to communications mode...okay.
  Requesting firmware...okay, will read 2097152 bytes.
  Status: 2097152 of 2097152 bytes read

  SL-65 Firmware Extractor exited.
  ======================================================================



Problems
--------
It is very likely that this software will abort with a time out or an
incorrect reply at some part of the process.
Just use the parameters (described above) to pick up where you left
off.

This software REQUIRES direct access to the serial port. This means that
NT-based versions of Windows (2000, XP, likely Vista too) will probably
try to auto-terminate the software. There is a patch to get this working
under XP, but really I expect this software to be used in DOS.

If there is no response from your satellite receiver and you are certain
that it should be compatible, and you are using Windows, then please
ensure that something has not already laid a claim to the serial port.
An example here is the Psion "PsiWin 2" software which monitors the serial
port for when a series 3 or 5 organiser is connected. Accordingly as it
has the serial port, this software cannot access it.

You are EXPECTED to have a serial controller chip with a FIFO. This is
probably not a problem as non-FIFO chips, and bargain basement serial
hardware, is unlikely to be reliably 115200bps capable.



Data loss problems
------------------
Your dump should be 2,097,152 bytes. If it is not, you will be warned. It
seems the receiver does NOT obey RTS/CTS (handshaking) and that your
computer must be able to reliably keep up with the data.

For now, I know two things:
  1. My 466MHz Celeron Acer laptop, running W98SE in 64Mb *CANNOT* keep
     up with this data rate. I experience the same sort of problems when
     using Zmodem to transfer between computers.

  2. My 40MHz ARM RiscPC, running W98SE in 64Mb *CAN* easily keep up with
     this data rate using the internal port in normal operation.

As I see it, my options are:
  1. Try to allocate a 2Mb chunk of memory and read bytes directly into it
     with as few overheads as possible. I'm not entirely certain how I'd
     go about making such a chunk in 'DOS'. I'll have to research this.

  2. Reimplement this as an interpreted BASIC program for the RiscPC. I
     would have done this today if my monitor was working...

Maybe you'll fare better?



Source code
-----------
This is not designed to be 'good' source or an example on how to write
software...
It is designed to be a readable, largely self-documenting, attempt at a
literal implementation of the communication protocol.
Had it, like, *worked*, I'd have been more likely to fix up problems, make
it more bulletproof, etc.

That, in part, is why I'm leaving you with the source. After all, this
whole thing is hacky by nature, so it feels 'right' to expect you to know
what to do with some C code. If you didn't, you probably wouldn't be
reading this!

The source uses direct hardware access to DOS ports, specifically COM1 or
COM2 (usually 0x3F8/0x2F8 but it enquires from the equipment list). It also
makes "conio" references for setting text colours.
It assumes an 80x25 colour text screen. The way DOS 'normally' looks if you
haven't tweaked it.

It is compiled using Borland TurboC++ v1.0 (it is C code, not C++) which is
freely available from Borland's website (but it may not be so easy to
locate, try Googling it?).



Licence
-------
By "me" or "I" or "myself", I mean Rick Murray, the original author of this
software; though if subsequent authors exist, this can be expanded to mean
all of us.
By "you", I mean you reading this. And it will be assumed that you have
bothered to read this...

This software is supplied as-is, complete with full source code.
Absolutely no liability will be accepted by myself nor any other
contributor to this project for error, loss, or omission. No warranty is
supplied, or should be inferred.

If you make *anything* based upon this source, please credit me and provide
a link to my website, either:
  http://www.heyrick.co.uk/                      <-- main index
  http://www.heyrick.co.uk/software/             <-- software stuff
  http://www.heyrick.co.uk/ricksworld/digibox/   <-- digibox stuff
as is most appropriate.

Please do not include my email address in any form other than, exactly:
  heyrick -at- merseymail -dot- com
(yes, with the "-at-" and the "-dot-"). I only have weekly internet access
and the less spam, the better...

You are not allowed to (re)distribute executables of *modified* versions,
either complete or as binary patches, without permission. This is a
formality so I know what versions are where. You can post modified sources
on your website.
[if this is a modified version, you must ask the modifier who will then ask
 me - normally there will be no objection, just a note of the URL and what
 your version does different, which will trickle down through links on the
 associated websites]

If a modified executable is supplied with your archive, it must exactly
match that which may be generated by the source code that you supply when
compiled with the compiler that you specify.
Essentially, what I am saying is the executable should behave in any way
different to that which the source dictates.

You are not required to distribute an executable. You can make a source
only distribution. If you distribute an executable, you must also include
the sources.

Leave my credit, but don't be afraid to insert your own. You can also
alter the website address if your mods are for a specific point that is
not covered by my implementation. For example if you add upload/burn
capabilities (as I have no intention of doing so).

You are requested to please send fixes and updates back to me (as source)
so they can be merged with the main code.

And if you are (re)distributing this software *without* *contributing* to
the project (i.e. fixes, mods, translations of the documentation into other
languages or the software for other computers, etc etc etc), essentially
the executable and source as-downloaded, then you are absolutely and
unequivocably forbidden from altering the contents of the distribution
archive. This specifically includes, but is not limited to, the insertion
of "file_id.diz" or "!wherefrom!.txt" files, BBS or ftp site adverts,
file lists, and any other crap that you may with to try to insert into
those files that you supply. THIS ALSO APPLIES IF SUCH MODIFICATIONS ARE
PERFORMED AUTOMATICALLY. No excuses. Full stop.
It will be assumed that you have read this, regardless of whether or not
you actually have. As a SysOp, you should know well that you cannot assume
any distribution rights for something until such time as you bothered to
read the "ReadMe" or "Licence" (etc) files to see what/if/how.

If you, somehow, manage to make some cash out of this software (I take it
you'll have sold it to a right sucker?) then you will be required to share
your profits with myself and anybody else who has provided input into the
project.
> This does not apply if this software is included on the disc/CD
  covermounted to a magazine which sells for its normal publication price.
  In this situation, you may include this software provided you do me the
  courtesy of emailing me to say you have included the software. Also a
  freebie copy of the magazine would be appreciated, but that is at your
  discretion. :-)
> However if this software is to be included on some sort of "source
  codes" compilation CD/DVD (or any other 'theme') which you plan to sell
  for anything over a fiver (sterling; about 8-9 euros), then I fully
  expect to receive a copy of said CD/DVD in the post. Same goes for 
  any/all other contributors.

Finally, in all subsequent versions, this licence is to be applied.

I, and other contributors with my permission, reserve the right to alter
this licence freely to cater for legal, regional, or cultural issues or
for stuff that may have been omitted in error.

This licence is not governed by any specific legal jurisdiction, and as
such, don't waste time exercising nuances of any specific legal system in
counter-argument. This licence is covered by a general code of moral
decency. Essentially, the analogy is:
  I wrote a 'notebook' of ideas and left it in a train station where you
  found it. Treat it well and look after it, don't rip pages out, but feel
  free to add your own notes or jot annotations at the sides of the pages.
  When you are done, leave it in the train station of your choice for the
  next person.



Contact/support
---------------
There is NO official support. But if you have a specific question then
don't hesitate to ask. [for modified versions, try asking the person who
performed the modifications]

You can email me as:  heyrick -at- merseymail -dot- com

Or you can check my website:

          http://www.heyrick.co.uk/ricksworld/digibox/
  For Digibox and satellite related stuff.

      http://www.heyrick.co.uk/ricksworld/digibox/sl65.html
  For stuff specifically related to the Silvercrest SL-65 receiver.

               http://www.heyrick.co.uk/software/
  For software stuff (for Windows, RISC OS, and the PocketBook II/Psion
  3a organiser).



Get involved!
-------------
You don't have to know C to get involved - though it would help. :-)

If you are competent with a foreign language, or better if your native
language is not English, why not consider translating this file into your
language to benefit people of your country who may not be so good with
English that they would find all of this to be confusing?

Eveything is welcome!



Rick, 2007/03/22
