[KERNEL] [WIP] Custom Kernel Project

Search This thread

mybook4

Senior Member
Apr 3, 2011
445
267
Intro
I wanted to make a thread to document kernel development activities that we're doing. So far, this Ouya forum has been a great place to view what it takes to start developing for a new device!

First of all, alsutton over on GitHub posted the kernel source. It can be found here https://github.com/ouya/ouya_1_1-kernel.

XDA University has some great articles to get started:
http://xda-university.com/as-a-developer/getting-started-building-a-kernel-from-source
http://xda-university.com/as-a-developer/adding-features-to-your-kernel


Things noticed about the stock kernel so far:
-it's cpu governor seems to be permanently set to "performance" (1600Mhz all the time). There might be a way to override this, but in the voltage control app, I wasn't able to change anything (frequency or governor)


Wish List:
-Access to set more governors (could help the Ouya's fan stay off during menu surfing)
-Overclocking (we have a fan...let's break 2Ghz because we need moar hertz. Might help speed up some emulators)


Need more info:
-If we ever overlock, we need a way to view temperature to make sure we're not frying our Ouyas. Just a guess, but it's probably a file we can read from in /dev or /proc
-Just a blind guess after reading the XDA University article on adding overclocking, but SOURCE/arch/arm/mach-tegra/tegra3_clocks.c might be a place to look. It seems to have clock frequency tables. Other devs that have made tegra 3 kernels might know the appropriate files to edit
 

mybook4

Senior Member
Apr 3, 2011
445
267
boot.img details

As an FYI,

for most android devices, the kernel resides in it's own partition on the device. When flashing a new kernel, a new boot.img is flashed to the partition. The boot.img file includes a header, the kernel image (pre-compiled), and the ramdisk. On boot, the kernel takes control and uses the ramdisk files to get things started. The rest of the partitions (including system, data, cache) are mounted and the Android OS is booted (from system).

Here's one way to take a boot.img and dissect it in order to view the ramdisk contents.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

Here's another way as well (thanks, professorpoptarts)
http://xdaforums.com/showthread.php?t=1890912
 

HTCdemon

Senior Member
May 30, 2008
70
8
May I suggest not to try to overclock past known safe values of 1.9ghz?

As for the kernel....it is not set to be at 1.6ghz all the time... its set differently and actually stays and floats at 1ghz until utilization kicks in at to 1.6ghz

You wont be able to change any of these values until you compile your own kernel with the correct voltage/clock settings in place.

-----edit------

To add to that in respects to the 1-1.6ghz range it actually only utilizes those 2 cpu states ( from what I've recorded )
 
  • Like
Reactions: mybook4

mybook4

Senior Member
Apr 3, 2011
445
267
May I suggest not to try to overclock past known safe values of 1.9ghz?

As for the kernel....it is not set to be at 1.6ghz all the time... its set differently and actually stays and floats at 1ghz until utilization kicks in at to 1.6ghz

You wont be able to change any of these values until you compile your own kernel with the correct voltage/clock settings in place.

-----edit------

To add to that in respects to the 1-1.6ghz range it actually only utilizes those 2 cpu states ( from what I've recorded )

What are you using to record? I have been using "system panel".


Sent from my SCH-I535 using xda premium
 

professorpoptart

Senior Member
Jul 7, 2010
166
110
just fyi, I was looking at the init.rc for the 264 OTA, just in case a rom gets flashed that didn't remove this we could always disable the recovery flash at the boot level.

service flash_recovery /system/etc/install-recovery.sh
class main
oneshot
 

invisiblek

Recognized Developer
Feb 24, 2010
1,580
5,833
Minnesota
www.invisiblek.org
for any other aspiring kernel devs out there:

https://github.com/invisiblek/AnyKernel/tree/ouya
(fyi: this is on the branch named ouya of that repo, make your you add: -b ouya to your git clone or you'll get the branch for a different device)
just throw your zImage in kernel/ and your modules in modules/

make sure when you compile your kernel, you add -fno-pic to your KBUILD_CFLAGS_MODULE in Makefile in the root of your kernel source
otherwise it wont load the modules

wewt!
 

HTCdemon

Senior Member
May 30, 2008
70
8
Just curious.....is anyone else having issues compiling the latest commit?

I reverted back to the previous commit but it still breaks.

Build machine hasnt changed.

Code:
drivers/dma/timb_dma.c: In function 'td_tx_status':
drivers/dma/timb_dma.c:521: error: 'last_complete' undeclared (first use in this function)
drivers/dma/timb_dma.c:521: error: (Each undeclared identifier is reported only once
drivers/dma/timb_dma.c:521: error: for each function it appears in.)
drivers/dma/timb_dma.c:521: error: 'last_used' undeclared (first use in this function)
drivers/dma/timb_dma.c:513: warning: unused variable 'td_chan'
make[2]: *** [drivers/dma/timb_dma.o] Error 1
make[1]: *** [drivers/dma] Error 2
make: *** [drivers] Error 2
 

invisiblek

Recognized Developer
Feb 24, 2010
1,580
5,833
Minnesota
www.invisiblek.org
Just curious.....is anyone else having issues compiling the latest commit?

I reverted back to the previous commit but it still breaks.

Build machine hasnt changed.

Code:
drivers/dma/timb_dma.c: In function 'td_tx_status':
drivers/dma/timb_dma.c:521: error: 'last_complete' undeclared (first use in this function)
drivers/dma/timb_dma.c:521: error: (Each undeclared identifier is reported only once
drivers/dma/timb_dma.c:521: error: for each function it appears in.)
drivers/dma/timb_dma.c:521: error: 'last_used' undeclared (first use in this function)
drivers/dma/timb_dma.c:513: warning: unused variable 'td_chan'
make[2]: *** [drivers/dma/timb_dma.o] Error 1
make[1]: *** [drivers/dma] Error 2
make: *** [drivers] Error 2

Fine here
Now if I just had a working Ouya....we could make some cool stuff =P
 

HTCdemon

Senior Member
May 30, 2008
70
8
Back with a new problem...

Code:
06-29 18:41:21.260: D/WifiService(322): setWifiEnabled: true pid=584, uid=10018
06-29 18:41:21.270: E/WifiHW(107): Failed to open wlan fw path param (No such file or directory)
06-29 18:41:21.270: E/SoftapController(107): Softap fwReload - failed: -1
06-29 18:41:21.270: E/WifiStateMachine(322): Failed to reload STA firmware java.lang.IllegalStateException: command '9 softap fwreload wlan0 STA' failed with '400 9 Softap operation failed (No such file or directory)'
06-29 18:41:21.270: W/CommandListener(107): Failed to retrieve HW addr for wlan0 (No such device)
06-29 18:41:21.270: D/CommandListener(107): Setting iface cfg
06-29 18:41:21.270: E/WifiStateMachine(322): Unable to change interface settings: java.lang.IllegalStateException: command '11 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 11 Failed to set address (No such device)'
06-29 18:41:21.280: V/WifiSetupActivity(584): Setting content visible: true
06-29 18:41:21.280: E/wpa_supplicant(986): nl80211: Could not add multicast membership for scan events: -2 (No such file or directory)
06-29 18:41:21.280: E/wpa_supplicant(986): Failed to initialize driver 'nl80211'
06-29 18:41:21.280: E/wpa_supplicant(986): wlan0: Unsupported driver 'nl80211'
06-29 18:41:21.370: E/WifiStateMachine(322): Failed to start supplicant!

Anyone else having issues with this?

edit:

Looks like it's not loading any modules at all... I had no problems previously with older kernels till 328....anyone know what im missing?
 
Last edited:

Ouya-XD

Senior Member
Jun 24, 2013
106
15
My main issue here, and something I'd like to see done.

The Ouya seems to get hot sometimes during long durations of gameplay, could we put together a method on getting the fan boosting cool air through the device once it gets hot? Or would that be something hardware related as the Ouya can't say; "I'm hot, pour some water on me"?

If this was useful to you, I can only ask of a favor!
Check out my YouTube channel!
http://WWW.YouTube.com/user/TheDarkRosary
Subscribe if you will! :)
 

hcgonzalezpr

Senior Member
Jun 16, 2009
98
121
Miami
harrygonzalez.me
Back with a new problem...

Code:
06-29 18:41:21.260: D/WifiService(322): setWifiEnabled: true pid=584, uid=10018
06-29 18:41:21.270: E/WifiHW(107): Failed to open wlan fw path param (No such file or directory)
06-29 18:41:21.270: E/SoftapController(107): Softap fwReload - failed: -1
06-29 18:41:21.270: E/WifiStateMachine(322): Failed to reload STA firmware java.lang.IllegalStateException: command '9 softap fwreload wlan0 STA' failed with '400 9 Softap operation failed (No such file or directory)'
06-29 18:41:21.270: W/CommandListener(107): Failed to retrieve HW addr for wlan0 (No such device)
06-29 18:41:21.270: D/CommandListener(107): Setting iface cfg
06-29 18:41:21.270: E/WifiStateMachine(322): Unable to change interface settings: java.lang.IllegalStateException: command '11 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 11 Failed to set address (No such device)'
06-29 18:41:21.280: V/WifiSetupActivity(584): Setting content visible: true
06-29 18:41:21.280: E/wpa_supplicant(986): nl80211: Could not add multicast membership for scan events: -2 (No such file or directory)
06-29 18:41:21.280: E/wpa_supplicant(986): Failed to initialize driver 'nl80211'
06-29 18:41:21.280: E/wpa_supplicant(986): wlan0: Unsupported driver 'nl80211'
06-29 18:41:21.370: E/WifiStateMachine(322): Failed to start supplicant!

Anyone else having issues with this?

edit:

Looks like it's not loading any modules at all... I had no problems previously with older kernels till 328....anyone know what im missing?

Im getting the exact same problems on a stock OUYA bougth today

lsmod on the adb shell shows the following :
shell@android:/ $ lsmod
lsmod
cfg80211 179175 0 - Live 0x00000000
inv_mpu_ak8975 3937 0 - Live 0x00000000
inv_mpu_kxtf9 6865 0 - Live 0x00000000
mpu3050 36222 2 inv_mpu_ak8975,inv_mpu_kxtf9, Live 0x00000000
 

Zarboz

Known Scammer
Mar 5, 2009
145
9,339
Denver
My main issue here, and something I'd like to see done.

The Ouya seems to get hot sometimes during long durations of gameplay, could we put together a method on getting the fan boosting cool air through the device once it gets hot? Or would that be something hardware related as the Ouya can't say; "I'm hot, pour some water on me"?

If this was useful to you, I can only ask of a favor!
Check out my YouTube channel!
http://WWW.YouTube.com/user/TheDarkRosary
Subscribe if you will! :)

sure through some code already published there are multiple ways to impliment thermal throttling

although that could impact game play

im sure there are also ways to open the unit and have it trigger a fan
im sure you also could make custom heatsink for the unit for those hardcore Overclockers

you wanna look in
tegra3_clocks.c
tegra3_dvfs.c
tegra3_thermal.c
tegra3_throttle.c
cpu-tegra3.c
and a few others

you can improve the GPU clocks and add governors easily as well as change between slab/slub/slob/slqb

this would be something really fun to play with ill try to save up for an ouya :p
 

BUS DR1V3R

Senior Member
Sep 30, 2010
59
20
Is this project still active? I would love to contribute in any way possible to an overclocked kernel, but I have never done any kernel development before.
 

KyleK29

Senior Member
Oct 15, 2006
498
34
Things noticed about the stock kernel so far:
-it's cpu governor seems to be permanently set to "performance" (1600Mhz all the time). There might be a way to override this, but in the voltage control app, I wasn't able to change anything (frequency or governor)

Just for reference, I have two Ouya's. One came clocked (retail version) at 1.6, the other came (Kickstarter) clocked at 1.7.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Intro
    I wanted to make a thread to document kernel development activities that we're doing. So far, this Ouya forum has been a great place to view what it takes to start developing for a new device!

    First of all, alsutton over on GitHub posted the kernel source. It can be found here https://github.com/ouya/ouya_1_1-kernel.

    XDA University has some great articles to get started:
    http://xda-university.com/as-a-developer/getting-started-building-a-kernel-from-source
    http://xda-university.com/as-a-developer/adding-features-to-your-kernel


    Things noticed about the stock kernel so far:
    -it's cpu governor seems to be permanently set to "performance" (1600Mhz all the time). There might be a way to override this, but in the voltage control app, I wasn't able to change anything (frequency or governor)


    Wish List:
    -Access to set more governors (could help the Ouya's fan stay off during menu surfing)
    -Overclocking (we have a fan...let's break 2Ghz because we need moar hertz. Might help speed up some emulators)


    Need more info:
    -If we ever overlock, we need a way to view temperature to make sure we're not frying our Ouyas. Just a guess, but it's probably a file we can read from in /dev or /proc
    -Just a blind guess after reading the XDA University article on adding overclocking, but SOURCE/arch/arm/mach-tegra/tegra3_clocks.c might be a place to look. It seems to have clock frequency tables. Other devs that have made tegra 3 kernels might know the appropriate files to edit
    3
    for any other aspiring kernel devs out there:

    https://github.com/invisiblek/AnyKernel/tree/ouya
    (fyi: this is on the branch named ouya of that repo, make your you add: -b ouya to your git clone or you'll get the branch for a different device)
    just throw your zImage in kernel/ and your modules in modules/

    make sure when you compile your kernel, you add -fno-pic to your KBUILD_CFLAGS_MODULE in Makefile in the root of your kernel source
    otherwise it wont load the modules

    wewt!
    2
    boot.img details

    As an FYI,

    for most android devices, the kernel resides in it's own partition on the device. When flashing a new kernel, a new boot.img is flashed to the partition. The boot.img file includes a header, the kernel image (pre-compiled), and the ramdisk. On boot, the kernel takes control and uses the ramdisk files to get things started. The rest of the partitions (including system, data, cache) are mounted and the Android OS is booted (from system).

    Here's one way to take a boot.img and dissect it in order to view the ramdisk contents.
    http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

    Here's another way as well (thanks, professorpoptarts)
    http://xdaforums.com/showthread.php?t=1890912
    1
    May I suggest not to try to overclock past known safe values of 1.9ghz?

    As for the kernel....it is not set to be at 1.6ghz all the time... its set differently and actually stays and floats at 1ghz until utilization kicks in at to 1.6ghz

    You wont be able to change any of these values until you compile your own kernel with the correct voltage/clock settings in place.

    -----edit------

    To add to that in respects to the 1-1.6ghz range it actually only utilizes those 2 cpu states ( from what I've recorded )
    1
    I wish i had an Ouya.... i would be all over this :D