I learned about the Linux kernel in the last two days. I have benefited a lot from reading Dr. Zhao's "Linux kernel complete notes. Today, I saw Chapter 3 embedded in the assembly part, so I wrote a small program to test it and compiled it with gcc. The Code is as follows:
# Include <stdio. h> <stdlib. h> <. h> ** StrCopy (array * a1, array * register *, a1->, a2-> (a1-> size> a2-> chlist = (*) malloc (a1-> size * (-> size = a1-> :( a2-> chlist), (a1-> chlist ), (a1-> main (* = l2.chlist = l2.size = strlen (l1.chlist) + str = StrCopy (& l1 ,&
This function allows you to copy strings.
At the beginning, the last line of the assembly part is written as follows:
:,,,
Compilation error:
StrCopy. c ::: error: can't find a register 'creg': Error: 'asm 'contains impossible constraints in the operand
After checking the cause on the internet, I learned from a blog post that "edi", "esi", "ecx" has been provided in the input list and will be given again in the modified register list, gcc reports an error. Modified and compiled.