etc:users:jcmvbkbc:little-things:2
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
etc:users:jcmvbkbc:little-things:2 [2009/12/22 22:51] – создано jcmvbkbc | etc:users:jcmvbkbc:little-things:2 [2016/08/08 20:53] (current) – ↷ Page moved from users:jcmvbkbc:little-things:2 to etc:users:jcmvbkbc:little-things:2 kel | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== Plan ===== | ===== Plan ===== | ||
* See how PC platform is initialized | * See how PC platform is initialized | ||
- | * Drag 8529 and IOAPIC interfaces to the reachability of monitor | + | * Drag 8259 and IOAPIC interfaces to the reachability of monitor |
- | * Add monitor commands to trigger IRQ through | + | * Add monitor commands to trigger IRQ through |
* See how it works | * See how it works | ||
+ | |||
+ | |||
===== Worklog ===== | ===== Worklog ===== | ||
- | | + | |
+ | < | ||
+ | diff -burp qemu-0.10.5-orig/ | ||
+ | --- qemu-0.10.5-orig/ | ||
+ | +++ qemu-0.10.5/ | ||
+ | @@ -1550,6 +1562,8 @@ static const term_cmd_t term_cmds[] = { | ||
+ | #if defined(TARGET_I386) | ||
+ | { " | ||
+ | " | ||
+ | + { " | ||
+ | + "cpu irq", " | ||
+ | # | ||
+ | { " | ||
+ | " | ||
+ | </ | ||
+ | * see that there' | ||
+ | * see how 8259 is initialized in hw/pc.c | ||
+ | * see there how IRQs are dispatched: through qemu_irq structures | ||
+ | * see how generic IRQ is invoked: hw/irq.h (qemu_irq_*) | ||
+ | * put i8259 field into CPUX86State: | ||
+ | < | ||
+ | diff -burp qemu-0.10.5-orig/ | ||
+ | --- qemu-0.10.5-orig/ | ||
+ | +++ qemu-0.10.5/ | ||
+ | @@ -963,6 +963,7 @@ vga_bios_error: | ||
+ | |||
+ | | ||
+ | i8259 = i8259_init(cpu_irq[0]); | ||
+ | + env-> | ||
+ | | ||
+ | |||
+ | if (pci_enabled) { | ||
+ | diff -burp qemu-0.10.5-orig/ | ||
+ | --- qemu-0.10.5-orig/ | ||
+ | +++ qemu-0.10.5/ | ||
+ | @@ -670,6 +670,7 @@ typedef struct CPUX86State { | ||
+ | /* in order to simplify APIC support, we leave this pointer to the | ||
+ | user */ | ||
+ | | ||
+ | + void *i8259; | ||
+ | } CPUX86State; | ||
+ | |||
+ | | ||
+ | </ | ||
+ | * use it in handler: | ||
+ | < | ||
+ | diff -burp qemu-0.10.5-orig/ | ||
+ | --- qemu-0.10.5-orig/ | ||
+ | +++ qemu-0.10.5/ | ||
+ | @@ -1441,6 +1441,18 @@ static void do_inject_nmi(int cpu_index) | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | + | ||
+ | +static void do_inject_irq(int cpu_index, int irq) | ||
+ | +{ | ||
+ | + CPUState *env; | ||
+ | + | ||
+ | + for (env = first_cpu; env != NULL; env = env-> | ||
+ | + if (env-> | ||
+ | + if (irq >= 0 && irq < 16) | ||
+ | + qemu_irq_pulse(((qemu_irq*)env-> | ||
+ | + break; | ||
+ | + } | ||
+ | +} | ||
+ | # | ||
+ | |||
+ | | ||
+ | </ | ||
+ | * load 2009-12-21 bzImage into this qemu (qemu -kernel bzImage -monitor stdio), insmod test.ko test_irq_no=5, | ||
+ | |||
+ | Code: ftp:// | ||
+ | |||
+ | ===== Conclusion ===== | ||
+ | * qemu pc platform have self-contained design, hard to expose internal details to some generic debug monitor; | ||
+ | * not clear, how e.g. PCI interrupts are routed to CPUs; | ||
+ | * would be nice to implement PCI device emulation, with full configuration/ | ||
+ | |||
+ | {{tag> |
etc/users/jcmvbkbc/little-things/2.1261511501.txt.gz · Last modified: 2009/12/22 22:51 by jcmvbkbc