yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab 3 General] r2d23cpo:
Please do not laugh at me. I know I see an eagle on the sky and I am trying to shoot it with stones. That what my limited Cro-Magnon mind can come up! jijiji

I will assume the following, before I point my self at Lost in Space.

We can assume that if I used "--mem-min=0x50000000" I get in response "Could not find a free area of memory of a000 bytes..." because there is no memory space for new Kernel. Then If I do not use "--mem-min=0x50000000" the new kernel is been place to far from Kexec to reach. Well at least as define in case R_386_32 & R_386_PC32, witch are the only relocation defined in

void machine_apply_elf_rel()

I have not received a suggestion of a ARM BASE Patch on a 4.2.2 kernel that I can look at to TRY to generate then the respective i686 ASM counterpart. But I guess I need to still mod the part I mention to allow the new kernel to be place near original Kernel. Now be sure that I do not know the allowed memory setups or limits for i386. I will still assume that I can manipulate the actual limit just the sample patch I have posted here. With Luck, I guess A LOT OF LUCK I will reach a happy medium until next error show up!!! jijijiji

I will give this a shot today. If not I guess I will modify Kexecboot Launcher to be use as a chroot or similar switch_root commands for Linux.

Note to the readers, I have not post links to code because that takes time, time that I like to spent trying to make this happen. But If any show interest I can happily post what you need.
[Galaxy Tab 3 General] Angel_666:
[MENTION=5688554]r2d23cpo[/MENTION] Hi! Glad to see your results! For multibooting functions you can try to dig this: https://android.googlesource.com/platform/hardware/intel/bootstub/+/android-5.0.2_r1 Witch is pretty the same as our's "sboot.bin" in Samsung firmware. I think sboot.bin is just samsung renamed Intel Bootstub Version 1.2. Just open our "sboot.bin" in hex editor, see the code and see the code in link that i post. If i do not wrong, it is possible to realize multiboot functions by bootstub. For example i see xen_multiboot_setup function in Intel bootstub code and we have xen preconfigured kernel defconfig in samsung opensource...

P.S. In Intel GeeksPhone Revolution used same clovertrail+ platform that we have (cloverview). And they have multiboot with FireFox OS...

Upd: Some info about Intel UEFI BootStub http://firmware.intel.com/blog/linux-efi-boot-stub

Linux porting on Intel Atom http://elinux.org/images/e/ee/Jacob-Pan-x86MID-elc2010.pdf
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=1649190]Angel_666[/MENTION],

I am glad you came by this thread. Even happier to see you giving advice. jjijiji I need a lot! Listen I am a bad programmer but I guess I have prove that I can read and understand, It just take time learning.

My principal goal is to have Linux natively on TAB310.1. I took the route of multyboot because I saw many thread in xda dedicated to kexecboot. I figure it should not be hard to implement. But It was wrong, the main documentation has been deleted and since the actual people that work initially did it 4 to 5 years ago. I had ask for help for the ones that do work in it today but they all get scare and quit once they see that our device is not ARM but x86.

To be honest there are many concepts in your comments that are known to me. Nothing that I can handle with a little reading. But what takes my attention is to play with "sboot..bin" . Isn't it true that If I mess up with sboot.bin I can lock my tab and end up with a brick?? We do not have "fastboot". So my very first question is:

How do I recover from a bad "sboot.bin" implementation. Is Odin capable of installing and recovering?

Then if that is possible, my next question is Can Odin recover our tablet if the main MBR and SB partitions are broken too? I know by hardware some Samsung devices will try to boot from specially formated external sdcard id the primary is not working. I wonder if in Tab3 we have the same.?

But do not confuse my questions, I will definitely read and try to understand your Idea on sboot.bin.

I postpone all work on kexec, because I lack on the right knowledge in kernel memory allocation and how to fix it.

