site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hi list, printf If you have an XServe, you can also use the serial console, instead. -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Jun 28, 2007, at 3:32 PM, billy lau wrote: I am currently trying to modify some memory allocators in darwin, for example, the zalloc. However, I am not familiar with the debugging APIs for darwin or Mac OS X, as I am very new to this operating system. Can someone please shed some light on this? Mostly, we use gdb. How to do this is documented in "two machine debugging" and "kernel debugging" at <http://developer.apple.com> in various places (look for the kernel debug kits). For example, is there an equivalent of printk (used in linux) in mac? And if there is, how can I see the result of the these 'prints'? This is covered at <http://developer.apple.com>; typically, you set your boot-args to contain debug=0x14e; that causes the output to go to the console, and you can tail -f /var/log/system.log. Are they printed to some sort of buffer maintained the kernel? Yes, which is then sent to the console device, which is then logged to the system.log. As for linux, printk would basically just print to the console, but, as for Mac, how would that be done, since the operating systems starts in the user graphical interface. If you _can't_ look at the log because you are doing work that causes the system to crash, then you can look at the console ring buffer from kernel space using gdb and two machine debugging (<http://developer.apple.com
again...); alternately, you can login to the non-graphical console, which will cause them to show (more or less) immediately. Note that there is a (very small) latency, so if you are printing e.g. single letters with \n's, and they are very close together source-line-wise, you could lose an event. This is discussed on <http://developer.apple.com>, but basically if you login with the username >console and no password, it will give you a non-graphical login. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert