Nook Touch kernel hacking

Search This thread

corge

Member
Apr 15, 2012
25
7
It's the same, because we just write a identical image from the internal storage to the SD-Card.
Could you specify what do you mean under image from the internal storage?

I try to boot uImage I've compiled and moved to SD card by usual file copying like described here: http://nookdevs.com/Building_the_Nook_Touch_stock_kernel
In this case SD card partitioning may vary, so I'd like to ensure I haven't a significant differences with successful cases.
Do you mean that creating one FAT32 partition from 16384 to 79691775 block at SD card and marking it with boot && lba flags is the best case to check it?
 
  • Like
Reactions: mrWax

mali100

Senior Member
Jun 3, 2007
209
140
The procedure to create a bootable sd-card with the full android system on the sd-card is described in this thread http://xdaforums.com/showthread.php?t=1591174&page=3

The basic steps are:
-Booting your nook into noogie,
-make a backup of the internal mmc with dd or some sort of windows-tool
-write the backup onto your sdcard (with the same tool used before)
-change the kernel on the boot-partition with one that changes the device-names of the sd-cards (you can get this kernel in the thread mentioned before).
 
  • Like
Reactions: mrWax and corge

corge

Member
Apr 15, 2012
25
7
I got it. Seems like my initial supposition was right, but it is anyway strange if partition access really depends on its start and end sectors.

I've copied all files from noogie image to my SD and it didn't boot.
Then I deleted partition on the card and created new one—exactly same except start and end points (I made them same as in noogie image).
After this it booted to noogie.

I didn't try anything else yet, but this is interesting as itself.


ADD:

Same case with just u-boot.bin, uRamdisk (from noogie) and uImage (custom) left at SD seems booting to internal kernel.
So, as it was previously mentioned here, fully populated boot partition is needed at SD.
I'll update wiki after some more tests.
 
Last edited:
  • Like
Reactions: mrWax

corge

Member
Apr 15, 2012
25
7
maybe I am wrong about this because in this thread it is said that GPU driver is propietary. Are there additional modules that are distributed only in binary form?
Most probably GPU driver was loaded from the internal memory, so you didn't notice any differences. It is possible because you run the same kernel version which this driver is compiled for.

Regarding other modules, wifi is a similar thing afaik. However, there are some kernel sources for GPU at git.omapzoom.org and wifi might be used with wl12xx driver, I'm not sure.

Besides that, it should be possible to easily find all binary modules (*.ko) with booting noogie, for example.
 
  • Like
Reactions: mrWax

tusko5

Senior Member
Jan 27, 2011
108
29
So I just recompiled with loadable module support DISABLED. In the config, replaced "m" (there were a few) by "y". It booted OK again.
 
  • Like
Reactions: mrWax

mrWax

Senior Member
Jan 31, 2012
147
24
thx and where to read

Hi!
I really appreciate you excitement into this thread. I had atleast send some thx here for now.
I'll try to find some good source of knowleadge to read on this (dont know where yet) to educate mysefl.
 
  • Like
Reactions: corge and tusko5

tusko5

