How are operating systems debugged?

How are operating systems usually debugged? They cannot go through the debugger, like simple console programs, and the build time is too long to repeatedly make small changes and recompile it all.

+8
debugging operating-system
source share
3 answers

They are not debugged as multi-gigabyte programs! :)

If you mean individual user-mode components, you can basically debug them like regular programs and libraries (because they are regular programs / libraries!).

For components in kernel mode, each OS has its own mechanism; here is information about how we debug kernel in Windows. This can be done using another machine connected to the machine you are debugging through the serial port or something like that. I am not familiar with the process itself, but this is the essence of how they work. (You need to set some bootloader parameters so that the system is ready to connect the debugger as soon as possible.)

+6
source share

It depends on the part of the operating system that you are talking about. When I worked at MSFT, I worked on the IE team. We debugged IE and the shell (Windows Explorer) in Visual Studio and went through them all day. Although it is sometimes easier to debug using a command line tool such as NTSD.

If you want to debug anything on the kernel earth, such as the OS kernel or device drivers, which I suspect is really what you are asking for, then you should use a kernel debugger. For Windows, this is a command line tool called kd, and typically you run the debugger on one computer and remotely debug the target.

+5
source share

There is a whole range of methods throughout the history, from flashing lights on the console, to using hardware devices such as ICE, to more modern technologies using fairly standard debuggers. One of the methods that is more common among OS developers, then application developers is kernel dump analysis. Take a look at something like mdb on solaris for an idea of โ€‹โ€‹how Solaris kernel developers do some debugging. Tracing technology is also used. Anywhere from fairly simple registration packages to more advanced technologies like dtrace.

Also note that the methods used depend on the software level. The initial download has a rather difficult place for your fingers to penetrate. But after that, the environment of modern operating systems more and more resembles setting up the application you are used to. In the end, this is all the code :)

+1
source share

All Articles