-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial is broken #86
Comments
Attempting to use a unix socket in WSL appears to have the same issue. I'm not sure this is specific to Windows any longer. Someone on a Linux desktop should check with a real port and sockets. |
Able to confirm on Linux by launching with |
With the proposed fix in #96 xemu no longer crashes on init, however it does lockup and freeze if you attach WinDbg to it using real ports. |
What happens when you use: |
That works (although not like you can read the kernel output), serial ports work as well until something connects to it. I would really consider this a separate issue (specific to Windows like the original issue). |
I'm able to get kernel output from xbox-linux with |
I'm positive that would work (on Windows), my specific issue was with Xbox kernel output. |
I had exactly same problem while trying to debug ReactOS Xbox port with WinDbg using COM ports. |
With QEMU, I'm able to write to the Linux console via Maybe WinDbg is trying to write something to the port & expecting a response, but simply connecting should unblock execution. |
In the initial issue I thought this was originally a legacy issue - however it seems to have evolved. @binarymaster can you try with XQEMU and see if this is infact a legacy problem? I'd be fine with #96 being merged as there is a real problem not being able to use ports in both OS's but not closing this. |
PR #96 is now a draft, since I was able to write to the Linux console by removing all the serial init stuff out of (or simply by not using) diff --git a/hw/xbox/xbox.c b/hw/xbox/xbox.c
index 8042026a0f..715f57f945 100644
--- a/hw/xbox/xbox.c
+++ b/hw/xbox/xbox.c
@@ -34,6 +34,7 @@
#include "kvm_i386.h"
#include "hw/kvm/clock.h"
#include "hw/dma/i8257.h"
+#include "hw/char/serial.h"
#include "hw/sysbus.h"
#include "sysemu/arch_init.h"
@@ -300,6 +301,8 @@ void xbox_init_common(MachineState *machine,
pcspk_init(pcms->pcspk, isa_bus, pit);
+ serial_hds_isa_init(isa_bus, 0, 1);
+
PCIDevice *dev = pci_create_simple(pci_bus, PCI_DEVFN(9, 0), "piix3-ide");
pci_ide_create_devs(dev);
// idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); Unfortunately, this is not the right solution since IRQ 4 is used by NIC & IRQ 3 is used by GPU. It's not possible to reassign these interrupts as they're most likely hardcoded in hardware. The IRQ number for |
In fact, I tested it some time ago with XQEMU, so I can confirm it's a legacy problem, which deserves a separate issue probably. |
I was able to break out This pin is not usable as far as I know ( Here's a list of hardcoded IRQs that are used:
I'll need to see how xbdm handles serial without a dedicated IRQ, unless it does use NIC IRQ. This previous convo seems relevant:
|
It doesn't seem to use that pin? Not sure. https://github.com/XboxDev/serial-usb-adapter/blob/master/images/schematic.png |
What I'm not sure on is how a debug Xbox kernel or xbdm handles input from serial without an IRQ. Maybe it does use IRQ 4 & conflicts with NIC, giving the behavior that JayFoxRox mentioned above. Just need to be sure for this PR. Maybe serial can work for output only by not setting an IRQ (0 to disable as in the |
PR #96 is now updated. It includes a Writing to the Linux console still works, with IRQ 4, set by Cromwell. My debug Xbox kernel initializes with |
Same situation where when it's connected to WinDbg xemu freezes/crashes. |
I added a serial port IRQ menu option to the Peripherals menu in PR XboxDev/cromwell#49 so that the NIC IRQ 4 conflict can be toggled on or off. This PR also works with PR #96. |
Is this related with xbox-linux? Happens when launching Linux from Cromwell. I didn't enable serial in both command line or in cromwell so idk.
|
Yes. That's Linux enumerating all the PCI devices. This should be fixed in #95: |
Fixed by #96 |
QEMU 5.1 both 32bit and 64bit are able to use the ports correctly without crashing - I assume it's something to do with the custom backend? Not sure. Issue happens with both elevated and not.
In the gif I was using a retail kernel however it makes no difference using a real debug or hacked kernel.
Launched with:
.\xemu.exe -device lpc47m157 -serial COM1
Version:
2702f45
The text was updated successfully, but these errors were encountered: