yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab 3 General] :
r2,

i had thought this project overall was dead so, i gave my tab to a family member who needed it.

Then a few days later you revived the project, which was originally my point of interest in learning development.

I personally have no real interest or need for cyanogenmod/pacrom/aokp etc. Hacking/modifying the stock rom

works for me. I can't really ask for the tab back so, i'm working on getting another.

As to patching recovery, you'll have to look back through [MENTION=5378432]Restl3ss[/MENTION] 's thread to find the info, also
[MENTION=1649190]Angel_666[/MENTION] has recently posted his working device tree for the santos103g which should do with some

modification for santos10wifi. Devhost deleted most of my files around the new year so my sources are pretty much gone.

You're welcome to use whatever i have collected/accumulated and if i can manage to get another tab then i'll jump back in.

m
[Galaxy Tab 3 General] r2d23cpo:
But you have TAB4 now! Why can you do the hacking on it?

I have not see or look at the specs, I get from your comments it is ARM base. Does it has a sort of Block on boot/system?
[Galaxy Tab 3 General] r2d23cpo:
By the way do you know what this Selinux sentence is for

seclabel u:r:*******:s0

When we add commands/files do we have to give them some some sort of selinux permits?
[Galaxy Tab 3 General] :
Yes but, i have other projects [tab4] that take precedence. So i can only do so much.

The partition setup is in the block/mmcblk style like other samsung tabs. for now i have the sdcard chroot setup

you had brought up and running debian wheezy.

m
[Galaxy Tab 3 General] :
From what i understand of it, your files attributes must be in line with the policy, i had a thread somewhere

in here http://xdaforums.com/galaxy-tab-3/general/se-linux-policy-information-thread-t2865457

Having gotten sidetracked, i haven't been able to get back to it but, take a look through the links.

m
[Galaxy Tab 3 General] r2d23cpo:
Here is the update.

As I mention instead of fighting all the way up to have the right init*.rc we decided to used a recovery.img and renamed boot.img. I used "cwm-6.0.50-gt-p5210-v2-alien".

Remenber the I dea is not to boot into system or what we call Android OS! That wold not happen witn no real boot image. The I dea of having this setup is that recovery image had allredy implemented adbd and many other nice stuf. But we were in the hope that the Screen Wold had been setup for data display.

Result. adbd works nicely, I can "adb shel"l and look in the file system. I can see that our init, witch i now renamed /sbin/init_kexecboot. We can not have 2 inits!! Right. And I place a copy of kexeboot in /sbin.

if I do /sbin/kexecboot I get the following:

kexecboot 0.6 starting
Kernel cmdline: init=/init console=sec_log_buf kmemleak=off ptrace.ptrace_can_access=1 androidboot.bootmedia=sdcard androidboot.hardware=santos10wifi
sec_debug.level=0 loglevel=0 androidboot.debug_level=0x4f4c vmalloc=256m sec_log=2052K@0x10000000 sec_bootfb=0x3f000000
lcd_panel_id=0 androidboot.revision=8 switch_sel=3 cordon=67ed039617121a8dacc0a40f90092884 connie=GT-P5210_OPEN_EUR_ea9076030715c83a0e0fb38c94631dee
androidboot.emmc_checksum=3 androidboot.bootloader=P5210UEUAMH1 androidboot.serialno=1234567

We have [COLOR="Red"]no tty[/COLOR]
FB angle is 0, tty is (null)
We have no tty

As you cans see we still see no tty. I need some help from the people that implement this in other devices. There have to be a way to correct this.

In the other hand I still see the Samsung Galaxy Tab3 screen. I do not know is it is related at the fact that there is no tty asigned!

After I connect I can chec

ls -la /dev/pts
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
drwxr-xr-x 2 root root 0 Jan 26 22:45 .
drwxr-xr-x 10 root root 3000 Jan 26 22:45 ..
crw------- 1 root root 136, 0 Jan 26 22:57 0
~ #

