What happens on “fork” ?[2]

Before analyze the p_1.log, we firstly talk about the clone.(Actually on linux that fork is implemented as clone, so we focus on clone system call.)

“clone” selectively clone the resources from parent, let us list the main resources belong to one process.

struct task_struct {
...
        struct mm_struct *mm, *active_mm; /*CLONE_VM*/
...
        struct fs_struct *fs;/*CLONE_FS*/
...
        struct files_struct *files;/*CLONE_FILES*/
...
        struct signal_struct *signal;
        struct sighand_struct *sighand;/*CLONE_SIGHAND*/
...
        struct io_context *io_context;/*CLONE_IO*/
...
        struct nsproxy *nsproxy;/*CLONE_NEWNS*/
...
        struct sysv_sem sysvsem;/*CLONE_SYSVSEM*/
...
        struct thread_struct thread;
...

}

What happens on “fork” ?[1]

Let’s firstly see one program p_1.c:

#include
#include
#include

int main(int argc, char * argv[])
{
        pid_t pid;
        pid = fork();

        if (pid > 0)
                printf("Child pid = %d ! \n", pid);
        else if (!pid)
                printf("I was born!\n");
        else if (-1 == pid)
                perror("fork");

        return 0;
}

Next, we compile it and trace it as below:
gcc -o p_1 p_1.c
strace -o p_1.log ./p_1

MIPI HSI (High Speed Interface) Introduction

As spec said:

HSI is an interface designed to connect an application die to a cellular modem die in cellular handsets, but also can be used for other purposes. HSI provides a multi-processor (or more broadly said on-chip-interconnect) low-latency communication channel over a die-to-die link by dividing the physical link to logical channels at the hardware level. HSI enables versatile, easy and simple serial link realizations. As such, HSI can reduce time-to-market and design cost of mobile handsets by simplifying serial die-to-die physical layer implementations.

It mainly have 4 lines: DATA, FLAG, READY, WAKE.

 Bit transmission in both directions occurs over a two-wire (DATA+FLAG) serial interface.

The READY-signal indicates that the transmission of a new physical layer frame can begin.

The WAKE-signal is used to indicate to the receiver that the transmitter is willing to start a transmission.

The MIPI HSI interface has two different modes – a Stream mode and a Frame mode.

Continue…