So I will be working for now with switch_root instead. Now switch_root requires to be PID 1. And is failing. I guess that is the not been PID 1 is the reason. I know that uevend and watchdog are initiating possibly before I do the switch_root. So I am now trying to build a zimage with watchdog off. I will like to have console=tty* so that I can try to have a prompt in case I need it.

Anyway I see you around. Your Ideas are very welcome..
[Galaxy Tab 3 General] Angel_666:
[MENTION=5688554]r2d23cpo[/MENTION] do you see this? https://github.com/STS-Dev-Team/android_device_intel_kboot It based on kexec and made for lenovo on clovertrail.
[Galaxy Tab 3 General] r2d23cpo:
I had a busy day. Lets see If I can start playing, it is 23:30 GMT. [MENTION=1649190]Angel_666[/MENTION] that looks promising, At least I can try to find out who also is working in similar project. I am downloading. Do you know where this is disused, I mean there are many incomplete projects. I will be googling. Thanks.

MMM!

It was authored on 7 Dec 2012, has only 1 commit and no worked in more than 2 years!! Most of it looks like busybox.!

So [MENTION=4112553]dhacker29[/MENTION] can you tell us the status of that project? Any help I get to boot into Linux will be really appreciated.

Please do not waist you time reading the thread. My status is that I have Kexec compiled and that I had trouble switching to Ubuntu due to error

kexec -l --initrd=/mnt/boot/initrd.img-3.12.0-031200rc7-generic /mnt/boot/vmlinuz-3.12.0-031200rc7-generic
Unknown rel relocation: 4

~ # mount /dev/block/mmcblk1p2 /mnt
~ # kexec -l --mem-min=0x50000000 --initrd=/mnt/boot/initrd.img-1.12.0-011200rc7
-generic /mnt/boot/vmlinuz-1.12.0-011200rc7-generic
kernel: 0xb6776008 kernel_size: 591e80
Could not find a free area of memory of a000 bytes...
locate_hole failed
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=1649190]Angel_666[/MENTION]

Nice, I could not answer on time because my Internet Die again! But here we go again.

I did try the patch, It is for an old Linux kernel but it almost match 4.2.2 just on different lines.

But Still it gives "Unknown rel relocation: 4". The interesting part is that I did not saw any error like "crashkernel reservation failed - No suitable area found.". I guess the it should be located in a good spot!

SO Next I am going to use the HAMMER and just ignore that error to see what happen.

Hei you never answer me. How do you plan to recover if you screw sboot.img ? It is not true that it wont boot! Can ODIN overcome this problem?

Thanks ahead.
[Galaxy Tab 3 General] Angel_666:
I think yes, i can restore this. But notonly by Odin. There is special intel tool, called xFSTK +Intel SoC USB Driver, it recognize device even it turning off. And trhere is a SD card recovery metod on i9300 (i think we have it too), when bootloader is setup on sd by Odin "T-flash" button and then bricked device started by SD and owerwrite corrupted boot. As for our device - we have 3 interesting partitions : mmcblk0gp0 - gp partitiontable, mmcblk0boot0 and boot1 - in there there are 2 copies of our sboot mounted. I'm interesting - why 2 copies?
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=1649190]Angel_666[/MENTION]

I hate you! You are a distraction!!!! jijijijij I am kidding.

Men You are gating me crazy. Wao. Kboot nice subgect, from what I found kboot was on the 2006/2007 first than kexecboot that i found around 2010. Still I am stuck by not able to exec KEXEC or switch_root. But still nice subjects.

Now you mention this "xFSTK +Intel SoC USB Driver". While searching for "xFSTK". I found It seams been build for "Intel_Edison" I did not heard about it before. Note to the reader this is like the smallest PC system you can buy. Yes it has everuthing, CPU, RAM ROM, WIFI, Buetooth, etc. resorces compare to out TAB3.

h_p://gadgets.ndtv.com/laptops/news/ces-2014-intel-demos-edison-an-x86-pc-the-size-of-an-sd-card-467958

[IMG="Intel Edison"]http://cdn.ndtv.com/tech/images/Intel_Edison.jpg[/IMG]

