Android Gki Kernel

17 views
Skip to first unread message

Amice Golden

unread,
Jul 24, 2024, 9:35:18 PM7/24/24
to smoknosttepa

BEST: Make all of your changes to upstream Linux. If appropriate, backport to the stable releases. These patches will be merged automatically in the corresponding common kernels. If the patch is already in upstream Linux, post a backport of the patch that conforms to the patch requirements below.

LESS GOOD: Develop your patches out-of-tree (from an upstream Linux point-of-view). Unless these are fixing an Android-specific bug, these are very unlikely to be accepted unless they have been coordinated with kerne...@android.com. If you want to proceed, post a patch that conforms to the patch requirements below.

android gki kernel


DOWNLOAD > https://byltly.com/2zM2KA



I have 6 months experience with Android, developing simple UI-based applications. Now I want to write applications targeting the Android core Kernel. For example, I want to develop a framework which is not present in Android. To achieve that, we have to write the code for the Kernel. I don't know where and how to start Android Kernel programming.

If you are talking about platform level programming,i.e. framework extensions, native libraries and services there are a few places to start.The first one is the new and updated official open source project page. The portions about contributing and porting provide some basic information on the platform architecture and what you need to work with the platform. The next step is to understand the build system for the platform and framework. There are some limited info available on the net if you google for it. The best way is probably to study some of the makefile templates available in the open source project in the build folder. For info on how to add your own modules using Android.mk files it is a good thing to study make files for existing projects such as the ones available in external in the open source projects.

Once you have gotten as far as the above. That is you know the basics of platform level development and how to build your own modules for the platform the next step is to study the framework extension example available in the open source project. Check out the vendor/sample/PlatformLibrary folder (edit, as of 2.2 the vendor stuff has moved to the device folder) in the open source project and read the readme file, study the code, build it and make sure you understand it. If you don't then JNI, shared libraries, the platform security model and the core framework are areas that could help you out.

I guess that since you are talking about kernel programming you are also looking for ways to hook up new hardware with the platform and expose that functionality using your framework extensions to the applications. Hardware is basically added as a standard Linux driver so getting it to work under Linux is a good first step. How to hook it into the Android framework after that depends on what type of hardware it is. You could either use a native process to control it (compare the camera service or radio daemon in the current platform) or just spawn a thread in the application that uses your framework extension. For hardware that does not require that much attention plugging it in using an Android HAL library could also be an option.

I hope that provides some initial pointers on where to look. The official mailing lists are otherwise the main source of info about platform level development. Especially Android porting and Android platform.

You should also check out I just found this site recently and it is extremely useful. I wish I knew about it sooner. I'm not sure how dedicated Google is to updating the site because as BMB mentioned the vendor stuff was moved to the device folder in 2.2 but there have been no changes to the PDK site to reflect that. Also, some of the links don't work but I was able to find all the pages by doing a site search in Google.

I am using an Android Custom ROM on my device, also with a custom boot.img (custom kernel + cmdline + ramdisk). I now want to be able to view the kernel logs immediately after a kernel panic, but unfortunately I can not use a serial console.

The good news: There seem to be some sources/modules in the Linux kernel of Android that are written exactly for this purpose. For example, the following lines are activated in my .config file for the kernel:

My problem is: After I forced a kernel panic in order to test this, i.e. by loading a simple panic kernel module with insmod panic.ko, it seems that no log was written to the MTD named oem_log (which exists on my device). Secondly, the RAM also does not contain logs after reboot because it seems to be cleared - or the logs are not written either.

So how can I get the kernel logs after a panic? Also it would be helpful if there is a way I could test the APANIC on the running system. Maybe by using the kernel debug system? As of now I am pretty new to this.

You can find out in apanic_threads which thread / process is running when the kernel panic happens. In apanic_console you might find out more information such as the stack trace and values of some critical registers: PC, LR, etc.
They will help you get your debugging started.

