sub pdevices {
	my ($name, $value, $maxdev, $i);
	my (@chrdevlist, @sortedlist);

	$maxdev = 255;  # same as MAX_CHARDEV
	$value = get_addr 'chrdevs';
	@chrdevlist = get_mem $value,$maxdev;
	@sortedlist = sort @chrdevlist;

	print "Character devices:\n";
	for ($i=0; $i < $maxdev; $i++) {
		if ($sortedlist[$i] ne "0x00000000") {
			$val = kernel($sortedlist[$i], 'char_device_struct', 'name', 'char *' );
			print "$i\t\t$val\n";
		};
	};		
}
1;
