sunflower-embedded-system-emulator icon indicating copy to clipboard operation
sunflower-embedded-system-emulator copied to clipboard

Emulator divergence compared to a Unix-like OS in the argc and argv contents of the main function of a guest binary.

Open btsouts opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? In a Unix-like (MacOs, Linux, etc.) OS in the case of command line execution of a binary, the arguments of the main function of the binary are set as follows. Argument argv[0] is the name of the binary and the rest of the argv contents are the command-line arguments of the execution. In the emulator, argv[0] contains the first command line argument and argc is decreased by one compared to the argc of the command line execution in the Unix-like OS. This can lead to inconsistencies within the guest binary source code when it uses the arguments of its main function.

Describe the solution you'd like We should change the emulator to use the convention that Unix-like operating systems use.

btsouts avatar Feb 23 '21 09:02 btsouts