Senior Member
Jan 27, 2011
108
29
I was porting what I identified as the GPU driver in B&N sources (drivers/video/omap3ep, CONFIG_FB_OMAP3EP) (http://nookdevs.com/Nook_Simple_Touch/Kernel) to CM7 kernel sources (http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source). This port is done but it will probably not work :cyclops:. Then I thought I'm stupid when I saw in this thread that the GPU drivers are not open sourced. I hope my little experiment about disabling module loading discards this issue.

The next step is to port omap3621_gossamer platform related code to CM7 kernel. I just checked that this platform is not present in CM7 kernel. I do not have a lot of time, but I will try to port this too. Then I will try to boot CWM again with the new flamboyant CM7 kernel that only boots and displays.
 
Last edited:

tusko5

Senior Member
Jan 27, 2011
108
29
I renamed the uImage in the CWM SD as uImage.old and copied the recompiled one. Maybe u-boot gets the uImage from other place in the SD?

edit: I just checked the CWM SD (http://xdaforums.com/showthread.php?t=1360994). I used the 2GB version. The SD image is simple a FAT filesystem (no partition table), so no partition in the SD where an alternative copy of the kernel image could come from, only the file I replaced, uImage. I am now at work so I can't do more checks. I'll know more later. The last option will be that booted kernel is the kernel inside the Nook, not the kernel on the SD...
 
Last edited:

tusko5

Senior Member
Jan 27, 2011
108
29
I renamed the uImage in the CWM SD as uImage.old and copied the recompiled one. Maybe u-boot gets the uImage from other place in the SD?

edit: I just checked the CWM SD (http://xdaforums.com/showthread.php?t=1360994). I used the 2GB version. The SD image is simple a FAT filesystem (no partition table), so no partition in the SD where an alternative copy of the kernel image could come from, only the file I replaced, uImage. I am now at work so I can't do more checks. I'll know more later. The last option will be that booted kernel is the kernel inside the Nook, not the kernel on the SD...

... However, in http://nookdevs.com/Building_the_Nook_Touch_stock_kernel , it is stated that it boots from the kernel on SD:

Step 4: Make the SD Card and Boot to it
The uImage genrated in arch/arm/boot/ is the kernel we want our Nook to run off. Copy the uImage to the root directory of a FAT32-formatted SD card, stick it in your Nook and power off, then power on again. If the Nook boots fine then everything should be working properly.
 

Renate

Recognized Contributor / Inactive Recognized Dev
I don't know if somebody is missing something here, it could well be me.

On boot, the Nook looks first for the SD card, then the internal SD card.
It goes to the first partition, which should be FAT32.
It finds MLO, the bootloader.
That loads u-boot.bin, the next loader.
u-boot.bin identifies on the USB as 0451:d00e and sees if anything responds.
Failing a response, it decides whether to load uImage/uRamdisk or uRecImg/uRecRam,
based on /rom/devconf/BootCnt being over/under 8 reboots
The image is loaded, the initial file system is expanded.
init.rc is executed.
 

tusko5

Senior Member
Jan 27, 2011
108
29
Confirmed. The kernel that boots is the kernel I compiled. In order to check this I removed my compiled kernel uImage from the external sd card. It hanged, but, interestingly, the display shows the CWM picture, so u-boot can access the gpu?
 

klausef

Senior Member
Jul 17, 2011
57
31
Raleigh
Confirmed. The kernel that boots is the kernel I compiled. In order to check this I removed my compiled kernel uImage from the external sd card. It hanged, but, interestingly, the display shows the CWM picture, so u-boot can access the gpu?

The graphics processing unit is a device that facilitates graphics or processing. The graphics are displayed by dumping pixels into a chunk of memory called the framebuffer, which is output to the screen. UBoot can access the framebuffer, although I doubt it is using the gpu.

getting gpu access will speed up computation of some things, but afaik it doesn't actually display the graphics.
 

tusko5

Senior Member
Jan 27, 2011
108
29
The graphics processing unit is a device that facilitates graphics or processing. The graphics are displayed by dumping pixels into a chunk of memory called the framebuffer, which is output to the screen. UBoot can access the framebuffer, although I doubt it is using the gpu.

getting gpu access will speed up computation of some things, but afaik it doesn't actually display the graphics.

Ok. Sorry. I was talking about the framebuffer then. I thought that the omap3ep driver in B&N kernel sources was required to display graphics in the NST, but u-boot does it without this driver.
 

Renate

Recognized Contributor / Inactive Recognized Dev
Yes, u-boot.bin has the basics to display the graphics:

  • booting.pgm
  • charging0.pgm
  • charging1.pgm
  • charging2.pgm
  • charging3.pgm
  • dead.pgm

The following files may be found in the boot directory from older installs but are not used:

  • black.pgm
  • pic.pgm
  • white.pgm
 

mrWax

Senior Member
Jan 31, 2012
147
24
leap forward

I see the greatest motivation in getting new kernel in two things :

1. Quality No-Refresh support
2. update of android to at least 2.2
3. mouse support?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    So i have downloaded the nook touch kernel source and have gotten it to build using the gossamer defconfig. (as described somewhere by jesusfreke)

    then as a test i enabled ext4 support and recompiled
    then converted my system partition to ext4 while booted into noogie on the sdcard.
    i also edited the init.rc to mount /system as ext4 and enable adb over usb support
    and it seems like it works as shown in the code below.

    Code:
    drew@master: nook_touch$ adb shell cat /proc/version
    Linux version 2.6.29-omap1 (drew@master) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #3 PREEMPT Tue Oct 4 14:37:59 CDT 2011
    
    drew@master: nook_touch$ adb shell cat /proc/mounts
    rootfs / rootfs ro 0 0
    tmpfs /dev tmpfs rw,mode=755 0 0
    devpts /dev/pts devpts rw,mode=600 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
    /dev/block/mmcblk0p2 /rom vfat rw,sync,noatime,nodiratime,uid=1000,gid=1000,fmask=0117,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,errors=remount-ro 0 0
    /dev/block/mmcblk0p5 /system ext4 ro,barrier=1,data=writeback 0 0
    /dev/block/mmcblk0p8 /data ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block/mmcblk0p7 /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0

    so where do i go from here? how do i start forward porting the kernel to .32 or .35 or do i even need to do that? in general what needs to change to get a cyanogenmod compatible kernel?

    also how can we get a serial or UART output from the nook touch. I have been testing some cm builds from the nook color but it doesnt boot far enough for abd to give any output. ive looked at the back of the board but there doesnt seem to be any blatantly obvious serial port connections on it like the nook color has.

    ps. uImage and uRamdisk are attached for reference. i try them if you want. but backup yours first!
    3
    It seems I was unpacking the wrong files which were so hard to unpack I couldn't unpack them. I guess the uImage is a binary kernel not able to be unpacked? I tried lots of cpio/gunzip commands and scripts online to unpack u-boot files but they didn't work :(.
    Correct, the kernel is a compiled binary and not packed, so no way to unpack it.
    If you want to unpack the uRamdisk, you can use the attached scripts.

    I have a question now though: In order to get the uRamdisk, I need to build an android system. The thing is... B&N didn't give sources for an android version, it seems. They only gave sources for a kernel, which is okay but it isn't enough (I think??) to build an android filesystem from the ground zero, right?

    I'm wondering, if I want to build Eclair (for example, which is the current working version in the NST), which config should I use? I've seen I could use something like "encore" or "zoom2" (as the same build.prop in the NST states, "zoom2") to build /system and mix it with B&N's kernel? or am I wrong?
    I also think hhe sourcecode released by BN isn't enough to build android, and there is no configuration that you could use, so you have to start from scratch.
    I think it would be a lot easier to take CM7, checkout the branch for the Nook Color (encore) and customize it to run with the NST.
    my objective is to build, aside from a kernel, a pure android ROM too.Hm, but that would still run /system from the nook. My idea was to make a SD that would boot -and- use the files from itself instead of touching the NST's files. That way, I could happily work on a custom android version without having to mess with my NST's filesystem and risk messing it up and having to restore it again with dd.
    It should be possible, but I never tried it:
    -partition and format the sd in a similiar way like the nook,
    -unpack the uRamdisk and edit the mountpoints in the init.rc from mmcblk0 to mmcblk1

    Again, I'm not sure if it works, thats what I read somewhere. And even if it works, it will be slow if you don't use a really fast sd-card.
    3
    Here's what I managed to find out about kernel source so far :

    Ros87 was right about SGX source code - it seems to be missing. Without it there's not much you can display bar the bootup logo. I wasn't able to recompile the official TI one the way it works with provided sources. Anybody have any results in this ?

    tiwlan_drv.ko WLAN module acts funny as well, seems to hang as soon as you disable kernel debug.

    I managed to change a lot in kernel config, and I noticed that are two sections that you can't just touch without breaking either WLAN of SGX modules :
    - Kernel profiling must remain on in order for tiwlan_drv.ko module to be able to work. Otherwise it wouldn't turn off.
    - without recompiling sgx modules, you need to leave preemt debug, mutex debug and soft locks detection on, otherwise SGX PVR modules are failing to initialize, and the whole lot stays at the boot screen forever

    Positive side effect of all of this is that now I've quite rich kernel with :
    - CFQ iosched
    - reiserfs/ext4/ntfs enabled
    - DroidWall support (iptables match target)
    - Group process scheduling
    - UTF8 enabled (can't switch to it entirely cause B&N stuff uses non utf all around the place)
    - half of kernel debugging off
    - PM debug off
    - fastfpe works quite fine
    - ondemand cpu governor

    If anybody was interested in config or binaries then give me a shout please. I really need somebody to give me a hand with SGX and WLAN sources in order to push it forward.
    2
    A lot of information about the sgx kernel-modules can be found on http://omapedia.org/wiki/Graphics

    Omappedia is a really great source for us. There is also a git repo for the dsp-bridge.

    Well, yes I've already tracked down the SGX SDK for Omap35x and I know the km sources are in there, just hoping they will work on the 36x aswell :)

    I guess I'll find out a little later today, setting up the build environment to use the kernel sources from B&N is a bit of a pita...
    2
    thx and where to read

    Hi!
    I really appreciate you excitement into this thread. I had atleast send some thx here for now.
    I'll try to find some good source of knowleadge to read on this (dont know where yet) to educate mysefl.