Ignore the

__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!

That is nothing I guess it is related to the fact that our primitive file system has not setup the time variables. Not important
[Galaxy Tab 3 General] :
r2,

on tty, i believe you need to enable CUSE [character device in userspace] and configure console settings correctly

in kernel, as i believe, the console [virtual and i think uart/usb-serial interfaces] is a character device.

if i remember , i think it was trevd who told me you need to re-enable the standard linux kernel virtual console.

My experiments in that were mixed, either incorrect setup or missing/dead-end code i'm not sure. :confused:

m
[Galaxy Tab 3 General] r2d23cpo:
We still in same page.

Definitly we are in Graphicmode, just looking at the Samsung Galaxy Tab3 can tell us that.

But I went a little further. There is "/dev/graphics/fb0" if I write to it I get garbage in the screen. For example:

cat init /dev/graphics/fb0. Will bring at the top noise on the Samsung Galaxy Tab3.

Now the problem that I am facing is that I believe the relation between the Automatic Makefile and kexecboot is very strong. There a bunch of selection I guess Definition that get to set on the Auto Make. I have afeeling that is the mising info the Document that is no longer Available. Now I can easly select any of those juat adding a -D----- in my flags. But What I did was to use the mising config.h and include thos definitions. I added the minimun requred that the compiler acepted to compile. And even then I do not know if I did select the correct one,

Now we know that we are in FrameBuffer Grafic, so my next build is going to be with "USE_FBMENU". Hopefully that will take care of building the menu in graphic mode.

But before getting it seems there is I need to have a tty!!! I hope that will not stop us. Look it is at the very beginning. But I do not see any if statement to quit! I have hopes.