And was offer to be use in "wearable cloth"

Well in reality they are offering protoboards

h__p://linuxgizmos.com/edison-iot-module-ships-with-atom-plus-quark-combo-soc/

with the following specs

CPU	Dual-Core Silvermont Atom @ 500MHz + Quark @ 100MHz
RAM	1GB LPDDR3 (2x32bit)
WiFi	2.4/5GHz 802.11a/b/g/n, BT 4.0
Storage	4GB eMMC
I/O	SD + UART + SPI + GPIO + USB 2.0 OTG
OS	Yocto Linux v1.6
Dimensions	35.5 x 25 x 3.9 mm

Intel Edison is around $50 but the "Intel Edison Kit For Arduino Single Components EDI1ARDUIN.AL.K" is in amaxon for $80. Nice stuff

Now returning to subject

Sorry but I have to ask, Had you try yourself? I mean you are saying "it recognize device even it turning off" I am not clear, you are telling that it recognice the divice while TAB3 is Off. Clearly, TAB3 is never off, it is just:

1) Waiting for the charger plug, then it boots in Charger Mode (we can see the logo) to start charging

2) And with KK 4.4.2 Google had advice us that It is Monitoring our Wifi Space to "Collect" Data usage!!! Yes sure, just using the TAB while in Off to Spy on us. jijii

Again, Had you verify this your self. I heard about this method on other devices.

"why 2 copies", I am not sure if this is the reason. But it is known that some boot partitions in Samsung devices are duplicated. This is even in very old devices. It supposed to be so that if one gets corrupted you can still boot from the second one.

Yes and there are comments on other devices that when you modify one partition then the boot process realize we had tampered with it and prevent us to boot!!! I am not sure about that.
[Galaxy Tab 3 General] r2d23cpo:
xFSTK interesting concept. It's funny, I am helping some one in XDA by giving him a copy of some of my partition. They have a Dell tablet and other similar Intel. Know I guess what they try to do is to use this xFSTK with my partition to see if they can have a unlock bootloader!!

Now with the xFsk info I look at Dell Sources and found a procedure to unbrick DELL Tablet that uses xFSTK. Here is the interesting part, xFSTK reestablish the Fasboot partition. Then they use Fastboot to upload the rest of the firmware.

Now we do not have Fastboot!!. Are you going to install a Fastboot from another device into Tab3 10? Interesting!!

Angel_666 please confirm. Thanks.

PD: I did install "iSocUSB-Driver-Setup-1.0.4.zip" in Wi7 64bit and also install "xFSTK_downloader_1.5.1". But in my case the driver install but it claims cloverview was disconnected while installing driver. Then xFSTK does not detect my device!

In any case I still does not know what firmware and in witch field can go the stuff to make it work. jijiji I know "stuff" usually mean we do not know what we are talking about.
[Galaxy Tab 3 General] Angel_666:
xFSTK detect device only when it turning off and usb just connected. When you connect non-powered device, you can see that it detecting in running xFSTK but just for one second of time. Then driver disconnecting and standard loading procedure begin. If we run xFSTK with loaded firmware and pushed "detect device" button, and then connect the non powered device - the downloading process will start.

:)

Edit: Just for now I tried to flash bootloader from Asus Zenfone5, and offcourse have a brick. :) But then i just take our native bootloader, flash it again by xFSTK and have a fully working device again. :)
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=1649190]Angel_666[/MENTION]

I am out of luck, Utility guys are working on my area leaving me without power time after time. When that is not the case then I lose Internet. Oh boy.

Listen, I admire you Angel as well as moonbutt74. I do not mean in comparing you guys, what I mean is that you two see all this little thing that are really important. As I said I was made aware of a installation method from other Intel devices. But I was hooping the my friend was going to report me his findings. That had not happen.

But if this works as you had express, I consider this the best gift you Angel had provide us owners of TAB3 10.1. To Know that

TAB3 10.1 is un-brickable!

