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 02-22-2014, 03:49 PM   #1
JesseGordon
Junior Member
JesseGordon began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kindle 3 keyboard
Native graphics demo & How do I attach getty to keyboard?

Good Day,

this is my first post on mobileread.

This is about Kindle 3 / Kindle Keyboard

I found that the graphical user interface of course big java blob run in the virtual /usr/java/bin/cvm which is launched on boot (with a tonna command line parameters) from /etc/init.d/boot_finished

This means that if you want to launch some other program instead (or before) you can add it to this boot_finished file. You may have to make sure paths are set correctly.

I have also written a very hasty hack of a simple primitives graphics "library" to draw lines, circles, and rectangles on the display using /dev/fb0 - which by passes the java user interface. (See attached.)

I compiled it with scratchbox compiler as described here: https://www.mobileread.com/forums/showthread.php?t=59828

Except I had to use deb2tgz because I was using slackware.

Anyway, What I would love to do is have my K3 come up without the java thing going and just present me with a linux command prompt.

The keyboard seems to show up as a regular event device in /dev/input/event0 (for keyboard), event1 (for joypad), and event2 for volume buttons.

However I really want to do is have the kindle boot up and give me a root prompt on the display/keyboard without ever even loading the javabloat.

Then from the command line I can launch whatever of my own compiled C apps I want.
Think of it as a little computer that can run the display for days on a charge.

I know there are terminals, but don't those run within the java system?

I will probably have to write a kernel driver which shows up as a serial port and reads from keyboard and writes to fb0, unless someone already did?

Any advice would be much appreciated.

Thanks,

Jesse

EDIT/PS: I've updated graphics library to also support alpha drawing as well as anti-aliasing, as well as polygons with holes. ~Jesse@3-29-2014
Attached Thumbnails
Click image for larger version

Name:	P1000741-cropped.JPG
Views:	268
Size:	346.8 KB
ID:	119401  
Attached Files
File Type: txt kindle_graphics.c.txt (54.4 KB, 207 views)

Last edited by JesseGordon; 03-30-2014 at 02:52 AM.
JesseGordon is offline   Reply With Quote
Old 02-23-2014, 01:19 PM   #2
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
There's a terminal emulator ready for you to use, just search this board. I'm not sure what you want with that serial port emulation, since all you want to do is perfectly fine with running in userspace (reading input events, writing to the framebuffer). See e.g. Luigi's terminal application: https://www.mobileread.com/forums/sho...d.php?t=109472 - but I think there were others featured in this board. Check out the Index (sticky thread).

As for not running the Java framework - that is probably possible, have a look out for what's starting /etc/init.d/framework.

Oh, and make a backup (using k3flasher or similar) before locking you out. Just sayin'.
hawhill is offline   Reply With Quote
Advert
Old 02-23-2014, 03:54 PM   #3
Ian.M
Connoisseur
Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!
 
Posts: 71
Karma: 57134
Join Date: Aug 2013
Device: Kindle 3 GB 3G
I use MYTS-8 which you will find in the thread:
https://www.mobileread.com/forums/sho...d.php?t=154500
Its lighter than all the alternatives I tried as all it does is be a terminal.

If you are using it from the framework, you need KUAL, KITE, Launchpad or similar to invoke it but it can also be invoked from a script. Its multi-session and you can leave a session then re-attach to any open session.
Ian.M is offline   Reply With Quote
Old 02-23-2014, 04:46 PM   #4
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
Ah, yes, myts was what I used too on my K3 back then when it still lived :-) Suggested!
hawhill is offline   Reply With Quote
Old 02-27-2014, 10:12 PM   #5
JesseGordon
Junior Member
JesseGordon began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kindle 3 keyboard
Does myts run independently of the java machine? I tried to get myts to work but it just hung and would not appear on the screen.

My goal is a text command line interface that runs instead of the java user interface.

Thanks,