int main(int argc, char **argv)
{
int rc = 0;
struct cfgdata_t cfg;
struct params_t params;
kx_inputs inputs;

lg = log_open(16);
log_msg(lg, "%s starting", PACKAGE_STRING);

initmode = do_init();

/* [COLOR="Blue"]Get cmdline parameters[/COLOR] */
params.cfg = &cfg;
init_cfgdata(&cfg);
cfg.angle = 0;	/* No rotation by default */
parse_cmdline(&cfg);

[COLOR="Blue"]kxb_ttydev[/COLOR] = cfg.ttydev;
setup_terminal(kxb_ttydev, &kxb_echo_state, 1);
/* Setup function that will restore terminal when exit() will called */
atexit(atexit_restore_terminal);

log_msg(lg, "FB angle is %d, tty is %s", cfg.angle, cfg.ttydev);

I am taking a bath when I return I will build new kexecboot with "USE_FBMENU" enabled. and test
[Galaxy Tab 3 General] r2d23cpo:
Wao that bath was lonnnngg. I am sorry I forgot to come back.

Status: It is staring to show improvement. Yes the "USE_FBMENU". Help a lot. And after reading code by code and try to figure how the program works I have the General Menu Working. Now the problem I have is with kexec. The enabled kernel show the system calls but I can not do just a kexec command. I guess I need a special way to do system calls!

I did try to compile an it shows no error but when executed it said something about file not found!! Any way, no body had requested, but here is a boot.img that show the menu. Listen If you never so this working, in in fact reads every partition of the devices ( That is scary) to determine where is an available partition that hold a config for the images to mount.

Before you download remember It is for advance and riski people. Please do not download it. It is at your own risk.

alien-kexecboot-026.zip 15.9 MB

h__ps://mega.co.nz/#!KcdgTT4S!YHFOqfHvpXy4cChzn22Rl5Kz5Bgvfg9IxUTqdrM9cbY

So I need help in getting a x86 kexec binary working. That is the last key to make this work.
[Galaxy Tab 3 General] r2d23cpo:
I see yesterday was another quite day.

So as I said the show stop is kexec. Either we find a way to call the system calls! Or build our self a kexec binary.

My lack of knowledge or my building tools are failing. Well the easiest is to search another tool. I decided to download the latest x86 NDK to the tablet, and see if building with that new NDK in the tablet makes the different. But building that NDK is taking some time. I guess Ubuntu competes with android leaving little resources available. That is why we are doing this thread to run Ubuntu Natively. I hope to see improvement.

The automakefile of the kexec ,... I hate auto makefiles..., is complicated for what it compiles. Giving me hard time to understand it and been able to create my own makefile. I have a look again.

Hope to see any of you soon, so that this do not become another monologue. Hopping to report soon.
[Galaxy Tab 3 General] r2d23cpo:
I know talking by my self again. I am just posting because this may help others with similar problems.

So I found the source of "andrewhsieh" . I install a brand new an NDK r10 I I located at /home/ubuntu/bin/androidndk. And I am working as user Ubuntu. I know lack of imagination.

So If I do "$HOME/bin/androidndk/toolchains/x86-4.6/prebuilt/linux-x86/bin/i686-linux-android-gcc -print-sysroot" I get:

>$HOME/bin/androidndk/toolchains/x86-4.6/prebuilt/linux-x86/bin/i686-linux-android-gcc -print-sysroot
/tmp/[COLOR="Red"]ndk-andrewhsieh[/COLOR]/build/toolchain/prefix/sysroot
>

So gcc has that coded in some how. I saw a guy that did a simlink but I quite do not understand it. I report If I find any news.
[Galaxy Tab 3 General] :
r2,

hi, on the issue with your host x86-64, i got around by using the x86 version of ANDRIOD NDK

my script for building the standalone toolchain to x86 for compiling arch=i386 arch_variant=i686 binaries for the tab

looks like this

#!/bin/bash
/NDK-x86/build/tools/./make-standalone-toolchain.sh --ndk-dir=/NDK-x86 --system=linux-x86 --toolchain=x86-4.8 --platform=android-18 --install-dir=/toolchains/NDK-x86-x86-4.8

additionally i've found my way to this form of build script for medium to large projects where you need to ./configure before compiling your project, whatever it may be, this particular script is for building tar from source for arm. with some adjustment you can use this formula to make a standard

build script for the tab in line with it's architecture

#!/bin/bash
export T_SRC=/t-src
export CODE_SRC=${T_SRC}/tar-src
export CODE_BUILD=${CODE_SRC}/build
export FINAL_P=${CODE_BUILD}/final
export INSTALLDIR=${T_SRC}/NDK-arm-eabi-4.8
export PATH=${INSTALLDIR}/bin:$PATH
export TARGETMACH=arm-linux-androideabi
export BUILDMACH=i686-pc-linux-gnu
export CROSS=/toolchains/NDK-arm-eabi-4.8/bin/arm-linux-androideabi
export CC=${CROSS}-gcc
export LD=${CROSS}-ld
export AS=${CROSS}-as
export CXX=${CROSS}-g++
rm -fr $CODE_BUILD
mkdir -pv $FINAL_P
cd $CODE_BUILD
.././configure --prefix=$FINAL_P --host=$BUILDMACH --target=$TARGETMACH CFLAGS= LDFLAGS=-static
make
make install
ls final/
file final/bin/tar
cd ..

the idea of the script is i maintain a central repo for all the projects i work on so things don't get scattered, in my case, i always run as root so,

my main directory for source i keep at export T_SRC=/t-src

I build export CODE_SRC=${T_SRC}/tar-src out to export CODE_BUILD=${CODE_SRC}/build

and "install" the final product to export FINAL_P=${CODE_BUILD}/final as per the prefix lin in configure --prefix=$FINAL_P

using the command line example for build your toolchain from NDK you may succeed it build a toolchain to run on the tab

by adding the CFLAGS=-m32

this is the page where i learned this from

http://how-to-build-for-arm.wikispaces.com/

great page !

m
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=5864662]moonbutt74[/MENTION],

