updated ARCHITECTURE files · qilingframework/qiling@e1dafd3 · GitHub
Skip to content

Commit e1dafd3

Browse files
committed
updated ARCHITECTURE files
1 parent 09fb5fb commit e1dafd3

19 files changed

Lines changed: 81 additions & 47 deletions

‎ARCHITECTURE.md‎

Lines changed: 3 additions & 1 deletion

‎ARCHITECTURE/AGENT_RULES.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# Agent Rules

‎ARCHITECTURE/indexes/firmware.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# Firmware Routes

‎ARCHITECTURE/indexes/operating-systems.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# Operating System Routes

‎ARCHITECTURE/indexes/runtime.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# Runtime Routes

‎ARCHITECTURE/modules/arch.md‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# CPU Architecture and Calling Conventions
@@ -21,7 +21,7 @@ or cross-platform compatibility certification.
2121
| --- | --- |
2222
| [arch/arch.py](../../qiling/arch/arch.py): `QlArch` | CPU, pointer width, stack, context interface |
2323
| [arch/register.py](../../qiling/arch/register.py): `QlRegisterManager` | Name-to-Unicorn registers and PC/SP aliases |
24-
| [arch/](../../qiling/arch/), [arch/models.py](../../qiling/arch/models.py) | Concrete x86/ARM/MIPS/RISC-V/PPC/Cortex-M adapters and CPU enums |
24+
| [arch/](../../qiling/arch/), [arch/models.py](../../qiling/arch/models.py), `*_const.py` | Concrete x86/ARM/MIPS/RISC-V/PPC/Cortex-M adapters, CPU enums, register maps and `EXCP` exception codes |
2525
| [cc/__init__.py](../../qiling/cc/__init__.py): `QlCC`, `QlCommonBaseCC` | Register/stack slots, result, return address, frame unwind |
2626
| [arch/cortex_m.py](../../qiling/arch/cortex_m.py): `QlArchCORTEX_M` | Exception/vector state and task-aware Unicorn |
2727
| [test_cpu_models.py](../../tests/test_cpu_models.py), [test_riscv.py](../../tests/test_riscv.py), [test_shellcode.py](../../tests/test_shellcode.py) | Model selection and instruction/ABI samples |
@@ -43,8 +43,13 @@ versions come from the root manifest, not individual adapters.
4343
multiword arguments, shadow space, register exhaustion, stack return
4444
addresses and unwind rules differ (`cc/__init__.py`, `cc/intel.py`).
4545
- Endianness, CPU mode and Thumb PC handling affect execution and instruction
46-
decoding. Preserve `effective_pc` and Cortex-M exception return behavior
47-
when changing ARM mode; inspect the core Thumb workaround too.
46+
decoding. Preserve the ARM adapter's `effective_pc` (consumers fall back
47+
to `arch_pc` via `getattr`) and Cortex-M exception return behavior when
48+
changing ARM mode; inspect the core Thumb workaround too.
49+
- Interrupt numbers delivered to `hook_intno` are QEMU exception codes.
50+
**Observed:** ARM/ARM64 and MIPS Linux traps use the `EXCP` enums in
51+
`cortex_m_const.py` and `mips_const.py`; x86/RISC-V/PPC still pass
52+
literals. Prefer an existing enum and extend it for new codes.
4853
- Concrete adapters instantiate engine/assembler/disassembler objects;
4954
supported enums do not imply support for every OS/CPU combination.
5055
Cortex-M uses `MultiTaskUnicorn` and hardware interrupt state.
@@ -73,8 +78,9 @@ never substitute host pointer size for a guest ABI.
7378

7479
From `tests/`: `python -m unittest test_cpu_models test_riscv test_shellcode`
7580
with root dependencies and relevant rootfs samples. All selected modules
76-
passed during rebuild; CPU-model suite has 7 tests. Their scope is selected
77-
models/instructions and guest execution, not instruction-set conformance.
81+
passed during the latest refresh (11 CPU-model/RISC-V and 8 shellcode
82+
cases). Their scope is selected models/instructions and guest execution,
83+
not instruction-set conformance.
7884
For PPC changes use `test_elf.ELFTest.test_elf_linux_powerpc`; for ABI changes
7985
run the consuming OS API/syscall regression as well.
8086