Jesse
JesseGordon is offline   Reply With Quote
Advert
Old 02-28-2014, 08:08 AM   #6
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by JesseGordon View Post
Does myts run independently of the java machine? I tried to get myts to work but it just hung and would not appear on the screen.

My goal is a text command line interface that runs instead of the java user interface.

Thanks,

Jesse
What do you have when you do not start the framework, but do start the shell ?
knc1 is offline   Reply With Quote
Old 02-28-2014, 08:31 AM   #7
Ian.M
Connoisseur
Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!
 
Posts: 71
Karma: 57134
Join Date: Aug 2013
Device: Kindle 3 GB 3G
Well, I have just run /etc/init.d/framework stop from myts-8 and on exiting myts the framework was indeed non-responsive (although myts did restore the previous framework display on exit). I have launchpad running so was able to reenter myts with [shift][T][T] and myts is operating normally. I then restarted the framework and the kindle is operating normally.
Ian.M is offline   Reply With Quote
Old 03-01-2014, 01:55 PM   #8
JesseGordon
Junior Member
JesseGordon began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kindle 3 keyboard
Quote:
Originally Posted by knc1 View Post
What do you have when you do not start the framework, but do start the shell ?
Just ssh access. What seems to be lacking is a tty interface that reads from the keyboard and writes to the display presenting it as a target for *getty to present a login, for example.

Thanks,

