'What does this i386 os code mean? The code is for resetting the system
/* jump to reset vector. esp := 0 */
int main(int argc, char **argv) {
PRINT("reset\n");
_eflags = 0; // interrupt disabled
__asm__ __volatile__ ("\
mov $0x0, %%esp;\
jmp *%0"
:: "r"(_vector[0]));
/* never return here */
return 0;
}
This is i386 os code, and I have difficulty understanding it. What does the code below mean? Especially I want to know what is "r"(_vector[0]).
__asm__ __volatile__ ("\
mov $0x0, %%esp;\
jmp *%0"
:: "r"(_vector[0]));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|