byteduck/duckOS

[BUG] Closing a window seems to produce 'illegal memory access' errors

ajh123 opened this issue · 4 comments

Information

When I close a window the system hangs and logs millions of illegal memory access errors.

Logs

$ ./qemu.sh
C:\Program Files\qemu\qemu-system-x86_64.exe: multiboot knows VBE. we don't
dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
[0.0000000] [kinit] [INFO] Starting duckOS...
[0.0000000] [CommandLine] [INFO] Command line options: 'kernel/duckk32 '
[0.0000000] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0000976] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0001952] [I8042] [WARN] Read timed out...
[0.0002928] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0003904] [I8042] [WARN] Read timed out...
[0.0003904] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0004880] [I8042] [WARN] Read timed out...
[0.0005856] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0007808] [I8042] [WARN] Read timed out...
[0.0007808] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0008784] [I8042] [WARN] Read timed out...
[0.0009760] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0010736] [I8042] [WARN] Read timed out...
[0.0011712] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0012688] [I8042] [WARN] Read timed out...
[0.0012688] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0013664] [I8042] [WARN] Read timed out...
[0.0014640] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0014640] [I8042] [WARN] Read timed out...
[0.0015616] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0016592] [I8042] [WARN] Received mouse buffer data, but no mouse device is present!
[0.0017568] [I8042] [WARN] Read timed out...
[0.0017568] [I8042] [WARN] Read timed out...
[0.0020496] [VGA] [INFO] Found a bochs-compatible VGA device at 0:2.0
[0.0029280] [PATA] [INFO] Setup disk QEMU HARDDISK using DMA (297016 blocks)
[0.0046848] [AC97] [INFO] Found AC97 sound card at 0:4.0
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
[0.0477264] init(1) [SUCCESS] Welcome to duckOS!
[0.0508496] init(1) [INFO] Starting service Pond...
[0.0516304] init(1) [INFO] Starting service Quack...
[1.0489952] pond(3) [INFO] Display opened and mapped (640 x 480)
[2.0591456] pond(3) [SUCCESS] Pond started!
[3.0652944] pond(3) [INFO] New client connected: 4b5d8bf6
[8.0277184] pond(3) [INFO] New client connected: b8292fba
[49.0300608] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0301584] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0302560] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0303536] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0304512] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0305488] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0306464] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0307440] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0308416] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0309392] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0310368] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0311344] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0312320] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0313296] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0314272] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0315248] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0316224] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0317200] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[49.0318176] [Thread] [WARN] PID 7 thread 1 made illegal memory access at 0x0 (eip: 0x0)
[..........] About a million more of the same line ...
[55.0181536] [Thread] [WARN] PID 7 thread 1 made illegal memory access

Screenshot

If applicable, insert a screenshot here.

Environment

  • Host Operating System or Machine:
    Two machines: one for building, one for running QEMU
Build Machine Run Machine
Type Raspberry Pi 4 Just a normal PC
OS RaspberryPi Os Lite 64 bit Windows 10
  • QEMU or Virtualization Software Version:
$ qemu-system-x86_64 --version
QEMU emulator version 6.1.93 (v6.2.0-rc3-11887-g72bf95f5bd-dirty)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

Only used on run machine

To Reproduce

Steps to reproduce the bug, if possible:

  1. Open any app (so far I tired the "About", "System monitor" and "Viewer" apps)
  2. Close the window
  3. The system hangs and a million lines per second are printed in the debug output.

Additional context

How I run the thing
The Raspberry Pi (build machine) is used build duckOs. The image is built successfully, even with Grub!
The kernel and duckOs.img are copied from the build machine to the run machine. (Actually, done with a Samba share on the Pi and the kernel directory is soft symbolic linked in the correct place. Then the img file is copied manually).
The same qemu.sh is placed in the directory with the disk image and kernel folder and executed like ./qemu.sh

Looks like there's some issue preventing the kernel from killing the thread despite the illegal memory access. I'll try and see if I can repro this

For me the latest commit 470e219cf2aa5c26cae6da0d45094e1a2c9cbe6c produces the error on boot, then crashes.

C:\Program Files\qemu\qemu-system-x86_64.exe: multiboot knows VBE. we don't
dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
[0.0000000] [kinit] [INFO] Starting duckOS...
[0.0000000] [CommandLine] [INFO] Command line options: 'kernel/duckk32 '
[0.0002928] [VGA] [INFO] Found a bochs-compatible VGA device at 0:2.0
[0.0011712] [PATA] [INFO] Setup disk QEMU HARDDISK using DMA (1994016 blocks)
[0.0037088] [AC97] [INFO] Found AC97 sound card at 0:4.0
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
[0.0000000] [kinit] [INFO] Starting duckOS...
[0.0000000] [CommandLine] [INFO] Command line options: 'kernel/duckk32 '
[0.0002928] [VGA] [INFO] Found a bochs-compatible VGA device at 0:2.0
[0.0013664] [PATA] [INFO] Setup disk QEMU HARDDISK using DMA (1994016 blocks)
[0.0030256] [AC97] [INFO] Found AC97 sound card at 0:4.0
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.pi'
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `ac97.mc'
[0.0470432] init(1) [SUCCESS] Welcome to duckOS!
[0.0509472] init(1) [INFO] Starting service Pond...
[0.0516304] init(1) [INFO] Starting service Quack...
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/kstd/bits/RefCount.cpp at line 52
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/kstd/bits/RefCount.cpp at line 52
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/kstd/bits/RefCount.cpp at line 52
[0.0535824] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x11e710c0 (eip: 0x11e710c0)
[0.0536800] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x4 (eip: 0x4)
[0.0537776] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0538752] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0539728] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0540704] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0541680] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0542656] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0543632] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0544608] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0545584] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0546560] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0547536] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0548512] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0549488] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0550464] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0551440] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0552416] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0553392] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0554368] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0555344] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0556320] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0557296] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0558272] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0559248] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0560224] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0561200] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0562176] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0563152] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0564128] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0565104] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0566080] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0567056] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0568032] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0569008] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0569984] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0570960] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0571936] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0572912] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0573888] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0574864] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0575840] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0576816] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0577792] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0578768] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0579744] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0580720] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0581696] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0582672] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0583648] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0584624] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0585600] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0586576] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0587552] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0588528] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0589504] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0590480] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0591456] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0592432] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0593408] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0594384] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0595360] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0596336] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0597312] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0598288] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0599264] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0600240] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0601216] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0602192] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0603168] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0604144] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0605120] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0606096] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0607072] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0608048] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0609024] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0610000] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0610976] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0611952] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0612928] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0613904] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0614880] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0615856] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0616832] [Thread] [WARN] PID 5 thread 1 made illegal memory access at 0x286 (eip: 0x286)
[0.0618784] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x4 (eip: 0x4)
[0.0619760] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0620736] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0621712] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0622688] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0623664] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0624640] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0625616] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0626592] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0627568] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0628544] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0629520] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0630496] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0631472] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0632448] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0633424] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0634400] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0635376] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0636352] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0637328] [Thread] [WARN] PID 4 thread 1 made illegal memory access at 0x282 (eip: 0x282)
[0.0639280] [Process] [WARN] PID 5[0.0640256] [Process] [WARN] PID 5 exiting[0[0.0642208] [Process] [WARN] PID 5 exiting with fatal signal SIGSEGV[0.0643184] [Process] [WARN] PID 5 exiting with fatal signal SIGSEGV[0.0644160] [Process] [WARN] PID 5 exiting with fatal signal SIGSEGV
m

[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
[kernel] CRITICAL: Assertion failed: /home/pi/projects/duckOS/kernel/tasking/TaskManager.cpp at line 242
...

How can I check that the QEMU on my Windows machine even supports the AC97 sound?

For me the latest commit 470e219cf2aa5c26cae6da0d45094e1a2c9cbe6c produces the error on boot, then crashes.

The latest commits are pretty unstable - I'm trying to increase stability within the kernel by tweaking locking and context switching, but the refactoring I'm doing isn't quite ready yet.

How can I check that the QEMU on my Windows machine even supports the AC97 sound?

I'm not super familiar with the workings of QEMU on Windows, but it looks like it's using DirectSound. Maybe see if there's a newer version of QEMU available? Either way, it should support AC97 hardware emulation since it's all done in software.

Latest commit should be a lot more stable - realized I wasn't preserving the string registers (esi/edi) and flags register in the kernel during context switching. And, depending on what the kernel was in the middle of doing during preemption, it could definitely screw things up. I also fixed a few race conditions and bits of logic with context switching, and it seems to be a lot more stable now!