vivier / qemu-m68k

Other
40 stars 6 forks source link

Serial console no longer works with Quadra 800 emulation #41

Closed glaubitz closed 4 years ago

glaubitz commented 4 years ago

I'm currently writing a small guide on how to install and set up Debian/m68k on qemu-system-m68k from the q800-dev branch but I'm having trouble to get a working serial console.

I have an older git snapshot installation where the serial console works fine but now the kernel messages stop once the kernel tries to initialize ttyS0.

Link to the the current guide I created on the Debian wiki: https://wiki.debian.org/M68k/QemuSystemM68k

vivier commented 4 years ago

There are two console ports on the Macintosh (printer and modem). I generally uses the second port, for instance "-serial none -serial stdout". There was no change in this area for a long time now. Perhaps the problem comes from some changes in the kernel?

glaubitz commented 4 years ago

Hmm, you're right. It seems to be an issue with the kernel in question. I will build an updated installation image with the 5.2.0 kernel and report back if that fixes it.

baryluk commented 4 years ago

Hi,

I was just trying to use John's guide, and indeed it is stuck at initializing serial port / console:

user@debian:~/qemu-m68k/system$ /usr/local/bin/qemu-system-m68k -M q800 -serial none -serial mon:stdio -m 1000M -drive file=m68k-system.img,format=qcow2 -drive file=m68k-swap.img,format=qcow2 -net nic,model=dp83932,addr=08:00:07:12:34:89 -net user -nographic -append "root=/dev/ram rw console=ttyS0" -cdrom debian-10.0-m68k-NETINST-1.iso -kernel vmlinux-4.19.0-5-m68k -initrd initrd.gz

ABCFGHIJK
[    0.000000] Linux version 4.19.0-5-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-7)) #1 Debian 4.19.37-5 (2019-06-19)
[    0.000000] Detected Macintosh model: 35
[    0.000000] Apple Macintosh Quadra 800
[    0.000000] initrd: 3df4f000 - 3e7ff5b3
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 253500
[    0.000000] Kernel command line: root=/dev/ram rw console=ttyS0
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 998744K/1024000K available (2870K kernel code, 399K rwdata, 1004K rodata, 156K init, 202K bss, 25256K reserved, 0K cma-reserved)
[    0.000000] random: get_random_u32 called from __kmem_cache_create+0x2c/0x498 with crng_init=0
[    0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=8
[    0.000000] NR_IRQS: 200
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [ttyS0] enabled

and qemu process is using 100%, sometimes 133% of CPU when it is stuck there and spinning on ppoll timeouts:

strace -f capture:

[pid  2682] ppoll([{fd=0, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 5, {tv_sec=0, tv_nsec=0}, NULL, 8) = 0 (Timeout)
[pid  2682] ppoll([{fd=0, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 5, {tv_sec=0, tv_nsec=19951289}, NULL, 8) = 0 (Timeout)
[pid  2682] ppoll([{fd=0, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 5, {tv_sec=0, tv_nsec=0}, NULL, 8) = 0 (Timeout)
glaubitz commented 4 years ago

I have run into this issue and it's most likely a problem with the kernel. I will provide an updated installation image later today. Sorry for the inconvenience.

baryluk commented 4 years ago

I have run into this issue and it's most likely a problem with the kernel. I will provide an updated installation image later today. Sorry for the inconvenience.

No worries at all! Nothing to apologize for either. Hopefully tho Debian m68k port could have some form of CI in place in the future to track kernel builds and qemu build regressions.

vivier commented 4 years ago

There are several problems with the version you test:

1- 100% CPU usage: the rebase on MOS6522 of VIA has introduced a lot of timer interrupts that fill the CPU with unneeded work 2- some recent kernels have changed the memory mapping, so SWIM driver crashes the kernel

They should be fixed in the latest q800-dev branch.

Perhaps there are more problems, don't hesitate to report them.

vivier commented 4 years ago

Someone has reported to me that kernel with the new clocksource driver also hangs after the "printk: console [tty0] enabled" . I need to investigate.

vivier commented 4 years ago

Someone has reported to me that kernel with the new clocksource driver also hangs after the "printk: console [tty0] enabled" . I need to investigate.

It's fixed now in q800-dev

glaubitz commented 4 years ago

Ah, great, thank you. I also just created a fresh image but I haven't that yet:

https://cdimage.debian.org/cdimage/ports/2019-10-24/debian-10.0-m68k-NETINST-1.iso

glaubitz commented 4 years ago

Guide now works as expected and leads to a fully usable system: https://wiki.debian.org/M68k/QemuSystemM68k

baryluk commented 4 years ago

Confirmed. It does work now with f8ea358fc6334ef1a23842b39842d27f3d87bb45 and 931a4a3abb4516cb28bce42db7be2487fbc1fc1a .

System booted and installed without issues.

@glaubitz I did minor updates to the guide, by fixing formatting and using ./mnt, instead of using /mnt. I will probably improve it further later by using sudo for mount/umount, or even better use guestfstools or maybe udevil to copy extra stuff from iso file without needing to use mount -t iso9660.

glaubitz commented 4 years ago

Thanks. Appreciate the help! I guess we can close this now.

glaubitz commented 4 years ago

@glaubitz I did minor updates to the guide, by fixing formatting and using ./mnt, instead of using /mnt.

I'm not sure why you removed the command prompt. It makes it less readable to me. Also, "/mnt" exists per default on every Debian system. I'm not sure why one shouldn't use it.

I will probably improve it further later by using sudo for mount/umount, or even better use guestfstools or maybe udevil to copy extra stuff from iso file without needing to use mount -t iso9660.

I think you are overcomplicating things. Running this as root is perfectly fine.

After looking at these changes, I'm not sure I agree with them.

baryluk commented 4 years ago

I'm not sure why you removed the command prompt. It makes it less readable to me.

I didn't remove any command prompts, I made them more visible. Rest is more of your own personal opinion, to which I don't agree at all. Not to mention my changes actually did fix few bugs and issues with your entries. Now they are gone.

I guess, I will remove my wiki account. No point contributing or improving it. No wonder Debian wiki is so bad overall compared to almost every other distro.