Changes between Version 14 and Version 15 of Dev/KernelHack/COINS/worklog/201111


Ignore:
Timestamp:
Nov 25, 2011 2:34:38 AM (13 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Dev/KernelHack/COINS/worklog/201111

    v14 v15  
    33383338Continuing. 
    33393339}}} 
     3340 
     3341 == stackmod seems to work as expected == 
     3342 * s0711489@ubuntu-lucid64:~$ sudo insmod stackmod.ko entry=4 
     3343 * s0711489@ubuntu-lucid64:~$ sudo mknod /dev/stack c 251 0 
     3344 * s0711489@ubuntu-lucid64:~$ sudo chmod 666 /dev/stack 
     3345 
     3346 * s0711489@ubuntu-lucid64:~$ echo 0 > /dev/stack 
     3347 * s0711489@ubuntu-lucid64:~$ echo 1 > /dev/stack 
     3348 * s0711489@ubuntu-lucid64:~$ echo 2 > /dev/stack 
     3349 * s0711489@ubuntu-lucid64:~$ echo 3 > /dev/stack 
     3350 * s0711489@ubuntu-lucid64:~$ cat /proc/stackmod 
     3351{{{ 
     3352stack: 4 
     3353}}} 
     3354 * s0711489@ubuntu-lucid64:~$ echo 4 > /dev/stack 
     3355{{{ 
     3356-bash: echo: write error: No space left on device 
     3357}}} 
     3358 * s0711489@ubuntu-lucid64:~$ cat /proc/stackmod 
     3359{{{ 
     3360stack: 4 
     3361}}} 
     3362 * s0711489@ubuntu-lucid64:~$ cat /dev/stack 
     3363{{{ 
     33643 
     33652 
     33661 
     33670 
     3368}}} 
     3369 * s0711489@ubuntu-lucid64:~$ cat /proc/stackmod 
     3370{{{ 
     3371stack: 0 
     3372}}} 
     3373 
     3374 * s0711489@ubuntu-lucid64:~$ tailf /var/log/kern.log 
     3375{{{ 
     3376Nov 23 20:03:55 ubuntu-lucid64 kernel: [   34.772987] stackmod is loaded 
     3377Nov 23 20:03:55 ubuntu-lucid64 kernel: [   34.772992] stackmod: 4 entry, major is 251, minor is 0 
     3378Nov 23 20:03:55 ubuntu-lucid64 kernel: [   34.773002] stackmod: create /proc/stackmod 
     3379Nov 23 20:03:55 ubuntu-lucid64 kernel: [   34.773004] stackmod is added successfully 
     3380Nov 23 20:05:02 ubuntu-lucid64 kernel: [  101.487336] stackmod is opened 
     3381Nov 23 20:05:02 ubuntu-lucid64 kernel: [  101.487361] stackmod is written (2) 
     3382Nov 23 20:05:02 ubuntu-lucid64 kernel: [  101.487367] stackmod is released 
     3383Nov 23 20:05:05 ubuntu-lucid64 kernel: [  104.420526] stackmod is opened 
     3384Nov 23 20:05:05 ubuntu-lucid64 kernel: [  104.420537] stackmod is written (2) 
     3385Nov 23 20:05:05 ubuntu-lucid64 kernel: [  104.420542] stackmod is released 
     3386Nov 23 20:05:08 ubuntu-lucid64 kernel: [  107.535829] stackmod is opened 
     3387Nov 23 20:05:08 ubuntu-lucid64 kernel: [  107.535844] stackmod is written (2) 
     3388Nov 23 20:05:08 ubuntu-lucid64 kernel: [  107.535849] stackmod is released 
     3389Nov 23 20:05:11 ubuntu-lucid64 kernel: [  110.279177] stackmod is opened 
     3390Nov 23 20:05:11 ubuntu-lucid64 kernel: [  110.279192] stackmod is written (2) 
     3391Nov 23 20:05:11 ubuntu-lucid64 kernel: [  110.279198] stackmod is released 
     3392Nov 23 20:05:16 ubuntu-lucid64 kernel: [  115.426012] /proc/stackmod is read 
     3393Nov 23 20:05:16 ubuntu-lucid64 kernel: [  115.426026] /proc/stackmod is read 
     3394Nov 23 20:05:21 ubuntu-lucid64 kernel: [  120.354789] stackmod is opened 
     3395Nov 23 20:05:21 ubuntu-lucid64 kernel: [  120.354804] stackmod is written (2) 
     3396Nov 23 20:05:21 ubuntu-lucid64 kernel: [  120.354989] stackmod is released 
     3397Nov 23 20:05:25 ubuntu-lucid64 kernel: [  124.989666] /proc/stackmod is read 
     3398Nov 23 20:05:25 ubuntu-lucid64 kernel: [  124.989681] /proc/stackmod is read 
     3399Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278525] stackmod is opened 
     3400Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278792] stackmod is read (32768) 
     3401Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278802] stackmod is read (32768) 
     3402Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278806] stackmod is read (32768) 
     3403Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278810] stackmod is read (32768) 
     3404Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278813] stackmod is read (32768) 
     3405Nov 23 20:05:34 ubuntu-lucid64 kernel: [  133.278817] stackmod is released 
     3406Nov 23 20:05:37 ubuntu-lucid64 kernel: [  136.451935] /proc/stackmod is read 
     3407Nov 23 20:05:37 ubuntu-lucid64 kernel: [  136.451949] /proc/stackmod is read 
     3408}}} 
     3409 
     3410 === test with binary data === 
     3411 ==== within 1 stack ==== 
     3412 * s0711489@ubuntu-lucid64:~$ dd if=/dev/urandom of=10kb count=10 bs=1024 
     3413 * s0711489@ubuntu-lucid64:~$ cat 10kb > /dev/stack 
     3414 * s0711489@ubuntu-lucid64:~$ cat /dev/stack > 10kb.st 
     3415 * s0711489@ubuntu-lucid64:~$ ls -l 
     3416{{{ 
     3417total 156 
     3418-rw-r--r-- 1 s0711489 s0711489  10240 2011-11-23 20:13 10kb 
     3419-rw-r--r-- 1 s0711489 s0711489  10240 2011-11-23 20:15 10kb.st 
     3420-rw-r--r-- 1 s0711489 s0711489 128105 2011-11-23 20:03 stackmod.ko 
     3421}}} 
     3422 * s0711489@ubuntu-lucid64:~$ sha1sum -b 10kb* 
     3423{{{ 
     34248cc43464af331cd5d56f1db7d44b59530e038ec8 *10kb 
     34258cc43464af331cd5d56f1db7d44b59530e038ec8 *10kb.st 
     3426}}} 
     3427 
     3428 * s0711489@ubuntu-lucid64:~$ tailf /var/log/kern.log 
     3429{{{ 
     3430Nov 23 20:14:18 ubuntu-lucid64 kernel: [  657.018652] stackmod is opened 
     3431Nov 23 20:14:18 ubuntu-lucid64 kernel: [  657.020744] stackmod is written (10240) 
     3432Nov 23 20:14:18 ubuntu-lucid64 kernel: [  657.020767] stackmod is released 
     3433Nov 23 20:15:05 ubuntu-lucid64 kernel: [  704.792196] stackmod is opened 
     3434Nov 23 20:15:05 ubuntu-lucid64 kernel: [  704.792212] stackmod is read (32768) 
     3435Nov 23 20:15:05 ubuntu-lucid64 kernel: [  704.792275] stackmod is read (32768) 
     3436Nov 23 20:15:05 ubuntu-lucid64 kernel: [  704.792279] stackmod is released 
     3437}}} 
     3438 
     3439 ==== more than one stack ==== 
     3440 * s0711489@ubuntu-lucid64:~$ dd if=/dev/urandom of=blob count=10 bs=32768 
     3441 * s0711489@ubuntu-lucid64:~$ sudo insmod stackmod.ko entry=10 
     3442 * s0711489@ubuntu-lucid64:~$ cat blob > /dev/stack 
     3443 * s0711489@ubuntu-lucid64:~$ cat /dev/stack > blob.rev 
     3444 * s0711489@ubuntu-lucid64:~$ cat blob.rev > /dev/stack 
     3445 * s0711489@ubuntu-lucid64:~$ cat /dev/stack > blob.st 
     3446 * s0711489@ubuntu-lucid64:~$ sha1sum -b blob* 
     3447{{{ 
     3448d72eb4053f12de4c3c436663dd61679b20c156ac *blob 
     34492366d2d5b3c62a647c7eb28ae6708caf064470f4 *blob.rev 
     3450d72eb4053f12de4c3c436663dd61679b20c156ac *blob.st 
     3451}}}