[1160] in NetBSD-Development

home help back first fref pref prev next nref lref last post

Hacks to modify kernel device lists

daemon@ATHENA.MIT.EDU (John Hawkinson)
Sat Dec 16 22:43:04 1995

Date: Sat, 16 Dec 1995 22:42:37 -0500
To: netbsd-dev@MIT.EDU
From: John Hawkinson <jhawk@MIT.EDU>

I finally got around to implementing this.

It's called "kerntweak" and it lives in /afs/sipb/project/netbsd/bin.

Among other things it deals much better if you have a wide screen.

Attached is an example of how to use it. It's pretty unsupported.
It's possible that modifying some devices might lead to other devices
being modified in kind if they had exactly the same configuration.
There's no real good way around this (unless you decide to sacrifice
another device from the config, I guess), but that's hard to implement
in gdb macros.

Frankly, doing it w/ adb macros would've been easier. Oh well.

--jhawk

Script started on Sat Dec 16 22:32:23 1995
[lola-granola!jhawk] /afs/sipb/project/netbsd/dev/machine-specific> cp /sys/arch/i386/compile/ATHENA-AHA/netbsd netbsd.kashriaz
[lola-granola!jhawk] /afs/sipb/project/netbsd/dev/machine-specific> where kerntweak
/afs/sipb/project/netbsd/bin/kerntweak
[lola-granola!jhawk] /afs/sipb/project/netbsd/dev/machine-specific> kerntweak netbsd.kashriaz 
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.11 (i386-netbsd), Copyright 1993 Free Software Foundation, Inc...(no debugging symbols found)...


========================================
$Id: kerntweak.gdb.in,v 1.3 1995/12/17 03:23:32 jhawk Exp $
Hacks to modify devices w/o rebuilding a netbsd kernel
========================================

Commands:
	cfprint		Print the complete device list
	cfprintone	Print the current device
	cfselect	Set current device to <arg>
	cfsetport	Set current device's port to <arg>
	cfsetiomem	Set current device's iomem to <arg>
	cfsetirq	Set current device's irq to <arg>
	quit		Exit gdb
	file		Edit the kernel named <arg>
	cfhelp		Print this help

Usage:
	"<command> <arg>" means
		set $arg=<arg>
		<command>

