Page 1 of 1

Arm os development

Posted: Mon Mar 28, 2022 10:06 am
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.

Re: Arm os development

Posted: Mon Mar 28, 2022 12:25 pm
by Octocontrabass
There's no standard ARM boot process. Each ARM computer is different.

Re: Arm os development

Posted: Mon Mar 28, 2022 2:37 pm
by pvc
What device in particular do you intend to work with?

Re: Arm os development

Posted: Mon Mar 28, 2022 6:36 pm
by Kamal123
I would like to work with ARM SoC like MediaTek, Qualcomm..etc.

Re: Arm os development

Posted: Mon Mar 28, 2022 6:55 pm
by Octocontrabass
Those don't have a standard boot process either.

Which device do you want to work with?

Re: Arm os development

Posted: Mon Mar 28, 2022 7:36 pm
by Kamal123
I would like to work with smartphone devices like Vivo, Oppo.

Re: Arm os development

Posted: Mon Mar 28, 2022 9:45 pm
by Octocontrabass
Smartphones are usually undocumented. You'll probably have to figure it out on your own.

Re: Arm os development

Posted: Tue Mar 29, 2022 3:50 am
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.

Re: Arm os development

Posted: Tue Mar 29, 2022 6:58 am
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

Re: Arm os development

Posted: Fri Apr 01, 2022 1:17 pm
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.