. For me that I like to play with the devices this is the best Happy Present I had receive. So Thank you from my side. As soon as you have it all figure out, I suggest that your self write a little tutorial so that any one can overcome a Hard Brick. I know it is to early but this is what it looks to me.

In the other hand, as you had suggest, this bring the opportunity that we could manipulate boots files to force it boot in Ubuntu partition without any kexec magic. Who know getting fastboot enable!

I hope the stop working in the power lines today and allow me do some learning.
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=1649190]Angel_666[/MENTION]

I been crunching numbers all night & I have about 1 GB that I can not count for.

Well let me explain why I am doing this. From your picture I can see xFSTK requires iafw.bin & dnx_fwr.bin. Looking at the pit I can Identify dnx_fwr.bin = mmcblk0p20. But the pit does not tell me the offset for iafw.bin just gave me that Block Count=4096. Some time ago I discussed with my friend and agree that in fact iafw.bin = mmcblk0boot1 = mmcblk0boot0. He is convince but for me is a lucky guess. So fine I just want to know where in mmcblk0 ( internal sdcard) is that located.

Identifier	Partition Name	Flash FileName	Block Size	Block Count
offset
70	OSIP	osip.bin	0	1
1	33
71	PIT	GT-P5210_EUR_XX_20130523.pit	34	15
72	SBOOT	sboot.bin	49	6095
73	MD5HDR	md5.img	6144	2048
18	BOTA0	-	8192	4096
19	BOTA1	-	12288	4096
2	EFS	efs.img	16384	40960
74	SBOOT2	sboot2.bin	57344	16384
16	PARAM	param.bin	73728	8192
1	RESERVED1	-	81920	6144
20	DNX	dnx_fwr.bin	88064	2048
21	OTA	-	90112	16384
10	BOOT	boot.img	106496	40960
11	RECOVERY	recovery.img	147456	40960
12	RESERVED3(is the radio in gsm model)188416	8192
3	CONFIG	-	196608	32768
4	FACTORY	-	229376	4096
5	MEDIA	-	233472	4096
7	RESERVED2	-	237568	8192
14	CARRIER	carrier.img	245760	8192
15	TDATA	tdata.img	253952	8192
17	PERSDATA	persdata.img	262144	24576
8	SYSTEM	system.img	286720	4833280
13	HIDDEN	hidden.img	5120000	204800
6	CACHE	cache.img	5324800	716800
9	USERDATA	userdata.img	6041600	24715264
30756864

So as you see I can count a Total = 30756864 blocks. Blocks in Pit are 512 so I have

30756864 x 512 =

15747514368 bytes used

.

Now our MMC is suposed to be 16G = 16x1024^3= 16x1073741824=

17179869184 Total MCC bytes.

So the difference is 17179869184 - 15747514368 =

1432354816 bytes not accounted

in proc/partitions.

I know It shows

179 40 8192 mmcblk0gp0
179 30 1 mmcblk0rpmb
179 20 4096 mmcblk0boot1
179 10 4096 mmcblk0boot0

Now here that's is just 16384 blocks of 1024. Or about 16777216 bytes. less than 16 megs. So there is a lot of memory at the end that it is not shown used!.

In any case, where did you get your iafw.bin? Are you using mmcblk0boot1 or its copy mmcblk0boot0? Thanks.
[Galaxy Tab 3 General] Angel_666:
You can take IAfw.bin from the stock 4.4.x firmware for Odin. It's the same file that IFWI on another intel devices. Our's IA fw.bin = other's IFWI = some kind of EFI Bios firmware, which is different for vary of Intel platforms. FW dnx is a special security file, that verify possibility of flashing firmware. All this called Intel CHAABI i think...

What my experiments show: if i take fw.dnx.bin from another closest Intel device and try to flash it with any IFWI - it not allow me to do this and show error. If i take our stock fw.dnx and IFWI from another closest device - it allow me to flash firmware, but device even not turning on = brick = unbrick device with stock IAfw.