Thanks for always giving a hand.

*"i got around by using the x86 version of ANDRIOD NDK" I do almost the same!

*So you build a "standalone toolchain to x86 for compiling arch=i386 arch_variant=i686 binaries for the tab". The explanation claims is only for ARM over 4.4.?

#!/bin/bash
/NDK-x86/build/tools/./make-standalone-toolchain.sh --ndk-dir=/NDK-x86 --system=linux-x86 --toolchain=x86-4.8 --platform=android-18 --install-dir=/toolchains/NDK-x86-x86-4.8

This O will definitely try.

*"make a standard build script", As always is a pleasure to share with you. I will be testing it. I do usually use the zip update file you gave us for you recoveries, just modified to use for boot.img.

*"CFLAGS=-m32" I use this but it does not work in automake, they use a different variable that is like --enable_"Sorry I do not recall" but I can quickly look at it if you need.

*h__p://how-to-build-for-arm.wikispaces.com/ I will look at it.

nice for sharing and not letting me here alone, I wonder where is all the other guys that even where them the one to suggest an request like nitro123. I bet you they sold their tablets! I hope Samsung and Intel gets aware of how the take a nice product with potential and ruin it by not sharing the needed source code to make the standard CM12! Well in my case I will like CM10.1, That was the best that had no limitation at all. It is simple if it can not get to CM official site it is not worth it. All available new OS are base on what they can still from CM.

Now Returning to the work, In my last post anyone can see that the Screen with the main Menu of kexecboot runs nice. Clearly it will not show possible menus if you guys do not include a /boot/boot.cfg file with data! on any partition.

Last night I got to compile a kexec, butttt, It seems that the comments of [MENTION=639326]CalcProgrammer1[/MENTION] about a patch. I try the simple patch I found but did not make any difference. Here is the latest. When I manually try to jump into Linux.

~ # 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
[COLOR="Red"]Could not find a free area of memory of a000 bytes[/COLOR]...
locate_hole failed

Clearly we are using the kexec-tools version 2.02. The have now 2.08. But for whatever reason all copies on the web are broken giving errors when decompressed!!!!

In Any case here is the latest boo.img. It would not boot automatically in to kexecboot!! Why, to allow any one that is dumb enough to risk his tablet just to see something that does not work. Well, Kexecboot work, kexec do respond it just fail to jump to Linux. jijiji.

alien-kexecboot-031.zip 16.2 MB

h__ps://mega.co.nz/#!uIlwhYrI!4JZgal65oppq4YbBytW4kJzyYLOJpId2aXnCEh2mpKU
[Galaxy Tab 3 General] r2d23cpo:
Update, I am still testing and searching the web for Ideas. But I never been in a project that looks so weird.

Except for moonbutt74 that show up giving good advice, thanks. CalcProgrammer1 post 3 times. In general this do not appear to show interest. It seems natural NOT to test the binaries provided, Are totally experimental. We are learning.

Now what it is really strange is that Info/resources in the web had been deleted. Like the original Kexecboot site.

Projects base on kexec are all base on old 2.02. So different devices implement different patches.

Now original kexec was supposed to be applied on vary basic kernels, but my finding show that the new kexec versions are been base or applied to more new and complete kernels, for example in Ubuntu, or Debian. The so call Embedded system like our phones are been left out by the use or resources available to those in Ubuntu, Debian etc. I been compiling using 4.6 toolchain and android 8 platform to ensure maximum compatibility. I decided yo try kexec 2.7&8 and used 4.8toolchain and android platform 21, And I found that now kexec base many function on unavailable resources and even android platform 21 has deleted some essential files that where available before platform 14.

So As you see there has been intentionally deletion from all front. Files deleted on the web, kernel.org and Android had deleted or modify thing to stop this to work!! Now I understand why I can not find a project base in more advance kexec.

