View Single Post
Old 08-27-2012, 07:14 AM   #1
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Adventures with Binfmt_misc...

OR perhaps the title should be...

"Twobob once again messes around with something he barely understands"

So anyways. THIS FILE IS FOR A 3. Just to be clear.

Check if we have Kernel Support
root@kindle:root> zcat /proc/config.gz | grep -i binfmt_misc
Quote:
# CONFIG_BINFMT_MISC is not set
Nope.. So we need a module as we can load those...

Get Thing. I will attach the kindle 2.6.26-rt-lab126 3.3 version that I splattered through BuildRoot. Using the 2006q3 CS TC and the right kernel headers in place. (Thanks Niluje, Knc1)

Just some extra info: (notice the MAGIC is revealed here)
Spoiler:
root@kindle:root> readelf -a /mnt/us/modules/binfmt_misc.ko
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: ARM
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 8900 (bytes into file)
Flags: 0x4000000, Version4 EABI
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 23
Section header string table index: 20

No version information found in this file.
Attribute Section: aeabi
File Attributes (none shown)

Also there are no dependencies : )



Insert module

example:
insmod /path/to/somewhere/onfat/module/binfmt_misc.ko
(mine is on /mnt/us/modules/binfmt_misc.ko) so I go

root@kindle:root> insmod /mnt/us/modules/binfmt_misc.ko

Check it's loaded

root@kindle:root> lsmod
Spoiler:
Quote:
Module Size Used by
binfmt_misc 8552 0
g_ether 21096 0
option 12512 2
usbserial 27756 5 option
ehci_hcd 38880 1 option
usbcore 136388 4 option,usbserial,ehci_hcd
ar6000 161076 0
ppp_async 8612 1
crc_ccitt 1856 1 ppp_async
ppp_generic 19252 5 ppp_async
slhc 5984 1 ppp_generic
volume 8900 1
fiveway 23552 1
mxc_keyb 15904 1
uinput 7776 0
fuse 48348 2
arcotg_udc 38628 1 g_ether
mwan 7324 2 ehci_hcd,ppp_async
eink_fb_shim 118588 0
eink_fb_hal_broads 397532 0
eink_fb_hal 59764 8 eink_fb_shim,eink_fb_hal_broads


Mount it somewhere

mkdir /mnt/us/proc/sys/fs/binfmt_misc

(or wherever you want it, I'm going to try that)

Check it's mounted

Spoiler:
Quote:
root@kindle:root> mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (ro,noatime,nodiratime,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw)
rwfs on /mnt/rwfs type tmpfs (rw,size=32768k)
rwfs on /var type tmpfs (rw,size=32768k)
/dev/mmcblk0p2 on /var/local type ext3 (rw,sync,errors=continue,data=ordered)
fsp on /mnt/us type fuse.fsp (rw,nosuid,nodev,noatime,user_id=0,group_id=0)
fsp on /opt/amazon/screen_saver/600x800 type fuse.fsp (rw,nosuid,nodev,noatime,user_id=0,group_id=0)
/dev/loop/0 on /mnt/base-us type vfat (rw,noexec,noatime,nodiratime,fmask=0022,dmask=002 2,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8)
usbfs on /proc/bus/usb type usbfs (rw)
none on /mnt/us/proc/sys/fs/binfmt_misc type binfmt_misc (rw)


/mnt/us/proc/sys/fs/binfmt_misc should now contain two files:

register and status

I'll continue this when I have more. We are going to use this to do some loading wangles with a bit of luck and further reading on my part. Thought I would share my experiences so far.

REFS: http://www.kernel.org/doc/Documentation/binfmt_misc.txt
http://en.wikipedia.org/wiki/Binfmt_misc
And one from Knc1 that I'm still looking for... TBC...
Attached Files
File Type: gz binfmt_misc.ko.tar.gz (5.3 KB, 39 views)
twobob is offline   Reply With Quote