Linux - KernelThis forum is for all discussion relating to the Linux kernel.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Hi ppl i have a 20MB binary file .. i need a code to read the first 188 bytes of data and put that in a buffer and second 188 bytes of data into second buffer and so on.. i have to print first 188 byte and second 188 bytes and so on .. please help me out

I would gladly help you just I do not know how. What do you really want to achieve?
you can use the command file <filename> to identify the type of the file, .ts is probably QT transport stream: http://filext.com/file-extension/TS, but I'm not really sure
You would need special software to handle such files.

Same program i executed .. Please help me to solve the following errors .. I am new to kernal level file operations...

gcc -I/usr/src/linux-headers-3.2.0-23-generic/arch/x86/include -I/usr/src/linux-headers-3.2.0-23-generic/include/ testfile1.cpp
In file included from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:67:0,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders" [-Wcpp]
In file included from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/bitops.h:455:0,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/bitops.h:22,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/thread_info.h:52,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/preempt.h:9,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/spinlock.h:50,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/rcupdate.h:38,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/key.h:21,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:76,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/asm-generic/bitops/fls64.h:33:2: error: #error BITS_PER_LONG not 32 or 64
In file included from /usr/src/linux-headers-3.2.0-23-generic/include/linux/thread_info.h:52:0,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/preempt.h:9,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/spinlock.h:50,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/rcupdate.h:38,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/key.h:21,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:76,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/linux/bitops.h:164:2: error: #error BITS_PER_LONG not 32 or 64
In file included from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/processor.h:26:0,
from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/thread_info.h:22,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/thread_info.h:53,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/preempt.h:9,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/spinlock.h:50,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/rcupdate.h:38,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/key.h:21,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:76,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/linux/cpumask.h:148:37: error: "and" may not appear in macro parameter list
In file included from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/div64.h:57:0,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/math64.h:5,
from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/processor.h:29,
from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/thread_info.h:22,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/thread_info.h:53,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/preempt.h:9,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/spinlock.h:50,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/rcupdate.h:38,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/key.h:21,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:76,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/asm-generic/div64.h:54:3: error: #error do_div() does not yet support the C64
In file included from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/thread_info.h:22:0,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/thread_info.h:53,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/preempt.h:9,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/spinlock.h:50,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/rcupdate.h:38,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/key.h:21,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:76,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/processor.h:157:0: warning: "cache_line_size" redefined [enabled by default]
/usr/src/linux-headers-3.2.0-23-generic/include/linux/cache.h:64:0: note: this is the location of the previous definition
In file included from /usr/src/linux-headers-3.2.0-23-generic/include/linux/key.h:21:0,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:76,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/linux/rcupdate.h:212:2: error: #error "Unknown RCU implementation specified to kernel configuration"
In file included from /usr/src/linux-headers-3.2.0-23-generic/include/linux/irq.h:20:0,
from /usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/hardirq.h:5,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/hardirq.h:7,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/ftrace_event.h:7,
from /usr/src/linux-headers-3.2.0-23-generic/include/trace/syscall.h:6,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/syscalls.h:77,
from testfile1.cpp:3:
/usr/src/linux-headers-3.2.0-23-generic/include/linux/gfp.h:214:2: error: #error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer
In file included from /usr/src/linux-headers-3.2.0-23-generic/include/linux/ktime.h:25:0,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/timer.h:5,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/workqueue.h:8,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/kmod.h:26,
from /usr/src/linux-headers-3.2.0-23-generic/include/linux/module.h:13,
from testfile1.cpp:4:
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
/usr/src/linux-headers-3.2.0-23-generic/include/linux/jiffies.h:43:42: error: division by zero in #if
In file included from /usr/src/linux-headers-3.2.0-23-generic/include/linux/module.h:22:0,
from testfile1.cpp:4:
/usr/src/linux-headers-3.2.0-23-generic/arch/x86/include/asm/module.h:59:2: error: #error unknown processor family
testfile1.cpp:6:28: fatal error: linux/smp_lock.h: No such file or directory
compilation terminated.