[Samsung Gear S] biktor_gj:
First of all sorry for being late, I have more work than I'd like to admit with my watch ;)

There's still nothing for the Gear S on my Github page, but when I get everything a bit sorted you'll find it here: https://github.com/Biktorgj

That's why I asked [MENTION=2242705]cipherswitch[/MENTION] for "/dev/" contents. Now you can see it:

/dev/block/platform/msm_sdcc.1/by-name:
total 0
lrwxrwxrwx 1 root root 21 Jun 1 1970 aboot -> ../../../../mmcblk0p8
lrwxrwxrwx 1 root root 22 Jun 1 1970 boot -> ../../../../mmcblk0p16
lrwxrwxrwx 1 root root 21 Jun 1 1970 csa -> ../../../../mmcblk0p2
lrwxrwxrwx 1 root root 22 Jun 1 1970 csc -> ../../../../mmcblk0p22
lrwxrwxrwx 1 root root 21 Jun 1 1970 dbi -> ../../../../mmcblk0p9
lrwxrwxrwx 1 root root 22 Jun 1 1970 ddr -> ../../../../mmcblk0p10
lrwxrwxrwx 1 root root 21 Jun 1 1970 fota -> ../../../../mmcblk0p1
lrwxrwxrwx 1 root root 22 Jun 1 1970 fsc -> ../../../../mmcblk0p13
lrwxrwxrwx 1 root root 22 Jun 1 1970 fsg -> ../../../../mmcblk0p12
lrwxrwxrwx 1 root root 22 Jun 1 1970 modem -> ../../../../mmcblk0p21
lrwxrwxrwx 1 root root 21 Jun 1 1970 modemst1 -> ../../../../mmcblk0p3
lrwxrwxrwx 1 root root 21 Jun 1 1970 modemst2 -> ../../../../mmcblk0p4
lrwxrwxrwx 1 root root 22 Jun 1 1970 module -> ../../../../mmcblk0p20
lrwxrwxrwx 1 root root 22 Jun 1 1970 pad -> ../../../../mmcblk0p15
lrwxrwxrwx 1 root root 22 May 11 12:33 param -> ../../../../mmcblk0p11
lrwxrwxrwx 1 root root 22 Jun 1 1970 ramdisk1 -> ../../../../mmcblk0p18
lrwxrwxrwx 1 root root 22 Jun 1 1970 ramdisk2 -> ../../../../mmcblk0p19
lrwxrwxrwx 1 root root 22 Jun 1 1970 recovery -> ../../../../mmcblk0p17
lrwxrwxrwx 1 root root 22 Jun 1 1970 rootfs -> ../../../../mmcblk0p25
lrwxrwxrwx 1 root root 21 Jun 1 1970 rpm -> ../../../../mmcblk0p5
lrwxrwxrwx 1 root root 21 Jun 1 1970 sbl1 -> ../../../../mmcblk0p7
lrwxrwxrwx 1 root root 22 Jun 1 1970 ssd -> ../../../../mmcblk0p14
lrwxrwxrwx 1 root root 22 Jun 1 1970 system-data -> ../../../../mmcblk0p23
lrwxrwxrwx 1 root root 21 Jun 1 1970 tz -> ../../../../mmcblk0p6
lrwxrwxrwx 1 root root 22 Jun 1 1970 user -> ../../../../mmcblk0p24

These aren't all the partitions but they are the ones who have partition labels.

Big warning coming:

YOU DON'T WANT TO F*CK WITH ANY PARTITION CALLED BOOT, ABOOT, MODEM, SBL OR PARAM Most likely your watch will shut down and will never come back on again, like ever, like in the song.

Now with that sorted out, let's get you guys up to speed, shall we?

Your kernel

Of course Samsung wouldn't make a standard kernel, and neither would make things easy. Your watches use the Device Tree model in the kernel. That is good, that means you don't have to rewrite a bunch of stuff to do anything. In fact, my theory is that you could, with a bit of work, upgrade the kernel to match it Gear Live's (3.10), and remove a lot of problems from you.

Now the bad is, how did Samsung manage to make this cr*p. Once you build the kernel, you'll have, on one side, your typical zImage, which contains only the kernel binary, and a folder full of DTB files which are the board definitions for it.That's the standard linux way of dealing with DTBs and it's normal. But, and here comes the fun part, to make a Gear S compatible update file, you MUST use two commands:

1. dtbtool: similar to dtbTool (from qualcom) but not sure it's the same. It dropped errors when using it

2. mkdzimage: which actually binds the image created by dtbtool with the zImage and builds a 'dzImage' to make the tar with it.

These two binaries are in the open source package, but are compiled for the ARM platform. So, you have to build the kernel, and then chroot into the development environment, and run them through QEMU to finish the job. This is the sickest thing I've seen in a long time.

There are some broken drivers in that kernel too. The Android Alarm and switch drivers drop errors when compiling them. I have disabled them and got to finish the build process. That might or might not be needed to be fixed to make everything work.

Your bootloader

Your bootloader seems to be pretty much the same as Gear 2's. So that means that there's no actual way to enter the recovery image unless you break the command line and rewrite it when the kernel is booting. Why would you need that you ask?

To get a boot partition separated from the system and

To get a recovery partition which can be started from the bootloader menu.

Fortunately, that can be transplanted, mostly as is, from the kernel for the Gear 2. They're not pretty functions, but they work ;)

Can anyone post the contents of /proc/cmdline so I can make the modifications for your watch?

The file system

This can be applied both to Gear S and Gear 2. Tizen is not run the same way as Android. For example, tizen boots directly from the rootfs partition (in your case, mmcblk0p25). From there, it launches /sbin/init. Android typically boots from a ramdisk, and launches /init. What I did to overcome that limitation was simply put a copy of init into /sbin on my boot images, and repurpose an unused partition in the Gear 2 as a boot partition. I used the ramdisk-recovery partition for that. I think you guys can use that too.

On the gear 2, I used:

rootfs -> system image

ramdisk1 (ramdisk-recovery on the tar package) -> boot image

modules -> recovery image

user -> user data (/data in Android)

I'm getting you an example of all the things I can think of so you can start working on it. So,

I will upload the kernel source along with all the opensource release stuff so you can start building your kernels

I have modified the kernel defconfig to enable the minimal Android drivers, just enough to not start rebooting itself due to missing IPC driver and such, and enabled USB ADB support.

I will get you a sample boot and system image so you can get an idea on how things get ordered. Not hoping it will work (if it does, then it will be amazing ;)) but enough so [MENTION=3700808]deadlocked007[/MENTION] and anyone who wants to join the party can get something to begin the work with.

I will use Samsung Gear Live's base image for this. For one simple reason: it has the same cpu and same memory as you have. That doesn't mean you're stuck with Android Wear. After you see this working/booting you can port the libraries back to standard Android. You can also start from scratch, but I think you're better off starting from something with the same form factor and similar capabilites (except for the modem), it will make your life easier

I know almost nothing about this watch, I'm just doing this from the things I've learnt from the Gear 2 and from the little I've seen, so don't expect something magic that makes it run like a shipped product.

I also can't help much further. You need the actual device to be able to do something with it, and you need to do a lot of trial and errors to get each thing working (and I don't have time to work on it either). As I said before, the fact that you use a Qualcom cpu makes it much easier, but it's not a play in the park anyway. You can be stuck for weeks on something as simple as the gyro sensor (just go to the thread on the Gear 2 and read a bit)