[E3-hacking] Understanding the E3s Partitions

Nick Griffin span1922 at live.com
Fri Apr 12 23:26:35 BST 2019


Made a mistake.. ..☹
This at the end of the code e3-nand-backup.4, its says ” nandwrite -on /dev/mtd3  /media/sda1/e3-nand-backup.3” what it should be mtd4 and 4 at the end of this code “nandwrite -on /dev/mtd4  /media/sda1/e3-nand-backup.4”

if [ -e /media/sda1/e3-nand-backup.4 ]; then
 echo Found e3-nand-backup.4
 echo "  Erasing /dev/mtd4"
 flash_erase /dev/mtd4 0 16
 echo "  Writing e3-nand-backup.4 to /dev/mtd4"
 nandwrite -on /dev/mtd4  /media/sda1/e3-nand-backup.4
fi


echo "Done.
“

Spanner..

From: Nick Griffin<mailto:span1922 at live.com>
Sent: ‎Friday‎, ‎12‎ ‎April‎ ‎2019 ‎22‎:‎04
To: Discussion of the Amstrad E3 emailer hardware/software<mailto:e3-hacking at earth.li>

Can someone look at this…
Just edited the ams-delta-install script and renamed it to ams-delta-restore-e3-install

I can do all the work and tests, Just need a expert to look at the code and see if it OK because I am just reading up on MTD NAND write and dumping stuff on the net. This is how you learn you ask someone to help you and they help you and if you are wrong then you will remember how to do it next time… 😊

”#!/bin/sh

if (! grep -q /dev/sda1 /proc/mounts); then
 echo "No install media mounted; couldn't find /dev/sda in /proc/mounts"
 exit 1;
fi

echo

echo "This process will completely restore your E3's NAND."
echo This will try and restore The Amstrad firmware on the device. Are you
echo -n "sure you wish to continue? [y/N]: "

read i

if [ ! "x$i" = "xy" -a ! "x$i" = "xY" ]; then
 echo
 echo Aborting.
 exit 1
fi

echo
echo Starting restore...

if [ -e /media/sda1/e3-nand-backup.0 ]; then
 echo Found e3-nand-backup.0
 echo "  Erasing /dev/mtd0"
 flash_erase /dev/mtd0 0 16
 echo "  Writing e3-nand-backup.0 to /dev/mtd0"
 nandwrite -on /dev/mtd0 /media/sda1/e3-nand-backup.0
fi

if [ -e /media/sda1/e3-nand-backup.1 ]; then
 echo Found e3-nand-backup.1
 echo "  Erasing /dev/mtd1"
 flash_erase /dev/mtd1 0 16
 echo "  Writing e3-nand-backup.1 to /dev/mtd1"
 nandwrite -on /dev/mtd1 /media/sda1/e3-nand-backup.1
fi

if [ -e /media/sda1/e3-nand-backup.3 ]; then
 echo Found e3-nand-backup.3
 echo "  Erasing /dev/mtd3"
 flash_erase /dev/mtd3 0 16
 echo "  Writing e3-nand-backup.3 to /dev/mtd3"
 nandwrite -on /dev/mtd3  /media/sda1/e3-nand-backup.3
fi

if [ -e /media/sda1/e3-nand-backup.4 ]; then
 echo Found e3-nand-backup.4
 echo "  Erasing /dev/mtd4"
 flash_erase /dev/mtd4 0 16
 echo "  Writing e3-nand-backup.4 to /dev/mtd4"
 nandwrite -on /dev/mtd3  /media/sda1/e3-nand-backup.3
fi


echo "Done."

What do you think… Would this work…?


Spanner..

From: Nick Griffin<mailto:span1922 at live.com>
Sent: ‎Friday‎, ‎12‎ ‎April‎ ‎2019 ‎19‎:‎32
To: Discussion of the Amstrad E3 emailer hardware/software<mailto:e3-hacking at earth.li>

Just copy the Amstrad Firmware to USB and as well flash Linux on the E3 so now I have to find a way to flash it back.. 😊 wow its takes a long time to boot, it took about a hour to copy the Amstrad Firmware over to USB.Is each file a copy of the partition(mtd0,1,2,3,4,5,) only mtd0,1,3 and 4 get flashed with the new system, so if the backups are complete copies then they could be flash back the same way, maybe something like this, taking the code for mdt0..

”if [ -e /media/sda1/e3-nand-backup.0 ]; then
 echo Found Amstrad kernel.
 echo "  Erasing /dev/mtd0"
 flash_eraseall /dev/mtd0
 echo "  Writing Amstrad kernel to /dev/mtd0"