‎ARCHITECTURE/modules/baremetal.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# Bare-metal Execution
@@ -71,16 +71,17 @@ semantics into unrelated POSIX/Windows run loops.
7171
## Verification
7272

7373
From `tests/`: `python -m unittest test_mcu.MCUTest.test_mcu_snapshot_stm32f411 test_mcu.MCUTest.test_mcu_usart_input_stm32f411 test_blob.BlobTest.test_uboot_arm`
74-
passed 3 cases during rebuild. Root dependencies and matching STM32/U-Boot
75-
fixtures are required. Run `python test_mcu.py` for broader device/timing
74+
passed 3 cases during the latest refresh. Root dependencies and matching
75+
STM32/U-Boot fixtures are required. Run `python test_mcu.py` for broader device/timing
7676
changes and `python test_blob.py` for raw behavior; the full suites are not
7777
certified by the selected cases.
7878

7979
## Known Gaps
8080

8181
`test_blob.BlobTest.test_blob_raw` fails because rootfs lacks
8282
`blob/example_raw.bin`; [fixture source](../../examples/src/blob/Makefile)
83-
exists but was not built or copied into the submodule during this rebuild.
83+
exists but is not built or copied into the submodule; the case still
84+
errors with a missing-file error.
8485
Fast-mode faults currently stop cleanly instead of delivering hardware
8586
HardFault. Timeout units differ by execution path; full scheduler timing
8687
and MCU exception fidelity remain unverified.

‎ARCHITECTURE/modules/cli-build.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# CLI, Packaging and Development Tooling
@@ -95,10 +95,12 @@ CLI/version/profile behavior and TUI import outside the checkout. For
9595
checkout behavior from `tests/`: `python test_qltool.py`; rootfs samples
9696
are required for argument, JSON, filter and coverage cases.
9797

98-
Rebuild evidence: sdist plus wheel-from-sdist build passed, artifact metadata
99-
checks and `poetry check --lock` passed, 8 selected CLI tests passed, and 3 installed-wheel cases
100-
passed in a second fresh environment. See [root verification](../../ARCHITECTURE.md#verification)
101-
for common setup and Linux aggregate. No configured lint/type-check command exists.
98+
Latest refresh evidence: sdist plus wheel-from-sdist build, `twine check
99+
--strict` and `poetry check --lock` passed; 5 checkout CLI cases and 3
100+
installed-wheel cases passed in a second fresh environment; the wheel
101+
contains `qltui.py`, the 7 profiles and 43 GDB XML files. See
102+
[root verification](../../ARCHITECTURE.md#verification) for common setup
103+
and Linux aggregate. No configured lint/type-check command exists.
102104

103105
## Known Gaps
104106

‎ARCHITECTURE/modules/core.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
eatmycode_version: "2.0.0"
2+
eatmycode_version: "2.1.0"
33
---
44

55
# Core Runtime
@@ -45,6 +45,9 @@ by `hookcallback` and re-raised by `emu_start`, not silently consumed.
4545
- Factories derive modules/class names from enums with explicit format/arch
4646
mappings. A new enum alone is insufficient (`utils.py`). Hook callback
4747
signatures and `QL_HOOK_BLOCK` behavior must survive dispatcher changes.
48+
Interrupt, memory-fault and invalid-instruction events that no hook
49+
handles raise `QlErrorCoreHook` (`core_hooks.py`); OS personalities
50+
choose which interrupt numbers they hook.
4851
- Profiles use defaults plus OS/user overrides; MCU uses YAML-derived maps
4952
(`profile_setup`). Parsing belongs here; the consumer owns each key.
5053
- `save` includes only selected components. `restore` applies only included
@@ -80,7 +83,8 @@ not a claim that the tree is an acyclic import graph.
8083

8184
From `tests/`, after root setup: `python -m unittest test_shellcode`;
8285
`python -m unittest test_elf.ELFTest.test_memory_search` checks memory-facing
83-
facade behavior. Both passed during rebuild on Linux/Python 3.13/Unicorn 2.1.3.
86+
facade behavior. Both passed during the latest refresh on Linux/Python
87+
3.13/Unicorn 2.1.3.
8488
For snapshot changes use matching cases in `test_elf.py` and
8589
`test_mcu.MCUTest.test_mcu_snapshot_stm32f411` (the MCU case also passed).
8690
Fixtures are relative to `tests/`. Passing these does not certify every

‎ARCHITECTURE/modules/debugger.md‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)