Jesse
JesseGordon is offline   Reply With Quote
Old 03-01-2014, 03:54 PM   #9
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
The linux kernel does have fbcon devices (in general, not in the Kindle's distributed variant, I think), though I guess they don't support 4bpp very well. On the other hand, fbgetty exists.

That said, I'm not sure what is wrong with myts for you. It works without the Java VM of course (its sources are available to check). If it didn't work for you, there's another thing you're missing. One thing that comes to my mind would be simply the standby timeout, after which the keyboard is disabled (look out for the powerd process which manages this).
hawhill is offline   Reply With Quote
Old 03-01-2014, 05:08 PM   #10
JesseGordon
Junior Member
JesseGordon began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kindle 3 keyboard
yeah I don't know why myts wouldn't do anything for me. I'll have to try again. I did notice that the keyboard is powered down when the thing goes to sleep, but I don't think it was asleep when I tried. Maybe it was though.

Thanks for the tips on fbcon and fbgetty. It would probably take some tweaking to get it working on kindle since kindle needs refresh signals and such. fbcon is an interesting idea too because I know that the kernel can switch to fb mode to give more text lines on PCs.

But I'm afraid I'd have to recompile the kernel for the kindle to turn that on.

Thanks,

Jesse
JesseGordon is offline   Reply With Quote
Old 03-02-2014, 09:23 AM   #11
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by JesseGordon View Post

But I'm afraid I'd have to recompile the kernel for the kindle to turn that on.

Thanks,

Jesse
The K3 devices do not run X - only framebuffer - so it is already "on".
knc1 is offline   Reply With Quote
Old 03-02-2014, 01:33 PM   #12
Ian.M
Connoisseur
Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!Ian.M will blow your mind, man!
 
Posts: 71
Karma: 57134
Join Date: Aug 2013
Device: Kindle 3 GB 3G
If I were you, I'd start with a 'vanilla' Launchpad + Myts-8 install, confirm the terminal is operating properly and only then try to start Myts instead of the framework. Hopefully you can then figure out what it needs to work.

As Myts uses a single keypress to exit, running it without some way of re-invoking it is not a good idea.
Ian.M is offline   Reply With Quote
Old 03-02-2014, 01:44 PM   #13
JesseGordon
Junior Member
JesseGordon began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kindle 3 keyboard
Quote:
Originally Posted by knc1 View Post
The K3 devices do not run X - only framebuffer - so it is already "on".
I meant to say that I would have to recompile the kernel to turn on fbcon.

I am aware that K3 does not run X, and that the framebuffer is already enabled.

However, the framebuffer is different than fbcon: the frame buffer is just an output device -- a driver for displaying graphics on the screen. It does not perform any input functionality.

fbcon, on the other hand, uses the framebuffer as the output interface, but fbcon also reads from the keyboard and thus provides a full input and output user interface.

fbcon is a kernel driver: http://free-electrons.com/kerneldoc/latest/fb/fbcon.txt

Actually, a slightly modified fbcon would be splended for the k3.

Does anyone know how hard it is to compile a kernel for a k3? I have the arm scratchbox cross compiler set up and can compile simple programs no problem, but I'm not sure if I'd be able to compile a kernel...! Fortunately however the K3's current kernel config is available from /proc/config.gz.

Thanks,

Jesse
JesseGordon is offline   Reply With Quote
Old 03-02-2014, 03:29 PM   #14
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by JesseGordon View Post
I meant to say that I would have to recompile the kernel to turn on fbcon.

I am aware that K3 does not run X, and that the framebuffer is already enabled.

However, the framebuffer is different than fbcon: the frame buffer is just an output device -- a driver for displaying graphics on the screen. It does not perform any input functionality.

fbcon, on the other hand, uses the framebuffer as the output interface, but fbcon also reads from the keyboard and thus provides a full input and output user interface.

fbcon is a kernel driver: http://free-electrons.com/kerneldoc/latest/fb/fbcon.txt

Actually, a slightly modified fbcon would be splended for the k3.

Does anyone know how hard it is to compile a kernel for a k3? I have the arm scratchbox cross compiler set up and can compile simple programs no problem, but I'm not sure if I'd be able to compile a kernel...! Fortunately however the K3's current kernel config is available from /proc/config.gz.

Thanks,

Jesse
You should be able to compile that as a module.
If you can, then just build that module for the existing kernel.

I built full sets of modules for the various kernels awhile back, I may have already built it.

If not, then I still put all the info (as small scripts) on how they where built as part of the Bit Bucket repo where they live.

I seem to have mis-placed the public repository, so in the meantime:
https://www.mobileread.com/forums/sho...5&postcount=47

Same user name on Bit Bucket as here.

Last edited by knc1; 03-02-2014 at 05:09 PM.
knc1 is offline   Reply With Quote
Old 03-03-2014, 12:23 AM   #15
JesseGordon
Junior Member
JesseGordon began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kindle 3 keyboard
Quote:
Originally Posted by knc1 View Post
You should be able to compile that as a module.
If you can, then just build that module for the existing kernel.

I built full sets of modules for the various kernels awhile back, I may have already built it.

If not, then I still put all the info (as small scripts) on how they where built as part of the Bit Bucket repo where they live.

I seem to have mis-placed the public repository, so in the meantime:
https://www.mobileread.com/forums/sho...5&postcount=47

Same user name on Bit Bucket as here.
knc1, thanks so much for digging up that info!

I did get your tarball and unpack it, but there's nothing in there about fbcon - but it was worth a try!

Do you have any sage advice for me on how to compile a module all by itself? Do I need a copy of the lab126 rt 2.6.26 kernel to do that, probably?

Thank you so much for helping out a clueless me!

Jesse
JesseGordon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle 3 keyboard usb demo mode awfargo Kindle Developer's Corner 6 11-07-2013 05:27 PM
I compiled LinkX on a deb chroot kindle Keyboard and would like to use Graphics Mode kindletop Kindle Developer's Corner 3 08-10-2013 06:49 AM
Demo Kindle Keyboard USB Problems tommytomtom Kindle Developer's Corner 1 01-25-2013 03:42 AM
Kindle Keyboard 3g/wifi demo unit DWnMentor Amazon Kindle 9 06-19-2012 07:30 PM
Kobo & inline graphics Slope Kobo Reader 7 02-21-2011 12:25 PM


All times are GMT -4. The time now is 11:47 AM.


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