nandwrite -on /dev/mtd0 /media/sda1/e3-nand-backup.0
fi”

Mtd0,2,3,4,5 Size 16384,Page Size 512, 00B Size 16
only need to restore mtd0,1,3 and 4 so ones with a * on.
mtd0: Dumping Data Starting at 0x00000000 and ending at 0x00300000*
mtd1: Dumping Data Starting at 0x00000000 and ending at 0x00040000*
mtd2: Dumping Data Starting at 0x00000000 and ending at 0x00040000
mtd3: Dumping Data Starting at 0x00000000 and ending at 0x00040000*
mtd4: Dumping Data Starting at 0x00000000 and ending at 0x01b00000*
mtd5: Dumping Data Starting at 0x00000000 and ending at 0x000c0000
I don’t know how much of the Nand you would need to erase for each partition..?
So lucky I recored the install..😊 I be uploading soon once I have edited it.
This is just guess work don’t know if it would work, need someone who knows about the code. If I manage to flash the Amstrad Firmware back and it works then you be able to flash any E3 firmware this way so even with one with the config change on it.

There is info here how to flash to mtd ..  https://forum.doozan.com/read.php?3,16789,16800<https://eur02.safelinks.protection.outlook.com/?url=https://forum.doozan.com/read.php?3%2c16789%2c16800&data=02%7c01%7c%7c4e14113df08b4714a45708d6bf8a762e%7c84df9e7fe9f640afb435aaaaaaaaaaaa%7c1%7c0%7c636906998736410136&sdata=4rRkSMMFT0JJOseEcWKRtZOmqeUCO7RRRhFioD6wIZ0%3D&reserved=0>

Spanner..

From: Nick Griffin<mailto:span1922 at live.com>
Sent: ‎Friday‎, ‎12‎ ‎April‎ ‎2019 ‎14‎:‎10
To: Discussion of the Amstrad E3 emailer hardware/software<mailto:e3-hacking at earth.li>

Oh one more thing.. the USB memory stick,does it matter if its fat or fat32 formatted to copy the 6 files over to it,it don’t say in the Readme..?

Spanner..

From: Nick Griffin<mailto:span1922 at live.com>
Sent: ‎Friday‎, ‎12‎ ‎April‎ ‎2019 ‎14‎:‎02
To: Discussion of the Amstrad E3 emailer hardware/software<mailto:e3-hacking at earth.li>

“When it flash's Linux to the E3 it only uses partitions mtd0,mtd1,mtd3 and mtd4, so mtd2 and mtd3 is not used.”

mtd0 - kernel
mtd1 - PBL ( Maybe, I say this because Uboot is flashed there.)
mtd3 - ldr ( File System..? uses mtdblock3 of mtd3)
mtd4 - Root( Root File System,maybe ?? uses mtdblock4 of mtd4)

What are mtd2 and mtd5 used for..??

Trying to find out what each Partition is used for?

Is the Amstrad Install Script running in a Ramdisk..??
You have 2 Uboot images the same, one for flashing the other on for the install so you made it a bit like FEL mode where you hold down the FEL Button and can boot into Uboot +ramdisk  from you PC thought its usb cable that powers it then you can mount the system partition to get into files and folders, that's on TheC64 Mini.
Most Developing Boards now have the FEL button.

Just trying to find out more ,it dumps the firmware into 6 partitions, when it dumps them, can they be put back the way they are or do they need to be converted, so what I am say, are they raw files so they can’t be used the way they are at the moment…?

You can backup your firmware with this script without installing Linux on the E3,you can say no to installing it, right..?? if so I will try and see if I can back the E3 up to get the 6 backup files.

P.S Have not done anything with my E2Plus yet, if I can backup its firmware and then flash it back then I can fix the dead E2s out there, but I need help.
If I can backup its firmware I am willing to share it.But don’t worry my E2Plus is going no where.. 😊 Just been looking at you page Ralph,One of the problem with the E2 is it don’t run Linux, I am trying to find out more about its firmware at the moment.
The E1 and E2 use the same Firmware and same CPU Sharp LH79531 ARM (L136 00B), the only difference in them is the Plus had ZX Spectrum games. So I might be able to use the firmware from the E2 on the E1. The E3 had a different CPU because it need a MMU for the Colour LCD screen so need to be more powerful than the E1,E2.

Spanner..

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.earth.li/pipermail/e3-hacking/attachments/20190412/b56bc4d3/attachment-0001.html>


More information about the e3-hacking mailing list