Update active repository links and coordination settings while retaining upstream history, notices, legacy library names and guest interfaces. Document the independent-copy migration and its limits.
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
An original C program, tests/compat_fixtures/gate_a2.c, is built from
source with the mingw-w64 C runtime (UCRT) and run through the loader, the
standard services and the ARM64 DBT. The runtime's own startup code runs
before main; the program uses argc and argv, the heap, qsort, printf, a file
written with fprintf and read back with fgets, atexit, and a return from
main. Expected output is recomputed in Rust, not read back from a run.
Control variants end in a failed check, in exit(42) and in abort().
The test fails, and does not skip, when the compiler is missing, so the CI
workflow installs mingw-w64. Nothing from mingw-w64 is stored in the
repository.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
A program built with the mingw-w64 runtime imports fopen, fclose, fgets
and perror, and writes to the stream fopen returns with fprintf, fwrite
and fputs. The four did not resolve, and the output functions accepted
only stdout and stderr.
Adds the four services and file streams for the output functions. The
files are the ones on the in-memory C: drive behind CreateFileW, so a
file written through a C stream is the file ReadFile reads. Text mode,
the default, translates line ends as the fopen documentation describes.
Built on the standard streams from #400. Part of Gate A2.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
A program built with the mingw-w64 runtime prints through
__stdio_common_vfprintf on the stream __acrt_iob_func(1) returns, and
through fwrite, fputs, fflush and setvbuf. None resolved, and there was
nowhere for standard output to go that a host or a test could read.
Adds a formatting engine for the narrow printf family (d, i, u, o, x, X,
c, s, p and %% with their flags, width, precision and size prefixes), the
three standard streams, those six services, and capture of stdout and
stderr through ServicesState. Floating-point and wide conversions, a
locale, files and input are not modelled and stop the guest.
The engine is compared with the host C library's snprintf on 2,600
generated cases whose result ISO C defines.
Part of Gate A2.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Both engines refused SHLD and SHRD (0F A4/A5, 0F AC/AD) as illegal
instructions. They are now declared in the x86 registry and run on the
shared semantics for 16-, 32- and 64-bit register and memory
destinations, with the count in an 8-bit immediate or in CL.
- instructions.toml, x86_table.rs (generated), generate_x86.py,
x86_decode.rs: the two operations and two operand encodings,
rm_reg_imm and rm_reg_cl (ModRM destination, reg source, count).
- x86_exec.rs: the destination is shifted with the vacated bits filled
from the source register. The count is masked to five bits (six for
64-bit operands), a masked count of zero changes nothing, CF takes the
last bit shifted out, ZF/SF/PF follow the result and OF is set only
for a count of one. A 16-bit count above 16 is undefined in the SDM;
the flags are kept and no test relies on the result.
- cpu_known_answers.rs: eight SDM-derived cases move from refused to
verified.
- tests/x86: 72 assembled SHLD and SHRD instructions, with a
bit-at-a-time reference in x86_integer.rs. A destination the
reference marks undefined now skips the memory operand check too.
- docs/cpu/instruction-registry.md, CHANGELOG.md.
Nothing is lowered to ARM64.
Signed-off-by: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com>
A C program ends through the C runtime's exit, not ExitProcess, and a
program built with the mingw-w64 runtime imports exit, _exit and abort.
None resolved, so the loader refused the program before its entry point.
exit calls the functions registered with atexit and _crt_atexit, most
recently registered first, then ends the guest with ProcessExit(status).
_exit ends it with its status and abort with exit code 3; neither calls a
registered function. All three use the cleanup behind ExitProcess.
Built on the process exit from #329. Part of Gate A2.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
A program built with the mingw-w64 runtime gets argc, argv and envp for
main from __p___argc, __p___argv, __p__environ, _configure_narrow_argv
and _initialize_narrow_environment. None resolved, so the loader refused
the program before its entry point, and a host could not say what the
program's arguments are.
The five services are added to the typed registry, and
ServicesState::set_program_arguments lets a host supply argv. The
environment table is empty.
Part of Gate A2.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>