Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2016, 10:03 AM   #301
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
I downloaded and installed the squashfs tools from there a few days ago. I had to build them from source, and they work fine, but I still cannot MOUNT an old squashfs partition (probably a kernel thing). At least the squashfs tools get the job done...

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...
geekmaster is offline   Reply With Quote
Old 05-26-2016, 10:32 AM   #302
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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.
geekmaster is offline   Reply With Quote
Advert
Old 05-26-2016, 01:05 PM   #303
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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:
#> cat /proc/filesystems
nodev    sysfs
nodev    rootfs
nodev    bdev
nodev    proc
nodev    sockfs
nodev    usbfs
nodev    usbdevfs
nodev    pipefs
nodev    tmpfs
nodev    devpts
    ext3
    ext2
    squashfs
nodev    ramfs
    msdos
    vfat
nodev    devfs
nodev    mqueue
    rfs

#> mount -o loop,noatime,nodiratime -t ext3 /mnt/mmc/img/armv4l_rootfs.ext3 /mnt/mmc/mnt/armv4l_rootfs

#> mount
devfs on /dev type devfs (rw)
/
dev/bml0/6 on type squashfs (ro)
/
dev/stl0/8 on /opt type ext3 (rw,sync,noatime,nodiratime)
/
proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)
devfs on /dev type devfs (rw)
/
dev/stl0/9 on /mnt/us type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
/
dev/bml0/7 on /mnt/dc type squashfs (ro)
/
dev/mmc/blk0/part1 on /mnt/mmc type vfat (rw,sync,dirsync,noatime,nodiratime,fmask=0022,dmask=0022)
/
dev/loop/0 on /mnt/mmc/mnt/armv4l_rootfs type ext3 (rw,noatime,nodiratime)

#> ls -al /mnt/mmc/mnt/armv4l_rootfs
drwxr-xr-x   16 root     root         1024 May 26  2016 .
drwxr-xr-x    5 root     root        32768 May 26 10:52 ..
drwxrwx---    2 root     999          1024 May  8 07:33 bin
drwxrwx
---    3 root     999          1024 May  8 07:43 dev
-rwxrwx---    1 root     999             7 Jan 29  2009 etc
drwxrwx
---    2 root     999          1024 Jan 29  2009 home
-rwxr-xr-x    1 root     root          428 Jan 11 19:28 init
drwxrwx
---    2 root     999          1024 Jan 29  2009 initrd
drwxrwx
---    2 root     999          1024 May  8 07:43 lib
-rwxrwx---    1 root     999            11 Jan 29  2009 linuxrc
drwx
------    2 root     root        12288 May 26  2016 lost+found
drwxrwx
---    5 root     999          1024 May  8 07:43 mnt
drwxrwx
---    2 root     999          1024 Jan 29  2009 opt
drwxrwx
---    2 root     999          1024 Jan 29  2009 proc
drwxrwx
---    2 root     999          1024 May  8 07:43 sbin
drwxrwx
---    2 root     999          1024 Jan 29  2009 sys
drwxrwx
---    2 root     999          1024 Jan 29  2009 tmp
drwxrwx
---   17 root     999          1024 May  8 07:43 usr
drwxrwx
---    2 root     999          1024 May  8 07:43 var

#> /mnt/mmc/mnt/armv4l_rootfs/usr/bin/gcc -v
Using built-in specs.
Targetarmv4l-unknown-linux
Configured with
: /home/landley/aboriginal/aboriginal/build/temp-armv4l/gcc-core/configure --target=armv4l-unknown-linux --prefix=/home/landley/aboriginal/aboriginal/build/native-compiler-armv4l/usr --disable-multilib --disable-nls --enable-c99 --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --program-prefix= --enable-threads=posix --enable-shared --build=x86_64-walrus-linux --host=armv4l-unknown-linux --with-float=soft
Thread model
posix
gcc version 4.2.1

#> umount /mnt/mmc/mnt/armv4l_rootfs

#> sync

