Comments (5)
Hey!
Unfortunately, the remote memory in the configurable machine is not supported for the i386 target.
You can partially add the support with the patch below. However, it will still not work, the gdbstub complains he does not find any CPU: qemu-system-i386: -gdb tcp::3333: gdbstub: meaningless to attach gdb to a machine without any CPU.
I will check this tomorrow.
diff --git a/hw/avatar/meson.build b/hw/avatar/meson.build
index a42b1429c6..1e59604165 100644
--- a/hw/avatar/meson.build
+++ b/hw/avatar/meson.build
@@ -17,6 +17,10 @@ specific_ss.add(when: ['CONFIG_AVATAR', 'TARGET_MIPS'], if_true: files(
'avatar_posix.c',
'remote_memory.c'
))
-specific_ss.add(when: ['CONFIG_AVATAR', 'TARGET_I386'], if_true: files('configurable_machine.c'))
+specific_ss.add(when: ['CONFIG_AVATAR', 'TARGET_I386'], if_true: files(
+ 'configurable_machine.c',
+ 'avatar_posix.c',
+ 'remote_memory.c'
+))
specific_ss.add(when: ['CONFIG_AVATAR', 'TARGET_X86_64'], if_true: files('configurable_machine.c'))
specific_ss.add(when: ['CONFIG_AVATAR', 'TARGET_PPC'], if_true: files('configurable_machine.c'))
diff --git a/hw/avatar/remote_memory.c b/hw/avatar/remote_memory.c
index ba74a5f5ee..f0581645a8 100644
--- a/hw/avatar/remote_memory.c
+++ b/hw/avatar/remote_memory.c
@@ -14,8 +14,6 @@
#ifdef TARGET_ARM
#include "target/arm/cpu.h"
-#elif TARGET_MIPS
- //
#endif
@@ -26,8 +24,6 @@ uint64_t get_current_pc(void){
#ifdef TARGET_ARM
ARMCPU *cpu = ARM_CPU(qemu_get_cpu(0));
return cpu->env.regs[15];
-#elif TARGET_MIPS
- return 0; /* implement me */
#endif
return 0;
}
from avatar2.
Yay!
Many thanks for the quick reply and the patch. :)
Indeed, I stumbled on the "no cpu" error too. I'm currently digging in the source code to try and spot what could be the issue with no luck for now.
I guess you'll be more efficient than me but I'll keep you posted if I find a fix.
Have a good day!
from avatar2.
So, for the record, I quick fixed it with the following patch and it seems to work (I haven't tested it extensively though and I'm definitely not sure about the hardcoded apic-id value)...
diff --git a/hw/avatar/configurable_machine.c b/hw/avatar/configurable_machine.c
index a22ec11259..4cc18c1fb6 100644
--- a/hw/avatar/configurable_machine.c
+++ b/hw/avatar/configurable_machine.c
@@ -495,10 +495,7 @@ static THISCPU *create_cpu(MachineState * ms, QDict *conf)
BusState* sysbus = sysbus_get_default();
int num_irq = 64;
-#elif defined(TARGET_I386)
- //
-
-#elif defined(TARGET_MIPS)
+#elif defined(TARGET_I386) || defined(TARGET_MIPS)
Error *err = NULL;
#endif /* TARGET_ARM && ! TARGET_AARCH64 */
@@ -562,6 +559,18 @@ static THISCPU *create_cpu(MachineState * ms, QDict *conf)
device_legacy_reset(cpuu->apic_state);
}
+ if (!object_property_set_uint(OBJECT(cpuu), "apic-id", 0, &err)) {
+ error_report_err(err);
+ object_unref(OBJECT(cpuu));
+ exit(EXIT_FAILURE);
+ }
+
+ if (!qdev_realize(DEVICE(cpuu), NULL, &err)) {
+ error_report_err(err);
+ object_unref(OBJECT(cpuu));
+ exit(EXIT_FAILURE);
+ }
+
#elif defined(TARGET_MIPS)
cpu_oc = cpu_class_by_name(TYPE_MIPS_CPU, cpu_type);
if (!cpu_oc) {
from avatar2.
This seems correct. I suppose the apic-id would become an issue in case of creating multiple CPU.
That would be nice to create a PR on the avatar-qemu
repo, otherwise I can also do it :)
(Also, I updated the tests/test_qemutarget.py
for this target, I will push it later)
Thanks for your contribution!
from avatar2.
Sure, I'll do it tomorrow. :)
Also, just to let you know, I may have stumbled on two additional issues that could still block the proper functioning of this target: for now the entry_address
is not correctly taken into account by the cpu during its initialization and memory regions created with memory_region_init_ram
don't seem to be writable. I'm currently investigating the root causes and will do a PR if I manage to fix them.
from avatar2.
Related Issues (20)
- RemoteMemoryRead failed: Failed to read memory!
- Exception: GDBProtocol was unable to connect HOT 4
- Installer has invalid references to GitHub repos HOT 2
- Is it possible to dynamically analyse the firmware of a ESP32 just with the default avatar2 tools? HOT 4
- avatar2/handbook/0x03_memory.md/Avatar² Peripheral Emulation Ranges HOT 20
- A naive question: what means rcc dump HOT 1
- Stuck when openocd_target try to wait HOT 2
- RecursionError: maximum recursion depth exceeded in comparison HOT 2
- geting to halt state when transfer state from QemuTarget to gdbTarget
- How to deal with interrupt (NVIC) HOT 2
- avatar.CRITICAL | No Memory range specified at 0x400008
- qemu-system-arm, configurable does not work with cpu_model=cortex-m4 HOT 7
- questions regarding gdbstub, SerialICE and avatar[one] HOT 2
- Failure to check for qemu failure at startup HOT 2
- query: per-opcode filters/logging? HOT 2
- AvatarPeripheral: pci/pcie devices
- How to implement an Android Emulator target? HOT 7
- avatar2/handbook/0x03_memory.md Qemu Properties dict possible types and values details HOT 1
- Does avatar2 support Unicorn emulator? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avatar2.