05-26-2016, 10:03 AM | #301 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Always fun using old tech that relies on features no longer supported by modern tools, eh? Still trying to adjust to using kdiff3 instead of winmerge... |
|
05-26-2016, 10:32 AM | #302 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I just tried mounting the toolchain.sqf file from the aboriginal armv4l directory where I successfully compiled working apps (including my kindle video player) for my K1. That squashfs file gets mounted in the chroot environment (with a custom kernel) to do compiles. I was also able to successfully mount it in my recent linux mint distro, so it is NOT an old squashfs 3.0 format. The K1 firmware must use squashfs 3.0 because that is what the K1 supports.
However, on the K1, that newer squashfs format file fails to mount. So I need to copy the files to an ext3 image file (probably much easier than trying to create an "antique" squashfs format). Then I can try to run gcc on my K1, but I need to mount a filesystem containing gcc first... EDIT: I just tried mounting the K1 rootfs image (squashfs 3.0 format) inside the aboriginal armv4l chroot environment -- fail. It does not support squashfs 3.0, so using a common format like ext3 makes a lot more sense, though we lose any speedup we could get transferring squashfs-compressed data over the slow SD interface on the K1. I *could* convert toolchain.sqf to squashfs 3.0 *just* for the K1, but not right now... Priorities, limited time, demands of life, and such... Last edited by geekmaster; 05-26-2016 at 11:04 AM. |
Advert | |
|
05-26-2016, 01:05 PM | #303 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
My K1 now has an SD card in it with a file called "armv4l_rootfs.ext3". My RUNME.sh script mounts that file at "/mnt/us/mnt/armv4l_rootfs". It contains a copy of the file trees for both the K1 FW 1.2 rootfs image AND for the aboriginal linux armv4l toolchain image.
My RUNME.sh script mounted it, and (amongst other things) did a "gcc -v" from within it, so that we can verify that gcc runs on my (unmodified) K1. There are no changes to the kindle filesystem (other than /mnt/us and the SD card on /mnt/mmc). Here are the logged results of this test: PHP Code:
I might need an older version of gcc to compile kernel modules on/for my K1. Thankfully, landley.net has an archive full of old versions of aboriginal linux (and iits predecessor "firmware linux"). Surely at least ONE of them must have a similar gcc to what lab126 is using. Though it might be easier to just build the toolchain supplied in the FW 1.2 GPL source code from amazon, eh? Anyway, another baby step towards building usbnetworking into my K1... EDIT: The reason I placed a copy of the K1 root filesystem into my ext3 image is so that I can eventually "pivotroot" to it (replacing the root filesystem for ALL processes, not just my "chroot" shell). This way I can modify a much larger COPY of the K1 filesystem, with global effect, without fear of bricking my device. I will need a script added to rcS.d, which mounts and pivotroots ONLY if the SD card is installed and configured properly. If any problems, reboot WITHOUT the SD card, and all is well. That is what I used to do on my OpenWRT routers. Oh... and BTW, my 5v MAX232 chips ran JUST FINE at 3.3v (but these days we use USB serial adapter cables instead)... Last edited by geekmaster; 05-26-2016 at 01:22 PM. |
05-26-2016, 03:53 PM | #304 | |
Guru
Posts: 916
Karma: 13928438
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
|
Quote:
CHKDSK later acquired RECOVER's abilities, and does the RECOVER thing in the single obscure situation in which you were *meant* to run RECOVER: i.e. if the root directory was sufficiently FUBAR that no directories could be located (on FAT, the precise file sizes are also recorded in the directory, which explains why it had to round everything up to FAT cluster sizes). I see that CHKDSK has improved a bit: it's at least putting the files into subdirectories now... |
|
05-26-2016, 04:16 PM | #305 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Except on linux, one of the fsck-related programs did the same thing on a GPT disk -- only later did I discover that a lot of those "disk utils" do not support GPT and use the "fake MBR" data instead. Still trying to recover from that disaster (again today, in fact)... What I learned from that? Avoid GPT partitions on linux if at all possible!
|
Advert | |
|
05-26-2016, 04:21 PM | #306 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
So really, Windows and linux both have their mean streaks -- either on GPT disks in linux, or on slow disks in Windows... The problem with my EXT4 disk is that my original virtualbox raw VMDK for it claims it has 1K sectors, but now after it was "fsck"ed up, it has 4K sectors that it claims are "misaligned". So if the whole partitions are not starting where they should, then obviously the superblocks are all fake too (both because of a shift in where it thinks the partition starts AND because of the wrong sector or block size. A mess. I have a backup of the first 100mb of the disk from before it ws damaged, and I wrote that back to the drive, but no help after fsck deleted EVERY file from it. Testdisk sees two partitions with the same name (over and over) at 1986 and at 1988. Meh, tired of dicking with it now. I have some android code I want to dick with yet today... Last edited by geekmaster; 05-26-2016 at 04:26 PM. |
|
05-27-2016, 12:53 AM | #307 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
@GM,
I did not know fsck misbehaved like that on GPT disks. Have they fixed it yet? Never used GPT myself, though. As for the Windows dirty bit, I have had the most infuriating "luck" whenever I touched a Windows computer with an external/usb drive/Kindle. Windows is extremely trigger-happy and the first time you remove a device without Safely Remove Hardware it gives it the scarlet letter. Supposedly chkdsk will verify everything then unset the dirty bit, but noooooooo, I have tried chkdsk'ing thumb drives and Kindles 6 or 7 times in a row and doing Safely Remove Hardware just like Windows wants, and it never goes away. I don't know what I could be doing wrong, maybe the claim that chkdsk will fix the dirty bit is a lie? But apparently the location has been discovered, and you can fix the drive by editing the raw drive with a hex editor. Go Microsoft! https://www.raymond.cc/blog/manually...kdsk/view-all/ ... I rather think it is slightly safer on Linux. |
05-27-2016, 08:18 AM | #308 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
@eschwarts: interesting link.
In windowsland, I use this to unmount "locked" volumes such as NTFS drives and such: http://mt-naka.com/hotswap/index_enu.htm It basically does the same as marking a drive "offline" in windows disk manager, but without writing that "offline" status onto the physical drive (like a dirty bit). I also right-click eject sometimes too, but hotswap in my tooltray is easier. I have an extra problem -- my linux is a VM, and I am passing my USB devices (including the hard drives in question) into VirtualBox. The problem is that windows grabs it momentarily after ejecting it from linux, and every time windows thinks it sees a USB drive show up it WRITES a "readyboost" temp file to it (then deletes it) to see if it is fast enough to support readyboost. This REALLY SUCKS when you want to do data recovery on that device. I have it turned off in windows and it still does it too often. Another piece of suckage is I find windows update temp files and folder show up on drives without permission -- even on "data recovery" targets. And worse, I have an EXT IFS driver on my windows so it can read (an write) EXT2/3/4 drives as though they were NTFS (except it chokes on symlinks, and filenames that LOOK the same when you ignore case). And now it WRITES windows update temp files on my EXT4 USB drives too. So with the time delay between VirtualBox grabbing and releasing a USB drive for the VM, windows mucks with it. But like I said, linux bit me all to often too, and google will show you plenty of complaints about how disk tools in linux have missing or incomplete (or just plain bad) GPT support. It certainly bit me... But really, a 2TB drive had no reason being GPT in the first place -- though pretty much a requirement on larger drives. In any case, some of the more important stuff on the scrambled GPT EXT4 drive was copied to an NTFS drive (scrambling file permissions and symlinks and such) before it got corrupted. I still have stuff on it I want (mainly dir trees and filenames) -- I already got a bunch of numbered files with a file carving up -- but that is a time killer browsing through those (and the drive was pretty badly fragmented, so a lot of carved files are bad)... EDIT: But the DEEPER cause of the problem is that my USB jacks are getting worn out on my ultrabook laptop. Even slight movements makes some USB devices drop out momentarily (noticeable only from the windows "DAH-doink / dah-DOINK" sounds when USB devices come and go). And of course Windows does its dirty work on them when that happens (even if they are passed through to VirtualBox). The more I use USB storage, the more I hate windows... And standard USB jacks were originally designed for only 1500 insertions and removals, but on thin devices like laptops they are subject to a lot more stress and I have had some get flakey in just hundreds of insertions and removals. They did not expect you to crawl down behind your huge tower PC and swap USB cables more than a few times per year, not dozens of times per hour when testing kindle updates. And on a K1, you DO need to physically remove the cable (not just eject it) to get out of USB MS mode, so (sometimes) I use an extender cable to wear that out instead of the non-replaceable jacks. The REAL problems seem to be in my USB 3.0 (superspeed) cables and jacks, which have extra pins and wires tucked inside them, so more stuff to go wonky sooner, and more likely to have periodic physical connection dropouts (especially on laptops). And that plays havoc with a linux VM using those drives on a windows host. Last edited by geekmaster; 05-27-2016 at 09:01 AM. |
05-27-2016, 09:33 AM | #309 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I think it is time to get an oncreen launcher (or shell) going on my K1 so I can do tests without wearing out my USB jacks. On a K1, the UYK "update install" method requires disconnecting and reconnecting the USB cables to make and test RUNME.sh changes. Just doing a USB "eject" is not enough.
Regarding a quick way to get a shell running on the K1 screen and keyboard, here are some places to begin: This script was for the K3 (with keyboard), but limited to the restricted character set supported by "eips": tinysh - tiny limited onscreen shell This script outputs a full range of (tiny) characters to the eink display ("eips" replacement): titty - tiny tty (display tiny text on eink display) And here is a script where kamintkaze integrated my tinysh and titty scripts into a "complete" tiny shell with full character set support (click the "show" button): kittycon 1.0 - kindle tty console And for newer "keyboardless" touchscreen kindles, I had the (unpublished) beginnings of an onscreen keyboard script as well, based on this script: geekmaster simple touchscreen script support hack And this one: geekmaster touchscreen signature capture script Well, something simple is needed for the K1, and those are a place to start. But of course, we can compile C code now for the K1, so script-only terminals are a crude solution. The alternatives include hacking matan's "myts" terminal, but last time I hacked it fit my needs, it seemed like an "awful lot" of code to wrap my head around. I think a page (MR edit box) or three of C code is all I need, and my tiny brain can actually contain a few pages of source code. Last edited by geekmaster; 05-27-2016 at 10:15 AM. |
06-14-2016, 09:06 AM | #310 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I successfully compiled working code for my K1, using aboriginal linux native compiling inside the Windows 10 x64 "windows subsystem for linux" (a feature only for microosoft "fast path" devs, available to everybody this summer). It is real Ubuntu Bash, without a linux kernel (and lots of missing syscalls in the translation layer). Thankfully, the aboriginal compile scripts launch their own linux kernel in qemu. And x86_64 bogomips are almost identical inside the emulated kernel as outside (native instruction set, with just a few percent CPU overhead for handling system faults). I did have to tweak Rob Landley's aboriginal scripts though, just so they could work in win10 bash.
BTW, with this latest win10 developer beta, you install bash just by typing "bash" at the command line. Even "apt-get install" works in it (though many apps get "Function not implemented" errors from all the missing syscalls). And no "binfmt" kernel module, so I built a simple script to simulate it. No workaround for the missing "chroot" though, but aboriginal x86_64 is an okay alternative for now, and it lets me run apps that fail in Win10x64 bash. I use "nc" to push tarballs both ways through the emulation shell between "inside aboriginal" and "outside in win10 bash" (until I get SMB or CIFS working in an aboriginal shell). EDIT: And of course, like many embedded devices, the busybox/toybox implementation of "wget" lacks https:// support, and many source code repositories (like github, and many others) do not allow http:// access. So I need to use win10 bash "wget" with an "nc" pipe into my aboriginal shell. I need to compile a better "wget" for my aboriginal shells. Last edited by geekmaster; 06-14-2016 at 12:05 PM. |
07-18-2016, 08:03 AM | #311 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I just found the 16GB Transcend wifi SD card I had been looking for. I plan to try that on my K1. I hope it stays powered up so I can SSH into it (hacked firmware in the SD card), then use a pair of lock-free queue files on SD flash to tunnel TC/IP traffic between the K1 and host PC.
It is important to be very careful when writing to a filesystem like FAT32 from two sides that are unaware of each other (why kindles unmount userstore partition before sharing it with the host PC). However, it can be done safely if you stay within safety constraints (write only to existing files with no new allocations, disk syncs, etc). My lock-free queues just need to use pre-allocated files and all should be fine. The important thing is that the K1 not power down the SD card while I am trying to use it. |
07-19-2016, 02:11 PM | #312 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I tried the wifi SD card in my K1. I see the data on it in the kindle, but it does not appear on a wifi network scan. It makes sense to power it up only while it is being accessed to save battery. But in this case, I need it to stay on. The simplest apporach is to have a background task that accesses it often enough to keep it powered on. I will try that when I have more time. I have matters of life and death to deal with first.
|
07-21-2016, 02:52 PM | #313 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I added a script to periodically access the SD card to keep it powered on so it can keep its wifi interface up. But I discovered a race condition on startup. Sometimes the kindle sees 15GB free, and sometimes 0GB free. When 0GB free and connected to a PC over USB, the PC says it needs formatting. Because this card actually runs linux inside, it needs time to boot up, and the kindle probably tries to access it before it is ready (though it sometimes succeeds). It works much better to boot with SD card removed, then hot-plug insert it (when in always sees the 16GB card). The K1 should always have its power switch off when removing the SD card, but insertion works fine.
The problem is when running an update script, where the card is usually not ready. I suppose I need my update script to wait for SD card ready, then manually mount it, the "ping" it to keep it alive (hopefully with its hotspot visible so I can connect and SSH into it). The card already supports a couple of "flag files" which do stuff when deleted from the host device (such as a digicam). Perhaps we can extend that feature to add a "tcp tunnel" file (similar to what I described previously for STDIN command lines in and STDOUT results). Normal SD cards work just fine, and you can even install update packages from them. Not so when using this SD wifi card (except perhaps on rare occasions I have not yet seen). A race to init the card before the Kindle gives up on it -- as I mentioned, manual SD card mounting in a startup script should be an adequate workaround. My Transcend 16GB SD wifi card is running this hacked firmware: http://dmitry.gr/index.php?r=05.Proj...scend%20WiFiSD Quote:
Last edited by geekmaster; 07-21-2016 at 03:26 PM. |
|
07-23-2016, 08:20 AM | #314 | |
Member
Posts: 23
Karma: 10
Join Date: Sep 2014
Device: Kindle
|
Quote:
|
|
07-23-2016, 09:13 AM | #315 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
See this post: https://www.mobileread.com/forums/sho...63#post3323263 I just discovered that the PHP code blocks in that linked post display great in my chrome browser on my laptop PC, but on my android smartphone, viewing that post in chrome is very frustrating. The code blocks have large fonts (bigger than other post text) instead of the smallest "size 1" text. And worse, it extends off the right of the PHP code block with NO SCROLL BARS. Useless user experience. And I have published too much code here in that format -- how can we fix PHP tags on this website for android chrome web browsing? EDIT: Scrolling in PHP blocks on android device solved. Just drag the text block around inside the PHP window, despite no scroll bars. Not a website problem -- just a different in user interface between desktop and mobile google chrome web browsers. Glad I figured that out. Time to read find android docs and RTFM? Last edited by geekmaster; 07-23-2016 at 03:44 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
geekmaster vacation | geekmaster | Kindle Developer's Corner | 2 | 03-19-2012 09:18 PM |