Arm os development

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Arm os development

Post by Kamal123 »

Hi, I have a question regarding arm boot process, according to my understanding the boot rom loads the bootloader from boot device (eMMC ,SD Card,USB flash,..etc) and bootloader loads the kernel, now I am confused with the boot partition of bootable media. For sd cards, what is the format of the boot partition? Is it FAT32 filesystem or raw? Do I need to write the bootloader 1st stage to first sector? Is it MBR/GPT based? How do boot rom finds and loads the main bootloader?

Thanks in advance.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Arm os development

Post by Octocontrabass »

There's no standard ARM boot process. Each ARM computer is different.
User avatar
pvc
Member
Member
Posts: 201
Joined: Mon Jan 15, 2018 2:27 pm

Re: Arm os development

Post by pvc »

What device in particular do you intend to work with?
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: Arm os development

Post by Kamal123 »

I would like to work with ARM SoC like MediaTek, Qualcomm..etc.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Arm os development

Post by Octocontrabass »

Those don't have a standard boot process either.

Which device do you want to work with?
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: Arm os development

Post by Kamal123 »

I would like to work with smartphone devices like Vivo, Oppo.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Arm os development

Post by Octocontrabass »

Smartphones are usually undocumented. You'll probably have to figure it out on your own.
User avatar
pvc
Member
Member
Posts: 201
Joined: Mon Jan 15, 2018 2:27 pm

Re: Arm os development

Post by pvc »

It is often difficult to just pick some random device and start bare-metal programming for it, even if you know what processor it has. There is just too much variation between them. It is way better to have some known, well documented one for that purpose.

But, if you really want to, there is still hope. Many small devices often have some kind of serial console connection inside them (usually 3 or 4 pin header; often not installed). If you manage to connect the device to a computer then there is a chance that the device is going to mention U-Boot somewhere in its boot diagnostic messages. U-Boot is somewhat standardized way of booting all sorts of smaller devices. Normal boot process can be often interrupted by sending a byte over serial port at very early stage of boot process. If it is not intentionally blocked by the manufacturer, it is going to land you in a simple command line interface. Using that, you can inject and/or modify standard boot process of the device to run your code.

WARNING! Incorrect connection between computer and your device may result in a permanent damage of your computer and/or said device. Modifying standard boot process of the device may brick it. It is good to have a way of making backup and restoring device's boot ROM before making any changes to it.

All that said, I would still recommend you buying some kind of well known and documented device like Raspberry Pi or some of its clones (only well documented ones). Documentation for RPis used to be, well… not so great. But a lot changed (for better) in that regard in recent years. There might be some problems with availability right now, but it shouldn't be difficult to get a used one locally.
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: Arm os development

Post by Kamal123 »

Hi, yes I will go for raspberry Pi for now, but if I get chance I will definitely go for smartphones SoC, just to learn.

I came to know that, SoC like MediaTek uses U-Boot bootloader to load the kernel. First BootRom reads and execute the first block from eMMC which contains a loader called preloader to initialise hardwares and bring another program to SRAM called little kernel, which is responsible for displaying the boot logo and other graphical things we see, prepares and environment for the kernel. Little kernel has basic threading and os specific stuffs, than little kernel search for the uImage in U-Boot partition, the uImage is the main file containing the kernel, finally little kernel give control to kernel.

Little kernel is the program which displays the charging animation when the phone is switched off during charge. Also when battery goes low, it is the program which displays the battery low animation after the phone goes off.


I just shared what I have learned, I might miss something.

Thanks
Manas Kamal
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Arm os development

Post by eekee »

The Pine Phone (or I guess Pine64 now) is a phone with open hardware. There's also a GNU phone I can't remember the name of, but I think the Pine is a bit cheaper and more powerful.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Post Reply