سؤال

Hy everyone, I'm Korean and a little short on using english so please try to understand if I say things not appropriate.

So, my status is that I have odroid-s.

What I'm trying to do for like month or more is that I want to make android to HelloWorld.

What I want to say is that, on the odroid-s, bootloader part, kernel part is the same but the framework part(which will be android), I'll remove all the android part and replace it with just HelloWorld program. The purpose of this HelloWorld program is to display HelloWorld on the screen.

What I think I discovered is that, as I 'vimdiff' bootlogs between normal bootlog and the one that I removed all the system partition part (which is android system partition part) is that android kernel's init goes on and executes console(/bin/sh), netd(bin/netd), ... and it enables adb and it completes his work.

So my conclusion is, I need to use Linux kernel that is non-modified and modify it for odroid-s, and use that kernel for my HelloWorld program!

What I want to ask is.... Am I doing it right?? T_T

My goal right now is to make HelloWorld come out from this odroid-s device...

Please somebody help me. If anybody don't understand what I wrote plz tell me, I'll fix it. Thx for reading....

هل كانت مفيدة؟

المحلول

The modifications to the linux kernel are likely to be irrelevant to your goals, so you might as well leave them in place for simplicity.

Your biggest challenge is going to be output - where do you want to send it? If you had one of the devices that has (or can have with the right kernel config) a debug serial port, then it would be really easy to write something triggered by the init script (or even use 'echo' in the script) which outputs your message on that port.

But chances are you want to put something on the screen. This is going to be overwhelmingly more complicated, and perhaps device dependent. The way the android runtime does this for actual apps is going to be way more involved than you probably want to get into.

A more practical approach might be to look at how the boot animation is done. For starters you could just replace it with a static image that says "hello world". Once you can do that, the next step would probably be to find some character generator code. Finally you might want to implement scrolling and other terminal-like features.

As an alternative approach, there are builds of more traditional linuxes for some android devices - debian or ubuntu for example. These may include console implementations capable of displaying on the device screen.

As another idea, if you are flexible about how much of android you would be willing to leave on the device, you could build a version of the android terminal emulator example, modified to be a home screen replacement. You might be able to remove a lot of android components (eventually including the default home screen). Or on a secured device (ie, most consumer devices that haven't been rooted) you could just do the home screen replacement while leaving the actual system unmodified. It wouldn't be secure against users wanting to run other things, but generally the user would interact only with your code.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top