Android creates a RAM console and attempts to save the last kernel message buffer for you in RAM (assuming the power doesn't go out). You can access this file through the proc interface and on my system it is world readable:

I faced a similar issue of collecting shutdown logs in Android. I had posted this question long back and it has 2 approaches. I use the 2nd one as the 1st one doesn't work for me. Here is the question

Android is a mobile operating system based on a modified version of the Linux kernel and other open-source software, designed primarily for touchscreen mobile devices such as smartphones and tablets. Android is developed by a consortium of developers known as the Open Handset Alliance, though its most widely used version is primarily developed by Google. It was unveiled in November 2007, with the first commercial Android device, the HTC Dream, being launched in September 2008.

At its core, the operating system is known as the Android Open Source Project (AOSP)[5] and is free and open-source software (FOSS) primarily licensed under the Apache License. However, most devices run on the proprietary Android version developed by Google, which ships with additional proprietary closed-source software pre-installed,[6] most notably Google Mobile Services (GMS)[7] which includes core apps such as Google Chrome, the digital distribution platform Google Play, and the associated Google Play Services development platform. Firebase Cloud Messaging is used for push notifications. While AOSP is free, the "Android" name and logo are trademarks of Google, which imposes standards to restrict the use of Android branding by "uncertified" devices outside their ecosystem.[8][9]

Over 70 percent of smartphones based on the Android Open Source Project run Google's ecosystem (which is known simply as Android), some with vendor-customized user interfaces and software suites, such as TouchWiz and later One UI by Samsung and HTC Sense.[10] Competing ecosystems and forks of AOSP include Fire OS (developed by Amazon), ColorOS by Oppo, OriginOS by Vivo, MagicUI by Honor, or custom ROMs such as LineageOS.

The source code has been used to develop variants of Android on a range of other electronics, such as game consoles, digital cameras, portable media players, and PCs, each with a specialized user interface. Some well-known derivatives include Android TV for televisions and Wear OS for wearables, both developed by Google. Software packages on Android, which use the APK format, are generally distributed through proprietary application stores like Google Play Store, Amazon Appstore, Samsung Galaxy Store, Huawei AppGallery, Cafe Bazaar, GetJar, and Aptoide, or open source platforms like F-Droid.

Android has been the best-selling OS worldwide on smartphones since 2011 and on tablets since 2013. As of May 2021[update], it had over three billion monthly active users, the largest installed base of any operating system in the world,[11] and as of January 2021[update], the Google Play Store featured over 3 million apps.[12] Android 14, released on October 4, 2023, is the latest version, and Android 12.1/12L includes improvements specific to foldable phones, tablets, desktop-sized screens[13] and Chromebooks.

Android Inc. was founded in Palo Alto, California, in October 2003 by Andy Rubin, Rich Miner, Nick Sears, and Chris White.[14][15] Rubin described the Android project as having "tremendous potential in developing smarter mobile devices that are more aware of its owner's location and preferences".[15] The early intentions of the company were to develop an advanced operating system for digital cameras, and this was the basis of its pitch to investors in April 2004.[16] The company then decided that the market for cameras was not large enough for its goals, and five months later it had diverted its efforts and was pitching Android as a handset operating system that would rival Symbian and Microsoft Windows Mobile.[16][17]

Rubin had difficulty attracting investors early on, and Android was facing eviction from its office space. Steve Perlman, a close friend of Rubin, brought him $10,000 in cash in an envelope, and shortly thereafter wired an undisclosed amount as seed funding. Perlman refused a stake in the company, and has stated "I did it because I believed in the thing, and I wanted to help Andy."[18][19]

In 2005, Rubin tried to negotiate deals with Samsung[20] and HTC.[21] Shortly afterwards, Google acquired the company in July of that year for at least $50 million;[15][22] this was Google's "best deal ever" according to Google's then-vice president of corporate development, David Lawee, in 2010.[20] Android's key employees, including Rubin, Miner, Sears, and White, joined Google as part of the acquisition.[15] Not much was known about the secretive Android Inc. at the time, with the company having provided few details other than that it was making software for mobile phones.[15] At Google, the team led by Rubin developed a mobile device platform powered by the Linux kernel. Google marketed the platform to handset makers and carriers on the promise of providing a flexible, upgradeable system.[23] Google had "lined up a series of hardware components and software partners and signaled to carriers that it was open to various degrees of cooperation".[attribution needed][24]

4a15465005
Reply all
Reply to author
Forward
0 new messages