Changes between Version 4 and Version 5 of CoreFiles


Ignore:
Timestamp:
2014-06-17T14:27:12Z (10 years ago)
Author:
Martin Decky
Comment:

data file system is no longer mounted automatically

Legend:

Unmodified
Added
Removed
Modified
  • CoreFiles

    v4 v5  
    11= Working with core files =
    22
    3 HelenOS can now produce an ELF core file when a task crashes. While you cannot really use it yet in HelenOS directly, you can extract this core file and use it with GDB to debug the application.
     3HelenOS can produce an ELF core file when a task crashes. While you cannot really use it yet in HelenOS directly, you can extract this core file and use it with GDB to debug the application.
    44
    55Note that all architectures do not support saving register state in the core file, see [wiki:ArchFeature], check the line labeled ''Write GP-register state to core file''. If the architecture does not support it, you will not be able to view register state nor a stack trace in GDB!
    66
    7 Here we assume you are using Linux as your host system and that you run HelenOS in Qemu.
     7Here we assume you are using Linux as your host system and that you run HelenOS in QEMU.
    88
    99First configure and build HelenOS as follows:
    1010
    1111 * Load preconfigured defaults: ia32 (or amd64)
    12  * Enable options: Load disk drivers on startup, Mount /data on startup, Write core files
     12 * Enable the configuration option: Write core files
    1313
    14 Now we need a disk image with a FAT filesystem. Make sure it has at least 20 MB (we are using 4 kB clusters and we must have at least 4 k clusters for FAT16).
     14Now we need a disk image with a FAT file system. Make sure it has at least 20 MB (we are using 4 KB clusters and we must have at least 4 k clusters for FAT16).
    1515
    1616{{{
     
    2121}}}
    2222
    23 Run HelenOS in Qemu now and it will mount the new filesystem on {{{/data}}} automatically.
     23Run HelenOS in QEMU.
    2424
    2525{{{
    26 $ qemu -hda img -cdrom image.iso -boot d
     26$ qemu-system-i386 -hda img -cdrom image.iso -boot d
     27$ qemu-system-x86_64 -hda img -cdrom image.iso -boot d
    2728}}}
     29
     30The ATA driver should detect the disk device. Use the following commands to find the ATA device name and mount it.
     31
     32{{{
     33# loc
     34bd:
     35        devices/\hw\pci0\00:01.0\ata-c1\d0 : devman
     36        devices/\hw\pci0\00:01.0\ata-c2\d0 : devman
     37...
     38# fat
     39# mount fat /data devices/\hw\pci0\00:01.0\ata-c1\d0
     40}}}
     41
     42The first ATA device is usually the hard disk, the second ATA device is usually the CD-ROM drive. You have to manually start the FAT file system driver (if it is not yet stated) and mount the file system under /data.
    2843
    2944Good. Now we can take the crashdump. If you run {{{tester fault1}}} it will save a core dump under /data. Another way is to dump a running task. Let's start Tetris, determine it's task ID using the kernel console and finally run {{{taskdump}}} on it.