The most interesting file for us is sboot.bin, bootloader that run after intel FW initialized and run whole system than. The problem is - that i don't know yet how to flash modified UNSIGNED sboot? As i understood there is some kind of signing check when system start to run...

Here is a stock samsung GT-5200 IAFW.bin and dnx.fwr.bin, maybe you can disassemble it and tell us more interesting things?

View attachment SGT3.zip

Coz there is pretty close Clovertrail platforms, than run Win8 natively and have UEFI Bios with the same processor. People just connect usb keyboard to device, press F12 or Del when boot and jump to Bios setting... :) And one more thing: did you see this project called "Grub4Android"? https://github.com/grub4android/ . What you can tell?
[Galaxy Tab 3 General] r2d23cpo:
It is late tonight but I will look at it tomorow. G4A is build for qualcom devices, the still in development but have some beta in 3 devices. My friend previouly toldme he has some Intel tools towork this files. But he has not reponded. Let see what he has to say.
[Galaxy Tab 3 General] r2d23cpo:
As expected files are what I thought. Attached are my files. Remember I am in 4.2.2. I guess that what makes the main difference. Use a Hexeditor to compare. I use Hexworkshop.

My Files:

dnx_fwr.bin_mmcblk0p20.img => As you can see dnx_fwr.bin form mmcblk0p20.img

iafw.bin_mmcblk0boot0.img => As you can see iafw.bin from mmcblk0boot0.img

sboot.bin => using that info in PIT I got this by :

dd if=/dev/block/mmcblk0 skip=49 count=6095 of=/external_sd/img/sboot.img

Analisys/Comparison

There are difference in sizes but it is nothing P5210_4.2.2 are padded with zerros as expected they contain the whole partition data, including the zeros at the end.

Your dnx_fwr.bin id exactly the same as P5210_4.2.2'S dnx_fwr.bin_mmcblk0p20.img.

Your iafw.bin structure matches P5210_4.2.2'Siafw.bin_mmcblk0boot0.img. There are many regions with same data and many with difference. But most exactly in the same addresses!

Your sboot.bin structure matches P5210_4.2.2'S sboot.bin. There are many regions with same data and many with difference. But most exactly in the same addresses!
[Galaxy Tab 3 General] Angel_666:
Yes. Exactly. But you know what? I think you was right when work on Kexec method. We are lucky - our bootloader don't check boot.img and recovery. Because of that i think you on a right way: intercept original init boot, then replace it on-the-fly by needed binary, and boot what we need. But i found interesting things - look at early Santos10 defconfigs: in 4.4.x sources samsung removes that - https://github.com/trevd/android_kernel_samsung_santos10/tree/cm-10.2/arch/x86/configs
[Galaxy Tab 3 General] r2d23cpo:
Just to let you know,

I know I have not post for some time. Be sure I have not quit yet.

Angel_666 had shown us that the Intel CPU influence in our table makes our device behave more like other Intel devices. To much more than what I expected. Just to let you know, I have not test this unbrick procedure yet on my tablet. I am just careful. But I thrust Angel_666 report on his successful test. And as soon as I have a need I will see what happen.

So I been doing some reading trying to understand other devices unbrick recovery.

But SOON I will be Back with Native Linux.
[Galaxy Tab 3 General] r2d23cpo:
Well I been playing with the bootdroid bootloader of other Intel devices. They have a working droidboot image that allow them to do fastboot!. In fact it also a nice bootloader with a menu selection that can be altered to boot Linux! It already do into Power Off, boot and recovery.

I will love to have that working in TAB3. Yes fastboot on TAB3.

I have all ready made many test with it. After changing recovery.fstab the program runs nicely. I can do adb devices and obtain:

C:\>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
SECPHONE_0000000000000012345678? offline

But it does not respond to fastboot. On the screen I can see nice droidboot image.

Does any one of you know where I can get the sources?

I got this

h__ps://github.com/android-ia/platform_bootable_droidboot

