AMSS on Qualcomm's MSM Platform

Source: Internet
Author: User

The source of AMSS is actually the underlying Part Of The qc brew (Binary Runtime Environment for wireless) platform, removing the aee (Application Execution Environment) section that provides interfaces for applications, qualcomm uses this architecture on other dual proc chips. Therefore, if you want to understand this set of source, it is necessary to have a basic understanding of brew. You do not need to understand the operating mechanism of its applications, but only need to understand the underlying operating system, in particular, the running mechanism of Rex (Run time executive) must be understood.
First, let's take a look at the basic structure of this set of Source:
| -- AMSS
| -- Platform
| '-- Products
'-- Amss_cust
'-- Products
AMSS is our source, which includes platform and some services we provide for this chip. All services are stored in the form of tasks under products. Now the source configuration is for surf. If it is for our own board, we must configure three configuration files under the amss_cust directory, copy them to the corresponding directory of AMSS, and re-compile. The three files are boot-related. Chen Qi should be clear about the configuration ~~
| -- Modem_proc
| '-- Drivers
| '-- Boot
||-- 7627
| '-- Boot_mem_ddr.s
| '-- Pm_vreg_target.h
'-- Secboot
'-- Pai_data
'-- 7627
'-- Ebi1
'-- Ebi1.cfg
Next, let's take a look at the content in AMSS. First, let's take a look at platform. Platform provides the underlying runtime environment for tasks under products, including L4 microkernel, CS (componet service ), libstd (static library of aee), RTE (Run time enviroment ):
| -- CS
| -- L4
| -- Libstd
'-- RTE
L4 is a microkernel that provides functions such as address space, thread, and IPC. Component Service provides an RTE Based on L4 and provides features such as memory protection, thread creation, and synchronization, in the past, when Qualcomm did not release brew, more system services were added in CS. qc defined related interfaces to allow you to add the functions that RTE can provide; libstd contains the aee interface and a static aee Library; RTE mainly contains IPC-related content. Platform content I think we only need to understand it. Generally, it should not need to be modified. Besides adding services to CS, this should be a long time later ~~ Below is the AMSS above the MSM
Platform Architecture:

 

Let's take a look at the content in products. Before learning about this part of source, you must understand some features of Rex. Rex is a preemptible, multi-task RTOS. All tasks exist in the form of tasks. Rex provides APIs for task creation, synchronization, mutex, timer, interrupt control, and other functions, the task here is actually our thread, and each task corresponds to a thread. Rex maintains a list of tasks (two-way linked list) and always runs tasks with high priority. All the services in products, including the 3G protocol stack, run on Rex in the form of tasks.
After learning about the basic features of Rex, Overview The class content below products:
'-- 76xx
| -- 1x // source code for CDMA 1X Protocol
| -- Apps // source code for some brew apps such as core and UI
| -- Cmd_proc // applications Boot Loader
| -- Build // trace32 JTAG script for building, build image, and log
| -- Core // shared APIs folder
| -- Dal // device abstract layer code
| -- Data // source code for Data Services
| -- Drivers // driver s for LCD, peripherals, etc.
| -- Hal // hardware abstract layer code
| -- HDR // source code for high data rate Protocol
| -- Modem // modem AMSS source code
| -- Modem_proc // modem AMSS boot files
| -- Multimedia // multimedia files, including audio, video, etc.
| -- NAS // source code for NAS Layer Protocol
| -- Secboot // boot loaders, from PBL to oemsbl
| -- Services // source code for services
| -- Tools // code for flash operations
| -- WCDMA // source code for WCDMA protocol
'-- Wconnect // bt soc config and FTM (factory test mode)
The above introduction only gives you an overall impression that all these sources are organized through Rex. Let's look at the running status after AMSS is started:


 

All AMSS tasks run in CS kernel process in the form of threads, including CS core services, all run on Rex in the form of tasks. Here, I guess the user process is the class capacity in products/apps. After reading this figure, let's take a closer look at the Startup Process of AMSS Source: qcsbl_main_ctl will jump to L4 kernel. After L4 kernel is started, igunar server will be started, then start the Rex process (run/service/TMC/mobile. main function in C), AMSS/REX runs in L4 as a process
On the microkernel, all tasks are L4 threads.
Next we will take a closer look at this main function. In this main function, we will first call rex_init to initialize Rex. Here Qualcomm implements a TMC (task manager controler) as the first task after Rex is started. At last, this task starts all other required tasks and calls Rex's system functions to manage these tasks, by tracking these tasks, we can fully see how a function is driven from the top layer of tasks to the bottom layer, such as PMIC, NV, sim and other services run on Rex in the form of tasks.
Products/76xx/services/TMC. the tmc_define_tasks function in C determines which tasks need to be started through macro judgment, and these macro control is through products/76xx/build/MS/Cust *******. H and products/76xx/build/MS/Target ******. h. during compilation, tsncjnlym is configured. CMD and so on to control some compilation environment options, as well as those modules that need to be compiled, through the cust or target header file to control which tasks will be started by the system after the system is started. Let's see
Products/76xx/services/TMC. in C, the tmc_define_tasks function can know how many tasks are supported in AMSS. All the functions in more than 4000 rows call the rex_def_task function of the Rex system to define tasks. For example, NV:
5374 rex_def_task (& nv_tcb,
5375 (rex_stack_word_type *) nv_stack,
5376 nv_stack_siz,
5377 (rex_priority_type) nv_pri,
5378 nv_task,
5379 0l );
Nv_task is the entry function of this task. We can trace this function to find the execution and calling process of this task.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.