version 1.2, 2009/10/21 23:23:09
|
version 1.4, 2010/05/01 20:15:13
|
Line 1
|
Line 1
|
# Jonathan Kollasch |
# Jonathan Kollasch |
|
|
|
## [[!template id=man name="ddb" section="4"]] tips |
|
|
|
### locating a softc |
|
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`). |
|
|
|
db{0}> call device_lookup_private(ohci_cd, 0) |
|
0xffff800045fb2008 |
|
|
|
### locating structure members |
|
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. |
|
|
|
$ gdb netbsd.gdb |
|
... |
|
(gdb) print &((struct ohci_softc *)0)->iot |
|
$3 = (bus_space_tag_t *) 0x478 |
|
(gdb) print &((struct ohci_softc *)0)->ioh |
|
$4 = (bus_space_handle_t *) 0x480 |
|
|
|
### peeking at mapped registers |
|
|
|
db{0}> call bus_space_read_4(*(ffff800045fb2008+478), *(ffff800045fb2008+480), 0) |
|
0x110 |
|
|
## Unfinished Projects |
## Unfinished Projects |
|
|
### x86 UEFI kernel loader |
### x86 UEFI kernel loader |
Line 22 Probably better to keep these drivers in
|
Line 45 Probably better to keep these drivers in
|
Should try to coordinate with what FreeBSD is doing: <http://wiki.freebsd.org/HDTV>. |
Should try to coordinate with what FreeBSD is doing: <http://wiki.freebsd.org/HDTV>. |
|
|
### Memory-mapped PCI config access on x86 |
### Memory-mapped PCI config access on x86 |
Still need to figure out how pcitag_t will work for a 3rd mode that can't be switched on until after ACPI is initialized. |
Needs cleanup, and maybe some more validation of MCFG tables. |
Existing code I have assumes that no tags are generated until mmconf is turned on, which is not a reasonable assumption to make. |
|
|
### Toshiba ACPI LCD backlight driver |
|
Loosly based on [[!template id=man name="vald" section="4"]]. Currently attaches to `TOS1900`/`VALZ`, but doesn't interact with this device. |
|
This driver should really attach to `\_SB.PCI0.GFX0.LCD` or |
|
`\_SB.PCI0.PEGP.VGA.LCD`, which are the devices that get notified of |
|
brightness button pushes, and contain the `_BCL`, `_BCM`, and `_BQC` |
|
methods that access the brightness adjustment function. |
|
Such an attachment does not appear to be possible (or at the very least, easy) |
|
at present. |
|
|
## Possible Projects |
## Possible Projects |
### AMD PowerNow/Cool'n'Quiet states loaded from ACPI tables |
### AMD PowerNow/Cool'n'Quiet states loaded from ACPI tables |
|
|