I am in contact with [MENTION=4821597]social-design-concepts[/MENTION]. I know he is busy. But I have hopes he can share and teach us a little in this area.
[Galaxy Tab 3 General] :
r2,

hi,

according to this https://github.com/tom3q/initramfs_droidboot

from the readme,

this is the source isn't it ? https://github.com/android-ia/platform_bootable_droidboot/tree/release/android-4.2.2_r1-ia3 <---there are eight branches. I didn't find anything else on it.

also ramdisk example https://github.com/tom3q/initramfs_droidboot

if you have your build environment set up, cm11, you can probably add it as a project in .repo/local_manifests/local_manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!-- droidboot sources -->
<project name="android-ia/platform_bootable_droidboot" path="bootable/droidboot" remote="github" revision="release/android-4.2.2_r1-ia3" />
</manifest>

and add,

TARGET_USE_DROIDBOOT := true

to boardconfig.mk

fire up cm11 build environment and then

mka droidboot

i' trying to follow you, but on arm device, still haven't come across another tab 3 yet. :o

m
[Galaxy Tab 3 General] r2d23cpo:
Nice to see you around. budy.

As you may have notice, I have not work on Ubuntu for a few days. Angel_666 gave us the nicest of the gift. He found possibly an Unbrickable Method used by Intel CPUs. And a few other Ideas. So I took a recess to study his findings. I have not personally used the recovery method. But it gave me the valor to then try used other Intel Devices ideas, Such as the droidboot, witch has an implementation of fastboot on it. Fastboot will allow us to test without the need to save a new firmware.

I did make droidboot to boot by coping dell venue recoveries. They are part of [MENTION=4821597]social-design-concepts[/MENTION] package. I only changed the recovery.fstab. I had done many test changing the usb setup but failed to make fastboot to recognize the request in the TAB. That is why I am looking into the source.

I have a bad Internet, so I do not want to start doing repo, it takes for ever in my case. Since droidboot seems small enough I am just going to build my own Makeconfig with the Android Sources I had downloaded previously. See if I can make it.

Thanks for the link, the version I had was 4.1.1 and you gave me 4.2.2.

I will report.
[Galaxy Tab 3 General] r2d23cpo:
Report,

So I did download droidboot 4.2.2. As I say I have an old CM10.1 & AOSP 4.2.2r1. My Internet is to slow to update the ripo. The good news is that the binaries in CM10.1 are still inside. That allows me to still the static binary libraries required by droidboot from the out folder.

So I did create manually a Makefile to compile droidboot. Most of it is just common sense but I could not overcome conflicts with libc in ndk vs CM10.1. Also for reasons I do not know libc does not include all pthread library. So at the end I use the HAMMER. Copy all libraries needed from CM10.1 to a "libs" directory inside droidboot. If any one is interested again I can publish my Archives. And for pthread problem I just copied pthread.o to mi compilation and aded it as one of my objs. Was lucky that it pass possible duplicated libraries with libc.

Now it seems there are tree possible graphic modes: RGBX, RGBA and RGB. I do not know what is the correct one. I am using temporarily RGBX. But maybe [MENTION=5864662]moonbutt74[/MENTION] can tell me.

So I have the droidboot compiling and now I need to figure out what changes to make to let fastboot work.

[MENTION=4821597]social-design-concepts[/MENTION] seems to belive ""fastboot boot tempboot.img" is removed / stubbed on Intel platforms ". But I do not understand that because they does use fastboot to launch cwm recovery temporary!! Need an explanation.

The Idea is to have, fastboot or lunch Recovery or lunch Linux natively from the Recovery Partition by the use of the menu in droidboot.

[MENTION=4821597]social-design-concepts[/MENTION] I see that the droidboot program can be manage by network. It said: "Listening on TCP p[ort 1234". Have you ever done TCP controll? How the newtwork can be setup? I guess it should be using init.rc.

Well it is to late and I need to sleep some hours.