File:  [NetBSD Developer Wiki] / wikisrc / users / jakllsch.mdwn
Revision 1.6: download - view: text, annotated - select for diffs
Sat Apr 12 02:28:11 2014 UTC (5 years, 11 months ago) by jakllsch
Branches: MAIN
CVS tags: HEAD
minor status changes on x86/uefiboot(8)

    1: # Jonathan Kollasch
    2: 
    3: ## [[!template id=man name="ddb" section="4"]] tips
    4: 
    5: ### locating a softc
    6: This locates a device's softc using it's `cfdriver_t` (e.g. `&mainbus_cd`, `&cpu_cd`) and its "device unit" (e.g. the `0` in `mainbus0`).
    7: 
    8:     db{0}> call device_lookup_private(ohci_cd, 0)
    9:     0xffff800045fb2008
   10: 
   11: ### locating structure members
   12: This uses [[!template id=man name="gdb" section="1"]] and a kernel with debugging symbols to find the offset to a element in a structure.
   13: 
   14:     $ gdb netbsd.gdb
   15:     ...
   16:     (gdb) print &((struct ohci_softc *)0)->iot
   17:     $3 = (bus_space_tag_t *) 0x478
   18:     (gdb) print &((struct ohci_softc *)0)->ioh
   19:     $4 = (bus_space_handle_t *) 0x480
   20: 
   21: ### peeking at mapped registers
   22: 
   23:     db{0}> call bus_space_read_4(*(ffff800045fb2008+478), *(ffff800045fb2008+480), 0)
   24:     0x110
   25: 
   26: ## Unfinished Projects
   27: 
   28: ### x86 UEFI kernel loader
   29: Needs more work and cleanup.
   30: Work has been done using the OVMF BIOS images for Qemu.
   31: 
   32: ### bcm47xx for evbmips
   33: Boots multiuser on NFS root, needs more work and cleanup.
   34: This project is on hold until there's a miniature userland that fits in 4-8MiB flash storage devices, on a flash-oriented file system.
   35: [[!template id=man name="bce" section="4"]] and [[!template id=man name="bwi" section="4"]] would need refactoring to be bus-independent.
   36: 
   37: ### Memory-mapped PCI config access on x86
   38: Needs cleanup, and maybe some more validation of MCFG tables.

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb