The source of AMSS is actually qc brew (Binary Runtime Environment
Wireless) the underlying part of the platform removes the application execution (aee)
Environment), Qualcomm in dual
Other platforms on the proc chip basically adopt this architecture. Therefore, if you want to understand this set of source, it is necessary to have a basic understanding of brew, and do not need to understand the operation of its application.
You only need to understand the underlying operating system, especially the running mechanism of Rex (Run time executive.
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
Source configuration is for surf. If it is for our own board, we must configure three configuration files under the amss_cust directory, copy the files to the corresponding directory of AMSS, and re-compile the files.
Translation. 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 (aee static library), RTE (Run time
Enviroment ):
| -- CS
| -- L4
| -- Libstd
'-- RTE
L4 is a microkernel that provides address space, threads, IPC, and other functions; Component
The service provides an RTE Based on L4, providing memory protection, thread creation, synchronization, and other functions. In the past, when Qualcomm did not release brew, more system services were provided in
As added by CS, QC defines related interfaces that allow you to add the functions that RTE can provide. libstd contains the aee interface and a static aee library. rte mainly includes
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.
Things ~~ The following figure shows the architecture of AMSS platform in MSM:
Download
(23.6 KB) 3 hours ago
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 tasks here are actually our threads.
Task corresponds to a thread. Rex maintains a task
List (two-way linked list), always running 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:
Download
(95.55 KB) 1 hour ago
All AMSS tasks run in CS kernel as threads
Processes, including CS core services, all run on Rex in the form of tasks. Here, the user
Process I guess it is the class capacity in products/apps. After reading this figure, let's take a closer look at AMSS.
Source startup process: qcsbl_main_ctl will jump to L4 kernel. After L4 kernel is started, igunar will be started.
Server, and then start the Rex process (execute the main function in/service/TMC/mobile. c)
), AMSS/REX runs on L4 microkernel as a process, and 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
TMC (Task Manager
As the first task after Rex is started, the task starts all other required tasks, and calls the system functions of Rex
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.
Tasks run on Rex.
Products/76xx/services/TMC. c
The tmc_define_tasks function in determines which tasks need to be started through macro judgment, and the macro control is through products/76xx
/Build/MS/Cust *******. h and
Products/76xx/build/MS/Target ******. h to control, during compilation by configuring tsncjnlym. CMD and so on
Some compilation environment options, as well as those modules that need to be compiled, use these Cust or target header files to control which tasks will be started by the system after the system starts. Let's see
Products/76xx/services/TMC. c
The tmc_define_tasks function under can know how many tasks are supported in AMSS. All the functions in more than 4000 rows call the Rex system function.
Rex_def_task defines a task. 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.