Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 18, 2024, 04:47:40 04:47


Login with username, password and session length


Pages: [1]
Print
Author Topic: [Help] Porting OS Android or Linux  (Read 3453 times)
0 Members and 1 Guest are viewing this topic.
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 48
-Receive: 86


Lazy Efficient


« on: May 15, 2014, 10:30:09 10:30 »

I am a hardware engineer that worked with different aspects of hardware design (Schematic Design, PCB Layout, Embedded Coding). I made embedded software for many MCUs including 8051, ARM Cortex-M3, PIC, Arduino. In one of my latest project, I am starting to think that porting an OS to my project will make my life easier.

The project will deal with many communication protocols WiFi, NFC, BLE. Instead of handling the stacks and the communication myself, it might be easier if I am able to port an already existing OS and work around it.

I do not have any experience with this, it will be great if anyone here can give some guidance. I am not expecting anyone to do my work for me I will do it myself, what I need is some opinions about how easy is it to start with that type of thing ? is it even possible for someone like me to do this ? if the port worked will it be stable ? should I continue to research about porting the OS or should I drop it ?

Also if anyone can give some guidance about where to start and some important tips/tricks/pitfalls to take care of, anything that can help.

I found this book, and updated the link in this Thread, is this a good start ?

Thanks in advance.
LzEn
Logged

~ Laziness Is The Mother Of Efficiency ~
Some Anon Guy
Junior Member
**
Offline Offline

Posts: 43

Thank You
-Given: 58
-Receive: 25



« Reply #1 on: May 15, 2014, 03:07:15 15:07 »

Have you thought about using an RTOS that is already configured for your hardware?
something like http://www.freertos.org/

Logged
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #2 on: May 15, 2014, 03:17:12 15:17 »

About the book you referred: Porting Android to a mcu wouldn't play nice imo. The main reason for my reasoning is that Android uses Java Virtual Machine (JVM) to execute its programs. I'm not even sure how the Android native C++ compiler bypasses JVM. So you'll have to deal with JVM related problems apart from others. I think I need not say that Android won't fit into a small mcu.

My suggestion would be to use a capable OS already ported to (big enough?) mcus. For example my NAS uses ARM and Debian ported to ARM architecture. There is also the Raspberry Pi and many OSes (usually *nix) ported to it. I never tried but porting an OS is much more than installing a cross-compiler and setting some flags before building.
Logged

Regards...
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 48
-Receive: 86


Lazy Efficient


« Reply #3 on: May 15, 2014, 03:43:56 15:43 »

@Some Anon Guy : I am not sure how RTOS will help in the development of WiFi, NFC parts.

@hate: I am not saying that I want to use a small MCU for the design, it can be any processor needed. Mostly, I am wondering, how hard is it to port an OS, or even copy a hardware design from a Dev board and run an OS on it. and concerning Android, I don't think while porting the OS you will have to deal with JVM but I am not sure Cheesy.

Thanks.
Logged

~ Laziness Is The Mother Of Efficiency ~
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #4 on: May 15, 2014, 04:19:01 16:19 »

I think it will a lot more easier to use a board which is Linux /Android ready.

About a month a go i bought Odroid U3 (Exynos4412 Quad Core) and Odroid-XU (Exynos5 Octa Core), good quality product in good price.

Olimex also had some board with lesser performance.

-ichan
Logged

There is Gray, not only Black or White.
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #5 on: May 15, 2014, 05:40:18 17:40 »

Mostly, I am wondering, how hard is it to port an OS, or even copy a hardware design from a Dev board and run an OS on it.
There is a discussion in the link below to port Android to the AVR32 architecture. Maybe you can have an idea about its complexity. Btw Dalvik is Android's JVM.
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=73478

and concerning Android, I don't think while porting the OS you will have to deal with JVM but I am not sure Cheesy.
As I've said before I don't know how Android's native C++ compiler bypasses JVM but other than that I don't know of a way that you can run your programs on Android without the JVM in the process, meaning quite probably you will have to port it too somehow.

Edit:
@Ichan: +1
« Last Edit: May 15, 2014, 05:43:49 17:43 by hate » Logged

Regards...
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 48
-Receive: 86


Lazy Efficient


« Reply #6 on: May 15, 2014, 09:53:04 21:53 »

From my basic knowledge the kernel is written in c/c++ and that is where the porting takes place.
I think porting is not as complicated and you might think it is.
I found two useful articles might benefit someone in my position.
http://free-electrons.com/doc/kernel-porting.pdf
www.linux-arm.org/pub/LinuxKernel/WebHome/aleph-porting.pdf
I will share more once I explore more.

@Ichan I thought about buying a board with Android already ported to. Especially a cubieboard. The cubieboard is open source so you access the schematic files online. Neverthess the project is meant to be an end user project and not a personal use project. So it s impossible to use any of these boards. Also, I am not sure how to add NFC support to such a board.
Logged

~ Laziness Is The Mother Of Efficiency ~
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #7 on: May 16, 2014, 03:47:38 03:47 »

LzEn: Both documents you referred talk about porting a Linux kernel to ARM architecture where the kernel has ALREADY support for that architecture. This is mostly adjusting the kernel for a different configuration. Porting covers a much more wider area than just reconfiguring the kernel, like adding support for a different, unsupported architecture (i.e. AVR32 as in the link I posted). This is the type of porting I assume to be hard work.

If you are thinking of going for an ARM board with the hardware you need already implemented, the documents you provided made me believe that porting the kernel is quite manageable and probably you will already have your drivers for your hardware ready to use. But before I can judge on the complexity of porting in general, I need to see someone put reasonably little effort to port the linux kernel (or some other OS) for a completely different unsupported architecture and make it work.
Logged

Regards...
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 48
-Receive: 86


Lazy Efficient


« Reply #8 on: May 16, 2014, 07:31:04 07:31 »

LzEn: Both documents you referred talk about porting a Linux kernel to ARM architecture where the kernel has ALREADY support for that architecture. This is mostly adjusting the kernel for a different configuration. Porting covers a much more wider area than just reconfiguring the kernel, like adding support for a different, unsupported architecture (i.e. AVR32 as in the link I posted). This is the type of porting I assume to be hard work.

If you are thinking of going for an ARM board with the hardware you need already implemented, the documents you provided made me believe that porting the kernel is quite manageable and probably you will already have your drivers for your hardware ready to use. But before I can judge on the complexity of porting in general, I need to see someone put reasonably little effort to port the linux kernel (or some other OS) for a completely different unsupported architecture and make it work.


That is what I was trying to explain. I am not trying to reinvent the wheel and go to some new architecture. I am just trying to figure out how hard is it to make the OS run on already supported architecture. Maybe the word "porting" was not the correct word to use.
Some hardware manufacturers like the wifi module I will be using provide drivers for Android and Linux OS. So even if the original OS does not support the same hardware (WiFi module in this case) it shouldn't be too bad to add the drivers. I think it should be somehow the same as they do on XDA with porting Sense Rom to non HTC devices for example (not sure).

I am just trying to see if someone here did this before, because sometimes you read documents and it sounds trivial to implement. But once you start trying yourself some hidden pitfalls arise and you get stuck.
Logged

~ Laziness Is The Mother Of Efficiency ~
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #9 on: May 16, 2014, 08:23:15 08:23 »

I am just trying to see if someone here did this before, because sometimes you read documents and it sounds trivial to implement. But once you start trying yourself some hidden pitfalls arise and you get stuck.
If you really don't want to go for a ready-to-go solution here (maybe because of cost, hardware inconsistencies etc...), I don't think anyone can give you a good estimate about that kind of work. The reason would be the many factors to come into play like target board, architecture, level of experience, software versions/problems etc... I guess you will have to see for yourself how hard will it be while actually implementing what's in your mind. It might be more entertaining though. Wink
Logged

Regards...
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 48
-Receive: 86


Lazy Efficient


« Reply #10 on: May 16, 2014, 08:35:53 08:35 »

It might be more entertaining though. Wink

That is the main reason why I am even considering it hehehehhe..

You are right about what you said, nevertheless I was just hoping for some insight from someone on the other side Smiley
Logged

~ Laziness Is The Mother Of Efficiency ~
jobitjoseph1
Junior Member
**
Offline Offline

Posts: 44

Thank You
-Given: 18
-Receive: 178


« Reply #11 on: May 31, 2014, 02:01:20 14:01 »

Its interesting.I would also like to to how to port the os...
 
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC