<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Windows Mail 17.5.9600.22013">
<style><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, 
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, 
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style>
</head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;">
<div>This is the code I made for it… so if anyone wants to try it on theres,you can’t damge the E3 doing it,if it don’t work it will not get past the PBL line,lucky they put PBL on the nor flash you can’t brick it..😊 if it don’t work just when using the Pbltool
 put -n in the line to stop it from “Probbing” and “handshaking” because it will not find PBL V4.9 otherwise.
</div>
<div>And say “Probbing” forever.. 😊 and not find anything.</div>
<div><br>
</div>
<div>You have to put the script on the USB Stick and run it from it on the E3 for it to work.</div>
<div><br>
</div>
<div>so .. cd /media/sda1/</div>
<div>ams-delta-of-install</div>
<div><br>
</div>
<div>The code…</div>
<div>-----------------------------------------------------------------------------------------</div>
<div><br>
</div>
<div>#!/bin/sh</div>
<div><br>
</div>
<div>if (! grep -q /dev/sda1 /proc/mounts); then<br>
 echo "No install media mounted; couldn't find /dev/sda in /proc/mounts"<br>
 exit 1;<br>
fi</div>
<div><br>
</div>
<div>echo</div>
<div><br>
</div>
<div>echo "This process will completely restore your E3's NAND."<br>
echo This will try and restore The Amstrad firmware on the device. Are you<br>
echo -n "sure you wish to continue? [y/N]: "</div>
<div><br>
</div>
<div>read i</div>
<div><br>
</div>
<div>if [ ! "x$i" = "xy" -a ! "x$i" = "xY" ]; then<br>
 echo<br>
 echo Aborting.<br>
 exit 1<br>
fi</div>
<div><br>
</div>
<div>echo<br>
echo Starting restore.. This might take a while...</div>
<div><br>
</div>
<div>if [ -e /media/sda1/e3-nand.0 ]; then<br>
 echo Found e3-nand.0<br>
 echo "  Erasing /dev/mtd0"<br>
 flash_erase /dev/mtd0 0 224<br>
 echo "  Writing e3-nand.0  4mb to /dev/mtd0"<br>
 nandwrite /dev/mtd0 /media/sda1/e3-nand.0<br>
fi</div>
<div><br>
</div>
<div>if [ -e /media/sda1/e3-nand.1 ]; then<br>
 echo Found e3-nand.1<br>
 echo "  Erasing /dev/mtd1"<br>
 flash_erase /dev/mtd0 0 16<br>
 echo "  Writing e3-nand-backup.1 264kb to /dev/mtd1"<br>
 nandwrite /dev/mtd1 /media/sda1/e3-nand.1<br>
fi</div>
<div><br>
</div>
<div>if [ -e /media/sda1/e3-nand.2 ]; then<br>
 echo Found e3-nand.2<br>
 echo "  Erasing /dev/mtd2"<br>
 flash_erase /dev/mtd0 0 16<br>
 echo "  Writing e3-nand-backup.2 264kb to /dev/mtd2"<br>
 nandwrite /dev/mtd2 /media/sda1/e3-nand.2<br>
fi</div>
<div><br>
</div>
<div>if [ -e /media/sda1/e3-nand.3 ]; then<br>
 echo Found e3-nand.3<br>
 echo "  Erasing /dev/mtd3"<br>
 flash_erase /dev/mtd0 0 16<br>
 echo "  Writing e3-nand-backup.3 264kb to /dev/mtd3"<br>
 nandwrite /dev/mtd3 /media/sda1/e3-nand.3<br>
fi</div>
<div><br>
</div>
<div>if [ -e /media/sda1/e3-nand.4 ]; then<br>
 echo Found e3-nand.4<br>
 echo "  Erasing /dev/mtd4"<br>
 flash_erase /dev/mtd0 0 1728<br>
 echo "  Writing e3-nand-backup.4  32 mb to /dev/mtd4"<br>
 nandwrite /dev/mtd4 /media/sda1/e3-nand.4<br>
fi</div>
<div><br>
</div>
<div>if [ -e /media/sda1/e3-nand.5 ]; then<br>
 echo Found e3-nand.5<br>
 echo "  Erasing /dev/mtd5"<br>
 flash_erase /dev/mtd0 0 48<br>
 echo "  Writing e3-nand-backup.5  792kb to /dev/mtd5"<br>
 nandwrite /dev/mtd5 /media/sda1/e3-nand.5<br>
fi<br>
 </div>
<div><br>
</div>
<div>echo "Finished restoring the Amstrad E3 Firmware,"<br>
echo "Type Reboot or unplug E3 to see if the Amstrad E3 Splash Screen” <br>
echo "comes up (Fingers Crossed) If not just reinstall E3 Linux with the"<br>
echo "pbltool with the -n in the line to stop Handshaking otherwise it will"<br>
echo "not find PBL V4.9 Build:1311 bootloader."<br>
<br>
</div>
<div data-signatureblock="true">
<div><br>
</div>
<div>Spanner..<br>
<br>
http://amstrad-e3-hacking.freeforums.net</div>
<div><br>
</div>
</div>
<div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;">
<div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style="line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;"><b>From:</b> <a href="mailto:span1922@live.com" target="_parent">Nick
 Griffin</a><br>
