Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

why printk is printing something weird? [closed]

$
0
0

Part of a syscall function -

char buf[256];long copied = strncpy_from_user(buf, msg, sizeof(buf));printk(KERN_INFO "stephen syscall called with \"%s\"\n", buf);

This is the test program from where this syscall function is invoked -

long int check = syscall(549, atoi(argv[1]), argv[2]);printf("Returned : %ld\n", check);

dmesg does not print the user input passed, instead prints something like this

\xb0T\x99\x98\x98\x90\xff\xff\x90=\xb4 and so on like this weird stuff

Please suggest me how to should I print the user input correctly.Reference i have used for writing my code : https://brennan.io/2016/11/14/kernel-dev-ep3/


Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>