#> mount
devfs on /dev type devfs (rw)
/
dev/bml0/6 on type squashfs (ro)
/
dev/stl0/8 on /opt type ext3 (rw,sync,noatime,nodiratime)
/
proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)
devfs on /dev type devfs (rw)
/
dev/stl0/9 on /mnt/us type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
/
dev/bml0/7 on /mnt/dc type squashfs (ro)
/
dev/mmc/blk0/part1 on /mnt/mmc type vfat (rw,sync,dirsync,noatime,nodiratime,fmask=0022,dmask=0022
As you may recall, I mentioned a need for a small delay after unmounting but before exiting. As seen above, I replaced that with a "sync", which has been working fine so far... In fact, I wonder if I can avoid that by adding "sync" to the mount command, as you can see (in the "mount" output) is the default setting for the /opt partition and for the SD card (which also uses "dirsync").

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.
geekmaster is offline   Reply With Quote
Old 05-26-2016, 03:53 PM   #304
NullNix
Guru
NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.
 
Posts: 916
Karma: 13928438
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
Quote:
Originally Posted by geekmaster View Post
One time recently, my PC decided to move ALL the files on my kindle (/mnt/us) into a FOUND.000 directory, renamed as .CHK files (and extended to a multiple of 4K).
Ah, memories. That's behaviour inherited from the horrifically-misnamed DOS RECOVER program, which would have been better named DISASTER because of what it did if you ran it as an unwary user (renamed files on the disk into .CHK files in the root directory until the root directory filled up at 512 files, then stopped). It used the root directory because the thing had more or less not been maintained since DOS 1.0, before directories existed.

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...
NullNix is offline   Reply With Quote
Old 05-26-2016, 04:16 PM   #305
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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!
geekmaster is offline   Reply With Quote
Advert
Old 05-26-2016, 04:21 PM   #306
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by NullNix View Post
... 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 ... I see that CHKDSK has improved a bit: it's at least putting the files into subdirectories now...
CHKDSK really wants to run if it sees a dirty bit on a drive, and I have had that too much lately with SLOW (really really slow) SD card access over kindle USB. Nothing FUBAR -- all good if I "just say no" to the disk check, but it gets annoying after awhile and I say yes. I guess I should say no, make a backup copy, and then let checkdisk either say my disk was fine, and now and then decide to FUBAR all over my disk. I need a tool to reset that dirty bit (making the disk look like it cleanly dismounted, which it APPEARED to do, but apparently did not).

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.
geekmaster is offline   Reply With Quote
Old 05-27-2016, 12:53 AM   #307
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 05-27-2016, 08:18 AM   #308
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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.
geekmaster is offline   Reply With Quote
Old 05-27-2016, 09:33 AM   #309
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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.
geekmaster is offline   Reply With Quote
Old 06-14-2016, 09:06 AM   #310
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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.
geekmaster is offline   Reply With Quote
Old 07-18-2016, 08:03 AM   #311
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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.
geekmaster is offline   Reply With Quote
Old 07-19-2016, 02:11 PM   #312
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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.
geekmaster is offline   Reply With Quote
Old 07-21-2016, 02:52 PM   #313
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
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:
An exciting time indeed - now this WiFiSD card is a perfectly working ARMv5 computer with a kernel and ramdisk we can build, and 16GB of storage. Pity it only has 32MB of RAM. Well, we do have ability to modify the kernel now. I added support for swap, ext4, sysfs, loop, and a few other modern conveniences we all know and love. Once again the card booted. Now I was able to swapon a file on the SD card, loop-mount a 2GB ext4 filesystem and chroot into a version of ubuntu in there. Once inside, it is the nice and comfy environment you'd expect. I was able to bring up sshd with X-forwarding, and even run firefox on the card (it was slow). Modifying the card's boot scripts again, I tried to get it to do all this on boot and succeeded. SWEET! The card has a myriad of uses now. Something cool: it will boot and run outside of a valid SDHC host. In fact, aplying power to it is enough.

Last edited by geekmaster; 07-21-2016 at 03:26 PM.
geekmaster is offline   Reply With Quote
Old 07-23-2016, 08:20 AM   #314
Leo365
Member
Leo365 began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Sep 2014
Device: Kindle
Quote:
Originally Posted by geekmaster View Post
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.
It looks very interesting. Would it be able to build a native terminal program or app launcher providing onscreen keyboard for minimum feature?
Leo365 is offline   Reply With Quote
Old 07-23-2016, 09:13 AM   #315
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by Leo365 View Post
It looks very interesting. Would it be able to build a native terminal program or app launcher providing onscreen keyboard for minimum feature?
Yes. It just takes a developer to allocate time for it. My time is limited.

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.
geekmaster is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
geekmaster vacation geekmaster Kindle Developer's Corner 2 03-19-2012 09:18 PM


All times are GMT -4. The time now is 08:01 PM.


MobileRead.com is a privately owned, operated and funded community.