3 # this applet is to load the clock device driver and create
4 # the corresponding /dev/clock file.
9 my $devfile = "/dev/ckpt";
10 my $listfile = "/proc/devices";
13 system "/sbin/insmod ckpt.ko";
15 # get the major number from /dev/clock
16 open LIST
, $listfile or die "can't open $listfile!\n";
20 while ($line = <LIST
>) {
22 my $dev = substr($line, 4);
23 if ($dev eq $device) { # is it "ckpt"?
24 $major = substr($line, 0, 3);
33 die "loading failed..please check your code\n" if ($major == -1);
36 print STDERR
"$devfile exists\n"; # dev file already exists
39 # print "mknod $devfile c $major 0\n";
40 system "mknod $devfile c $major 0";
41 system "chmod 666 $devfile";
42 print "ckpt loaded\n";