This is not a new Idea, many had apply this Idea to their devices, and there is even other similar mechanisms to switch to a second kernel boot.

One last thing. I said "But for whatever reason all copies on the web are broken giving errors when decompressed!!!!". That is not totally true. Well while I was in my Ubuntu Desktop I could not decompress the archives. But I found that in Win7 I can use 7zip. 7 zip will start decompressing files. But each file has a good decompress file and a second file that wants to override the first one with a 0 size! I guess these files may bee intended to be open with a special application. So to overcome this problem in Win7 I tell 7zip Not to override duplicate files. I got a final good

decompression.
[Galaxy Tab 3 General] r2d23cpo:
As I said I had little communication with other developers that did similar projects-long time ago. But After searching a little I think I have what they used. Look at Tasssadar multirom wiki=>Porting-kexec-hardboot

h__ps://github.com/Tasssadar/multirom/wiki/Porting-kexec-hardboot

[MENTION=639326]CalcProgrammer1[/MENTION] if you still around can you confirm that this is a good link to follow. I really appreciate if you point me out to the right learning path.

To let you know where I am.

I have basic kexecboot working.

I can compile kexec 2.02 but It produces some error when executed in boot, see 2 or 3 post before.

So I am looking into the patch you had mention before.
[Galaxy Tab 3 General] CalcProgrammer1:
Hardboot is ARM-specific. If you look at the patch it uses ARM assembly and hooks into SoC specific stuff.
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=639326]CalcProgrammer1[/MENTION]

Nice to see you still around.

I understand that the patch you use is "ARM-specific" and that if I "look at the patch it uses ARM assembly and hooks into SoC specific stuff". I understand. Patch as you have it will make no difference to x386 technology. I totally agree. But I Like to look at it, with luck I should be able to match x386 counter part. I hope you understand me too. So yes I like to look at it just as you said.

I may not even need Hardboot. But I am having trouble with memory allocation.

~ # 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
[COLOR="Red"]Could not find a free area of memory of a000 bytes.[/COLOR]..
locate_hole failed

That message come in fact from kernel. I hope that in one of the patches it address this memory problem. Do you have any other Idea.

The best I had found explaining the process is:

[PATCHES] Kexec syscall support, boots kernels from SD or USB (11/6/11, GB support) => http://xdaforums.com/showthread.php?t=1266827

and in here it show a patch that "Register an extra 1M before ramconsole to store kexec stuff" in another ArM device "tf201"

h__ps://github.com/EnJens/kernel_tf201_stock/blob/e443f15cd73232b78827dc108c1d2ffbd5bc1fb1/arch/arm/mach-tegra/board-tf201.c#L820

This patch is part of a commit in

h__ps://github.com/EnJens/kernel_tf201_stock/commit/e443f15cd73232b78827dc108c1d2ffbd5bc1fb1

patch for arch/arm/mach-tegra/board-tf201.c

