diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2008-11-05 14:58:33 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2008-11-05 14:58:33 +0100 |
commit | ae9e4e22a7ce8b2b56e98ff1708c2e8d42eefd69 (patch) | |
tree | 53d824c19af411f67db44baeacba9b22b68731e6 /microkernel/mach/gnumach/debugging.mdwn | |
parent | 9574f098caf72da7f709c8467e96606cce04fff9 (diff) | |
download | web-ae9e4e22a7ce8b2b56e98ff1708c2e8d42eefd69.tar.gz web-ae9e4e22a7ce8b2b56e98ff1708c2e8d42eefd69.tar.bz2 web-ae9e4e22a7ce8b2b56e98ff1708c2e8d42eefd69.zip |
microkernel/mach/gnumach -> microkernel/mach/gnu_mach
Diffstat (limited to 'microkernel/mach/gnumach/debugging.mdwn')
-rw-r--r-- | microkernel/mach/gnumach/debugging.mdwn | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/microkernel/mach/gnumach/debugging.mdwn b/microkernel/mach/gnumach/debugging.mdwn deleted file mode 100644 index fa2a9d42..00000000 --- a/microkernel/mach/gnumach/debugging.mdwn +++ /dev/null @@ -1,68 +0,0 @@ -[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] - -[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable -id="license" text="Permission is granted to copy, distribute and/or modify this -document under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no Invariant -Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled -[[GNU_Free_Documentation_License|/fdl]]."]]"""]] - -Mach has a built-in kernel debugger. -[Manual](http://www.gnu.org/software/hurd/gnumach-doc/Kernel-Debugger.html). - - -When you're [[running_a_system_in_QEMU|hurd/running/qemu]] you can directly -[use GDB on the running -kernel](http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC36). - - -Alternatively you can use an approach like this one: add the following code -snippet to `device/ds_routines.c`'s `ds_device_open` function, right at the top -of the function, and modify the code as needed. - - void D (char *s) - { - switch (s[0] - '0') - { - case 0: - printf ("Hello from %s!\n", __FUNCTION__); - break; - case 1: - printf ("%s: Invoking task_collect_scan.\n", __FUNCTION__); - extern void task_collect_scan (void); - task_collect_scan (); - break; - default: - printf ("No idea what you want me to do.\n"); - break; - } - } - - if (name && name[0] == 'D') - D (name + 1); - -Then boot your system and do something like this: - - # devprobe D0 - Hello from D! - # devprobe D1 - D: Invoking task_collect_scan. - # devprobe D2 - No idea what you want me to do. - -This is especially useful if you need to manually trigger some stuff inside the -running kernel, as with the *D1* example. - - -If you're doing real low level debugging, you might want to put variations of -the following snipped into the code, this code will write a `#` character at -line `[LINE]`, column `[COLUMN]` on the screen: - - *((char *) 0xb8000 + 2 * ([LINE] * 80 + [COLUMN])) = '#'; - halt_cpu (); - -The call of `halt_cpu` will -- as the name suggests -- halt the system -afterwards. This might be what you want or it might not, but it is needed at -some place when running the kernel inside QEMU, as QEMU somehow decides not to -update its display buffer anymore under certain conditions. |