Operating System debugger for Ubuntu 11.10 - debugging

I've been doing operating system development (not building a Linux kernel), and have gotten to the point where I need a debugger, for my latest OS. I've tried Bochs (under my Win 7 partition), but that wouldn't recognize my USB (It's unformatted, I'm reading specific sectors right now.) and I would rather do something under Ubuntu 11.10.
Is there a Debugger that would let me debug a custom build OS for Ubuntu 11.10?

Personally, I use QEMU for debugging a custom OS (which has USB support).
Run QEMU as follows for a debugging session:
qemu -S -s [more options here]
-S tells QEMU to not start the cpu. This gives you time to set breakpoints etc.
-s is a shortcut for -gdb tcp::1234 which start a gdbserver at TCP port 1234.
Then connect GDB to QEMU:
$ gdb
(gdb) target remote localhost:1234
From that point, you can use the normal GDB commands.

Related

sshfs hangs terminal on brand new Mac M1

Brand new Mac (OS 12.0.1, M1 chipset) sshfs and Fuse installed from https://osxfuse.github.io. I do:
sudo sshfs -d mayacc#myhost.com:/home/myacc ~/mnt
The terminal hangs, can't ^C the process.
It works fine on my Intel Mac.
Any ideas what I've done wrong?
The hang is because the user mode component of SSHfs (the one the driver in the kernel calls out) hangs, and because the driver is blocked your process is stuck in an uninterruptible state (wherein it won't respond to signals, which your ^C is (SIGINT)).
It's not necessarily an Intel vs. M1 issue. It might be as simple as a connectivity issue between your M1 and (your)host.com. (there's very little info in your question to deduce what the problem is, but I'd suggest check the full stack, from basic ping, through TCP 22, through ssh keys in your ~/.ssh folder)

Qemu Sparc64 emulation - keyboard doesn't work (Windows, Ubuntu host tested)

people
I need to run sparc64 emulator in order to install Solaris 10 for sparc64. I tried to run it on following hosts:
Windows 10 Professional
Windows 10 Enterprise
Windows Server 2019 Datacenter
Ubuntu 21.04
Ubuntu 18.04 LTS (ran on Windows hosted Hyper-v)
Every time I get this:
Keyboard is not responsive and I can not continue.
You can also view that i8042 module used for the keyboard is not available.
Can someone help with how to enable keyboard (it is not usb keyboard, it is integrated - on notebook - used for all except for Win Server)?
The starting command for qemu is (minimalistic):
qemu-system-spark64 -cdrom sol-10-u11-ga-sparc-dvd.iso -drive file=Image.img -m 2G -boot d

Loading Driver in QEMU Running Windows on Windows

I want to run Windows 10 on Windows 10 with QEMU (not with other software). I downloaded QEMU, and set up environment variable. I also got the Windows 10 iso file, renamed it to win10.iso, and put that in the same directory as the QEMU folder. Then I ran this command in the QEMU folder with cmd prompt: qemu-system-x86_64.exe -boot d -cdrom win10.iso -m 2048
It worked fine, but when it asked for the drive, I got confused. image.
I clicked on the first option, and it said this. So clicked on the second option, and it gave me this. I clicked "load driver" and it gave me this. How do I make a device driver?
You misunderstood windows installer. The window on the first image asks you for installation type - installing a new version or upgrading an existing. The upgrade option is only available when you have an installed version and runs the installer from a booted windows, not when booting from installation media. So installing a new version is your choice. The window on third image says windows installer cant find any disks where it can install the OS. This is because you ran qemu with a cdrom and no disks. The solution here is not to load a driver, but run qemu with a hard disk.
First create a disk, for example so:
qemu-img.exe create -f qcow2 win10.qcow2 50G
Then run qemu with this disk:
qemu-system-x86_64.exe -boot d -cdrom win10.iso -m 2048 win10.qcow2

macOS Catalina kernel debug

Anyone did Catalina kernel debug? I tried to copy the development edition of kernel from KDK folder(Catalina 536) to /System/Library/Kernels in the VMWare fusion target VM (Catalina beta8) according their readme file, anyhow that folder is readonly, you cannot copy any file there,
anyone has the solution?
One possible way is that reboot into recovery mode, but with VMWare fusion VM, it seems both latest version (Beta 8) and one vmx download from internet are not working, I tried both Cmd-R and 'reboot recovery' with nram settings.
Remoutning the root file system using
$ mount -u -w /
Worked for me to be able to copy the new kernel over. However my laptop is still slowly booting the debug kernel so I have not been able to verify end to end kernel debugging yet.

High Sierra - KDP is not listening for new connections

I created a setup of a guest virtual machine High Sierra which runs by VirtualBox.
I KDP on both guest and host.
I copied the development version of XNU from the KDP directory into the kernel directory on both guest and host.
I read that VirtualBox does not have the implementation for NVRAM so I had to use the following command to setup the kernel boot arguments for kernel debugging.
VBoxManage setextradata “your virtual machine name>" "VBoxInternal2/EfiBootArgs" [here go the kernel boot arguments]
However, I tried the combination of Command+Option+Control+Shift+Esc however it does not work.
As far as I'm aware, Command+Option+Control+Shift+Esc has a special meaning in hardware on Mac laptops. For a VM, you probably want to set the 0x8000 bit in the debug kernel argument and just send an ACPI power event to trigger the debugger instead.
I can't say if this will work in VirtualBox though as I haven't used that to do kernel debugging for a number of years.
My preferred method for attaching to a VM is using DTrace:
sudo dtrace -w -n "BEGIN { breakpoint(); }"
Then from the host you can:
kdp-remote <vm-ip>

Resources