@@ -807,15 +807,21 @@ static void __init tf201_ramconsole_reserve(unsigned long size)
{
struct resource *res;
long ret;
+ unsigned long real_start, real_size;
res = platform_get_resource(&ram_console_device, IORESOURCE_MEM, 0);
if (!res) {
pr_err("Failed to find memory resource for ram console\n");
return;
}
+
res->start = memblock_end_of_DRAM() - size;
res->end = res->start + size - 1;
- ret = memblock_remove(res->start, size);
+ // Register an extra 1M before ramconsole to store kexec stuff
+ real_start = res->start - SZ_1M;
+ real_size = size + SZ_1M;
+
+ ret = memblock_remove(real_start, real_size);
if (ret) {
ram_console_device.resource = NULL;
ram_console_device.num_resources = 0;

So yes I need to find a way to implement similar changes in my architecture. Again can I see the patch set you use?

As always I appreciate your time and effort.
[Galaxy Tab 3 General] CalcProgrammer1:
I think there are two different issues here. In hardboot you have to reserve a "hardboot page". This is statically allocated by the kernel as part of the board file as your quoted code shows. The hardboot page doesn't actually store the kexec kernel image, but instead contains the address of the dynamically allocated, contiguous block of memory holding the kexec kernel image. It also holds some other information, I think including ATAGS/command line for ARM (you'll have to change this to whatever the x86 kernel needs from its bootloader). The error you're seeing is the memory required to store the kexec image itself, which is dynamically allocated. Try different values of --mem-min until you find one that works. In fact, if you're not using hardboot I don't think you even need to pass mem-min as the kexec tools will find a location for you. I'm not used to x86 kernel stuff since I just use the default generic kernel on my PC. Does this tablet have a BIOS like a normal x86 machine or does it have an ARM-style bootloader? If it's the latter, that's a configuration I've never heard of before.
[Galaxy Tab 3 General] r2d23cpo:
Please do not leave me alone! I am scare, no body show in this thread. jijijiji

Thanks for the quick response. Yes. I see I may not need mem-min. I did just because kexecboot did!! I just copied its command.

Here I found similar location on intel at: kernel-4.2.2/arch/x86/platform/intel-mid/sec_libs/intel_mid_ram_console.c

void __init ram_console_reserve_memory(void)
{
int ret;
phys_addr_t mem;
size_t size;

size = INTEL_MID_RAM_CONSOLE_SIZE_DEFAULT;
size = ALIGN(size, PAGE_SIZE);

mem = memblock_find_in_range(0, INTEL_PERSISTENT_RAM_MAX_MEM,
size, PAGE_SIZE);
if (!mem) {
pr_err("Cannot find memblock range for ram_console\n");
return;
}

ram_console_ram.start = mem;
ram_console_ram.size = size;

ret = persistent_ram_early_init(&ram_console_ram);
if (!ret)
intel_mid_ramconsole_inited = true;
}

NO BIOS that I know.

I guess it is using same boot process like arm devices.
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=639326]CalcProgrammer1[/MENTION]

This is what I get if I omit "--load-hardboot --mem-min=0x50000000" and use "-l" instead.

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

the same if I switch arguments

kexec -l /mnt/boot/vmlinuz-3.12.0-031200rc7-generic --initrd=/mnt/boot/initrd.img-3.12.0-031200rc7-generic
[COLOR="Purple"][U][B]Unknown rel relocation: 4[/B][/U][/COLOR]

So the elf.h definition shows

/* Intel 80386 specific definitions. */

/* i386 relocs. */

#define R_386_NONE	0	/* No reloc */
#[COLOR="Blue"]define R_386_32[/COLOR]	1	/* Direct 32 bit */
#define [COLOR="Green"]R_386_PC32[/COLOR]	2	/* PC relative 32 bit */
#define R_386_GOT32	3	/* 32 bit GOT entry */
[COLOR="Red"]#define R_386_PLT32	4	/* 32 bit PLT address */[/COLOR]
#define R_386_COPY	5	/* Copy symbol at runtime */
#define R_386_GLOB_DAT	6	/* Create GOT entry */
#define R_386_JMP_SLOT	7	/* Create PLT entry */
#define R_386_RELATIVE	8	/* Adjust by program base */

So 4 means #define R_386_PLT32	4	/* 32 bit PLT address */

And in the code

void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
void *location, unsigned long address, unsigned long value)
{
switch(r_type) {
case [COLOR="Blue"]R_386_32[/COLOR]:
*((uint32_t *)location) += value;
break;
case [COLOR="Green"]R_386_PC32[/COLOR]:
*((uint32_t *)location) += value - address;
break;
default:
die("[COLOR="Purple"][U][B]Unknown rel relocation[/B][/U][/COLOR]: %lu\n", r_type);]
break;
}
}

And since there is no code for it it takes the default die("

Unknown rel relocation

: %lu\n", r_type);