(kerntweak) cfprint
0xf81f4644 Device 0xf81edc90 <scsibuscd> unit 0 port 0x530 size 0 iomem 0xffffffff iosiz 0 irq 10 drq 0
0xf81f465c Device 0xf81ee100 <cdcd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f4674 Device 0xf81ee148 <chcd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f468c Device 0xf81ee18c <sdcd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f46a4 Device 0xf81ee554 <stcd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f46bc Device 0xf81ee598 <sscd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f46d4 Device 0xf81eee18 <isacd> unit 0 port 0x530 size 0 iomem 0xffffffff iosiz 0 irq 10 drq 0
0xf81f46ec Device 0xf81f204c <pcicd> unit 0 port 0x530 size 0 iomem 0xffffffff iosiz 0 irq 10 drq 0
0xf81f4704 Device 0xf81ee678 <comcd> unit 0 port 0x3f8 size 0 iomem 0xffffffff iosiz 0 irq 4 drq -1
0xf81f471c Device 0xf81ee678 <comcd> unit 1 port 0x2f8 size 0 iomem 0xffffffff iosiz 0 irq 3 drq -1
0xf81f4734 Device 0xf81ee678 <comcd> unit 2 port 0x3e8 size 0 iomem 0xffffffff iosiz 0 irq 5 drq -1
0xf81f474c Device 0xf81ee6c8 <lptcd> unit 0 port 0x378 size 0 iomem 0xffffffff iosiz 0 irq 7 drq -1
0xf81f4764 Device 0xf81ee6c8 <lptcd> unit 1 port 0x278 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f477c Device 0xf81ee6c8 <lptcd> unit 2 port 0x3bc size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f4794 Device 0xf81ee708 <ahacd> unit 0 port 0x330 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f47ac Device 0xf81ee708 <ahacd> unit 1 port 0x334 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f47c4 Device 0xf81ee72c <aiccd> unit 0 port 0x340 size 0 iomem 0xffffffff iosiz 0 irq 11 drq -1
0xf81f47dc Device 0xf81ee7a8 <seacd> unit 0 port 0xffffffff size 0 iomem 0xc8000 iosiz 0 irq 5 drq -1
0xf81f47f4 Device 0xf81ee7e8 <uhacd> unit 0 port 0x330 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f480c Device 0xf81ee7e8 <uhacd> unit 1 port 0x334 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f4824 Device 0xf81ee7e8 <uhacd> unit 2 port 0xffffffff size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f483c Device 0xf81ee80c <mcdcd> unit 0 port 0x300 size 0 iomem 0xffffffff iosiz 0 irq 10 drq -1
0xf81f4854 Device 0xf81ee830 <wdccd> unit 0 port 0x1f0 size 0 iomem 0xffffffff iosiz 0 irq 14 drq -1
0xf81f486c Device 0xf81ee850 <wdcd> unit 0 port 0xffffffff size 983054 iomem 0x100034 iosiz 1114166 irq 18 drq 20
0xf81f4884 Device 0xf81ee874 <wtcd> unit 0 port 0x300 size 0 iomem 0xffffffff iosiz 0 irq 5 drq 1
0xf81f489c Device 0xf81ee898 <edcd> unit 0 port 0x250 size 0 iomem 0xffffffff iosiz 0 irq 9 drq -1
0xf81f48b4 Device 0xf81ee898 <edcd> unit 1 port 0x280 size 0 iomem 0xffffffff iosiz 0 irq 9 drq -1
0xf81f48cc Device 0xf81ee898 <edcd> unit 2 port 0x300 size 0 iomem 0xffffffff iosiz 0 irq 9 drq -1
0xf81f48e4 Device 0xf81ee898 <edcd> unit 3 port 0x280 size 0 iomem 0xd0000 iosiz 0 irq -1 drq -1
0xf81f48fc Device 0xf81ee898 <edcd> unit 4 port 0x250 size 0 iomem 0xd8000 iosiz 0 irq -1 drq -1
0xf81f4914 Device 0xf81ee898 <edcd> unit 5 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq -1 drq -1
0xf81f492c Device 0xf81ee898 <edcd> unit 6 port 0x280 size 0 iomem 0xd0000 iosiz 0 irq 9 drq -1
0xf81f4944 Device 0xf81ee898 <edcd> unit 7 port 0x250 size 0 iomem 0xd8000 iosiz 0 irq 9 drq -1
0xf81f495c Device 0xf81ee898 <edcd> unit 8 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq 10 drq -1
0xf81f4974 Device 0xf81ee958 <epcd> unit 0 port 0xffffffff size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f498c Device 0xf81ee958 <epcd> unit 1 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f49a4 Device 0xf81ee978 <fecd> unit 0 port 0x2a0 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f49bc Device 0xf81ee978 <fecd> unit 1 port 0x300 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f49d4 Device 0xf81ee978 <fecd> unit 2 port 0x320 size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f49ec Device 0xf81ee9d4 <iecd> unit 0 port 0x360 size 0 iomem 0xd0000 iosiz 0 irq 7 drq -1
0xf81f4a04 Device 0xf81ee9f8 <sbcd> unit 0 port 0x220 size 0 iomem 0xffffffff iosiz 0 irq 5 drq 1
0xf81f4a1c Device 0xf81eec0c <pascd> unit 0 port 0x220 size 0 iomem 0xffffffff iosiz 0 irq 7 drq 1
0xf81f4a34 Device 0xf81eede8 <wsscd> unit 0 port 0x530 size 0 iomem 0xffffffff iosiz 0 irq 10 drq 0
0xf81f4a4c Device 0xf81eee84 <npxcd> unit 0 port 0xf0 size 0 iomem 0xffffffff iosiz 0 irq 13 drq -1
0xf81f4a64 Device 0xf81eeea8 <vtcd> unit 0 port 0x60 size 0 iomem 0xffffffff iosiz 0 irq 1 drq -1
0xf81f4a7c Device 0xf81f08dc <lmscd> unit 0 port 0x23c size 0 iomem 0xffffffff iosiz 0 irq 5 drq -1
0xf81f4a94 Device 0xf81f08dc <lmscd> unit 1 port 0x238 size 0 iomem 0xffffffff iosiz 0 irq 5 drq -1
---Type <return> to continue, or q <return> to quit--- 
0xf81f4aac Device 0xf81f08fc <mmscd> unit 0 port 0x23c size 0 iomem 0xffffffff iosiz 0 irq 5 drq -1
0xf81f4ac4 Device 0xf81f08fc <mmscd> unit 1 port 0x238 size 0 iomem 0xffffffff iosiz 0 irq 5 drq -1
0xf81f4adc Device 0xf81f091c <pmscd> unit 0 port 0x60 size 0 iomem 0xffffffff iosiz 0 irq 12 drq -1
0xf81f4af4 Device 0xf81f0940 <fdccd> unit 0 port 0x3f0 size 0 iomem 0xffffffff iosiz 0 irq 6 drq 2
0xf81f4b0c Device 0xf81f0acc <fdcd> unit 0 port 0xffffffff size 983054 iomem 0x100034 iosiz 1114166 irq 18 drq 20
0xf81f4b24 Device 0xf81f0b18 <ahbcd> unit 0 port 0xffffffff size 0 iomem 0xffffffff iosiz 0 irq -1 drq -1
0xf81f4b3c Device 0xf81f0d48 <decd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f4b54 Device 0xf81f0da4 <ncrcd> unit 0 port 0xffffffff size -1 iomem 0xf000e iosiz 1048628 irq 54 drq 18
0xf81f4b6c Device 0x0 unit 0 port Cannot access memory at address 0x0.
(kerntweak) set $arg=0xf81f48cc
(kerntweak) cfselect
(kerntweak) cfprintone
0xf81f48cc Device 0xf81ee898 <edcd> unit 2 port 0x300 size 0 iomem 0xffffffff iosiz 0 irq 9 drq -1
(kerntweak) set $arg=11
(kerntweak) cfsetirq
(kerntweak) cfprintone
0xf81f48cc Device 0xf81ee898 <edcd> unit 2 port 0x300 size 0 iomem 0xffffffff iosiz 0 irq 11 drq -1
(kerntweak) quit
[lola-granola!jhawk] /afs/sipb/project/netbsd/dev/machine-specific> ^D
Script done on Sat Dec 16 22:35:00 1995

home help back first fref pref prev next nref lref last post