<b>Sent:</b> ‎Wednesday‎, ‎24‎ ‎April‎ ‎2019 ‎11‎:‎14<br>
<b>To:</b> <a href="mailto:e3-hacking@earth.li" target="_parent">Discussion of the Amstrad E3 emailer hardware/software</a></font></div>
</div>
<div><br>
</div>
<div dir="ltr">
<div style="font-family: "Calibri","Segoe UI","Meiryo","Microsoft YaHei UI","Microsoft JhengHei UI","Malgun Gothic","sans-serif"; font-size: 12pt;" dir="ltr">
<div>Thanks btw Ralph.. 😊<br>
</div>
<div>
<div><br>
</div>
<div>Spanner..<br>
<br>
http://amstrad-e3-hacking.freeforums.net</div>
<div><br>
</div>
</div>
<div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;">
<div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style="line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri","Segoe UI","Meiryo","Microsoft YaHei UI","Microsoft JhengHei UI","Malgun Gothic","sans-serif"; font-size: 12pt;"><b>From:</b> <a href="mailto:dg@cowlark.com" target="_parent">David
 Given</a><br>
<b>Sent:</b> ‎Wednesday‎, ‎24‎ ‎April‎ ‎2019 ‎10‎:‎50<br>
<b>To:</b> <a href="mailto:e3-hacking@earth.li" target="_parent">Discussion of the Amstrad E3 emailer hardware/software</a></font></div>
</div>
<div><br>
</div>
<div dir="">
<div dir="ltr">The E3 is based on an ARM reference design, isn't it? What's the feasibility of emulating one?</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Wed, 24 Apr 2019 at 11:46, Ralph Corderoy <<a href="mailto:ralph@inputplus.co.uk" target="_parent">ralph@inputplus.co.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
Hi Nick,<br>
<br>
> > That should be possible as you have the files, now without their 16<br>
> > bytes per 512 bytes overhead.  You need to work out how many blocks<br>
> > to erase based on the size of each file you're trying to put back.<br>
> > IIRC I pointed out a block is the unit of erasure and it's 16 KiB.<br>
><br>
> So e3-nand.0 is 3584 KB so how many blocks go into it…? so how many<br>
> times dose 16KB going in to 3584KB…?? I don’t know..?? I can’t divide.<br>
> Iam a bit ok on Add not brilliant at Times but can’t do Divide.<br>
<br>
Having stripped the excess OOB data, I have these sizes for each file in<br>
bytes.<br>
<br>
     3670016  e3-nand-backup.0<br>
      262144  e3-nand-backup.1<br>
      262144  e3-nand-backup.2<br>
      262144  e3-nand-backup.3<br>
    28311552  e3-nand-backup.4<br>
      786432  e3-nand-backup.5<br>
<br>
You're right, 3,670,016 B is 3,584 KiB because<br>
    3,670,016 / 1,024 = 3,584<br>
so 1,024 goes into 3,670,016 exactly 3,584 times.<br>
<br>
But the size of the erase block is 16 KiB which is<br>
    16 * 1,024 = 16,384<br>
so we want to know how many times 16,384 goes into 3,670,016.<br>
    3,670,016 / 16,384 = 224<br>
224 is what you worked out in your other email.<br>
<br>
Taking those six sizes above and repeating the same sum gives<br>
<br>
     3,670,016 / 16,384 =   224<br>
       262,144 / 16,384 =    16<br>
       262,144 / 16,384 =    16<br>
       262,144 / 16,384 =    16<br>
    28,311,552 / 16,384 = 1,728<br>
       786,432 / 16,384 =    48<br>
<br>
Now I haven't been carefully following along how to extract<br>
e3-nand-backup.* in the first place, and how to write them back.<br>
I'm aware there's a script involved and a command where one of the<br>
parameters is the number of 16 KiB blocks to erase.  Hopefully, plugging<br>
in those numbers above for each of the matching areas will work, but<br>
it's your responsibility whether to go ahead as you're the one actually<br>
doing all this;  I've just been sitting at a keyboard.  :-)<br>
<br>
-- <br>
Cheers, Ralph.<br>
<br>
_______________________________________________<br>
e3-hacking mailing list<br>
<a href="mailto:e3-hacking@earth.li" target="_parent">e3-hacking@earth.li</a><br>
<a href="https://eur02.safelinks.protection.outlook.com/?url=https://www.earth.li/mailman/listinfo/e3-hacking&data=02%7c01%7c%7c69c6e14295c74042cbee08d6c89da440%7c84df9e7fe9f640afb435aaaaaaaaaaaa%7c1%7c0%7c636916976717334364&sdata=H8JmqamoTJhIAa7TQhXCgsEi3PcAkEvrW%2Bay%2BXLRoX8%3D&reserved=0" target="_parent" rel="noreferrer">https://www.earth.li/mailman/listinfo/e3-hacking</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature" dir="ltr">
<div dir="ltr">
<div>┌─── <a href="https://eur02.safelinks.protection.outlook.com/?url=http://www.cowlark.com&data=02%7c01%7c%7c69c6e14295c74042cbee08d6c89da440%7c84df9e7fe9f640afb435aaaaaaaaaaaa%7c1%7c0%7c636916976717344381&sdata=Abpjta6/p30KJcUM%2B0iv7RleOUP1AKBymsAfb1mhhSI%3D&reserved=0" target="_parent">
http://www.cowlark.com</a> ───<br>
│ "I have always wished for my computer to be as easy to use as my<br>
│ telephone; my wish has come true because I can no longer figure out<br>
│ how to use my telephone." --- Bjarne Stroustrup</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>