Programming :: Accessing And Performing Operations On Base Level Kernel Structure?

Jan 20, 2011

We all know linux kernel base layer is made up of structures, in which every object of kernel is well defined. Structure members correspond to object properties required to define object behavior.

For example if we take case of File system.It composed of four objects , superblock objects, inode objects, file objects and dentry object.Each having well defined structure which is being operated by system call handler and by system call service routine in the kernel mode.

Now my question is even in kernel mode we do not have some mechanism by which we can get access to pointer of these structures.We have some macro.

If I want to manipulate structure on my on way, or performing some more operation defined by me.For example after the crash of Hard Disk Drive, having ext2/3 file system, If i want to know all the inode pointers, and block details.

Can I have some way out to do desired operation ??

mechanism to operate on these base label structures, even in kernel mode ..

View 5 Replies


ADVERTISEMENT

Programming :: Accessing SPI From Kernel Level And User Level

Jan 6, 2009

I want to know what are the advantages and disadvantages for accessing spi(serial peripheral inerface )from kernel level and user level. like methods of doing it, speed ,memeory utilization etc

View 1 Replies View Related

Programming :: Getting Error While Accessing Inode Structure Member / Why Is This?

Dec 16, 2010

I have added new member "i_mymember" to inode on-disk structure in ext3_fs.h file and tried to access this in userspace program, but gives me error that "error: �struct ext3_inode� has no member named �i_mymember� "

I have compiled my kernel source code.

why this error is coming ...?

View 1 Replies View Related

Programming :: Perform Floating Point Operations In Linux Kernel?

Apr 7, 2011

how to perform floating point operations in kernel? i answered that its impossible to perform floating point operations in kernel.but he is telling that its possible but with some feature to be added.can any body know about this perfectly??

View 1 Replies View Related

Programming :: Macro To Access Kernel Objectys Structure?

Jan 29, 2011

telling the exact macro name and location, by which I can gain control over the following kernel base level structure

1. strct super_block of Virtual File System, for super block object.
2. strct inode for inode ofject of VFS.
3 file structure for file object of VFS.

in addition to these if you know location to access other kernel structure.Please let me know.My main objective is to get the access to the structure pointer of these structure by which i can have access over the individual fields o these structure.

View 11 Replies View Related

Programming :: Find Logarithm To Base 10 Instead Of Base 2 On Shell Script?

Apr 20, 2010

can we find logarithm to base 10 instead of base 2 on shell script??i can do it with bc..like 'l(1000)/l(10)' | bc -l

View 1 Replies View Related

Programming :: Write A Kernel In A High Level Language Such As Python?

Apr 27, 2010

Most kernels are written in low level programming languages such as C and Assembly. Would it be possible to write a kernel in a high level language such as Python? Many high-level languages are themselves written in C.

View 5 Replies View Related

General :: Check Flac Files In A Multi-level Directory Structure?

May 13, 2011

I am trying to check flac files in a multi-level directory structure, and would ideally like to get ordered output with the full path file name.

I could write a multiline script, but was wondering if there were better ways of accomplishing this.

The current command I am using is:

Code:
find . -name '*flac' -exec flac -t {} ;

View 12 Replies View Related

Networking :: Accessing Low Level Network Interface

Jul 7, 2010

I would like be able to access packets coming off the network with the hopes of coding a primitive packet sniffer for learning purposes. I would also like to be able to piece together my own packets and send them out on my network. Eventually, I would also like to write a simple firewall so I want the capability to drop packets as well as let them pass. I assume I will have to access the kernel with some system calls to do this, any one have any information or resources that could help me on this project?

View 1 Replies View Related

Red Hat :: RHEL 4 - Make Initrd For Kernel Version Different Fromthe Base Kernel?

Mar 12, 2009

The RHEL 4 update 7 installation CD installs the kernel with version 2.6.9-78.EL and therefore must contain corresponding vmlinuz and initrd.img. However I would like to have an all modules initrd that is used during installation but for a different version (2.6.9-78.0.13.EL). Is there a way in which I could obtain/make such an initrd?

View 3 Replies View Related

Programming :: File/directory Operations In C?

May 5, 2010

How do you do things like list directory contents, mov/copy files, make directoriestc. in C?

View 1 Replies View Related

Programming :: Motif Program Crashes When Performing Drag And Drop?

Jul 26, 2011

We have an application which allows user to perform Drag and Drop operations. The problem we are facing now is the application crash. System works fine for some time and allows user to perform many drag drops successfully. But after running for some time and user perform a drag and drop the system crashes.Following stack trace we are getting while system crashes.

XtDispatchEvent [Event.c]
RemoveAllPMgr [libXm.so.3]
XtCallCallbackList [Callback.c]

[code]....

View 1 Replies View Related

Programming :: Mount/umount Operations In C Program?

Feb 9, 2011

I need to do mount/umount operations in my c program. But my program can only be run under normal user. However, the user who run my program have sudo priviledges to do mount/umount operations. How can i apply the sudo privileges in the mount(2) system call?

View 6 Replies View Related

Programming :: Unable To Store Multiple Sed Operations Using Pipe In A Variable / Fix It?

Jun 2, 2011

I am not able to execute a multiple sed statement using pipe filters in a variable. i am trying to extract a path from a file and then working on that path to change a few letters within the path by going through another sed statement.

the code looks like this code...

View 2 Replies View Related

Ubuntu Installation :: Inconsistent Filesystem Structure After Kernel Upgrade

Nov 20, 2010

I can't boot the 2.6.35-22 kernel, since I get the "Error 16: Inconsistent filesystem structure" every time. However, the previous kernel I have installed, 2.6.32-25, is booting without a problem, so I'm forced to use that until this problem is solved. What can I do?

View 2 Replies View Related

Programming :: C - How To Malloc For A Structure

Mar 7, 2010

How do you malloc a struct in C? I have a structure of the form:

Code:
typedef struct child_req_to_parent
{

[code]...

View 5 Replies View Related

Programming :: Initializing A Structure To Zero?

Nov 20, 2009

I have a struct (small instance so not using code brackets )

struct random {
int a;
int b;
}example;

What i am trying is

example={0,0};

and it gives an error how to initialize all the entries within a struct to zero? In the above example i have used integers but what if they are some other data structure for example another structure?

View 2 Replies View Related

Programming :: Structure Of PCI ID Not Clear?

Nov 2, 2010

I am learning Kernel Programming these days I came across a structure

Code:
static DEFINE_PCI_DEVICE_TABLE(rtl8139_pci_tbl) = {
{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },

[Code]...

View 5 Replies View Related

Programming :: Structure Of The Main Function In C?

Sep 22, 2010

I have started learning C and am following Ivor Horton's "Beginning C - From Novice to Professional". I've noticed that in the book the structure of the main function is:

int main (void) however on the internet I found a lot of cases: void main (void)Which one is preferred and why?

View 5 Replies View Related

Programming :: Access In-memory Structure And Its Members?

Dec 13, 2010

I am implementing c program to access ext3 file system's metadata. I want to know how to access members of the in-memory superblock structure. I am able access on-disk ext3_super_block structure but dont know how to access in- memory structure and its members.

View 1 Replies View Related

Programming :: Data Structure To Manage Memory?

Oct 1, 2010

I have a mxn matric (which is my simplified way of saying it is RAM with bytes on it) Some of the locations on this metric is filled with some data and some places are empty. The mxn are very big numbers in size. I am trying to make a program so that if a system call wants to write some thing on empty locations on this mxn metric it should be able to do so without any problem. The thing which I want to understand or logic of a data structure is what data structure do you people feel should I be maintaining so that I can allocate the requested space immediately from the above mxn matric when some system call requests for some (k) number of locations from above metrics.

The logic initially I thought was to maintain a hashtable

1bytes requested----------> location 1,location 2,location 3.........location n
2bytes requested----------> location 1,location 2,location 3.........location n
3bytes requested----------> location 1,location 2,location 3.........location n

[code]....

but the problem with above logic is size of the pointers where I will be writing this problem is unsigned 64 byte.So to know location of one free byte if I am maintaining one pointer of type u64 this is not a feasible solution.

View 6 Replies View Related

Programming :: Define A Structure Node In Graph?

Oct 27, 2010

I wanted to implement a graph.By graph I mean to say that I am writing programs for BFS,DFS and other such stuff and want to see them in action. For this I started writing a program.The first entry point is to define a graph. I took a pen and paper and made a graph. Now to be able to code this in C.I defined a structure but I am finding problem in defining this structure. I looked into Google and came across incidence list and adjacency list representation [URL] after understanding that I am not able to understand how do I define my structure that would be a node in graph. Here is what my graph looks like

Quote:

|-----------31
| |
| 2---4---6---8
| |

[code]....

View 3 Replies View Related

Programming :: Structure Pointing To Character Array

Aug 9, 2010

I am currently writing a program using raw sockets. This program is used to send out ARP reply frames. The problem that I have is that I do not seem to be able to fill out a structure that is pointing to part of a character array.

Code:
struct eth_header *eth;
struct arp_header *arp;
char buf[8];
eth = (struct eth_header *)buf;
arp = (struct arp_header *)(buf+sizeof(struct arp_header));

Whilst I can fill out the variables of eth, I cannot fill out the variables of arp. If I fill them out and then send the contents of the array using send to, only the first structure (the ethernet header) is sent out. The rest of the data appears to be the original junk data in the array. I have checked the address of the structure pointer and it is pointing to the right place in the array. If I write a raw sockets program that uses an IP header struct and TCP header struct I can point these into the array and write to both of them without any issues.

The difference here is that the call to socket is different:
Code:
/* For ethernet */
fd = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ARP));
/* For IP */
fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);

If I just create one structure containing all of the variables needed this gets around the issue, however, I would like to know what I am doing wrong in the first instance.

View 7 Replies View Related

Programming :: Data Structure For Implementing A Text Editor?

Nov 15, 2010

Options:A double linked list with fixed size character arrays. New nodes will be added when previous ones get filled. Dynamic arrays using realloc(). Linked list has the disadvantage of not having an O(1) search like an array but I think using realloc() will be more dangerous since it moves the whole block to a new location and if the new location is not big enough to hold the whole block, realloc fails !! this case will not occur with the linked list since its nodes are scattered.

View 14 Replies View Related

Programming :: C++ - Store A Text File In A Data Structure?

May 25, 2009

I am writting a program that reads a text file (music.txt) & stores it in a Data Structure. I am a novice learning over the internet so I this is something I have never done. How do I do this?

Quote:

Write a program that reads the data from the music.txt file and store it in a data structure. To implement this data structure you must use an array of songs and each song must be represented by a struct with appropriate fields. So far all I can do is open to file to read it (very simple I know) but so far is it correct?

Code:

#include <iostream>
#include <fstream>
#include <strstream>

[code]....

View 3 Replies View Related

Programming :: Ctime() On Ut_tv.tv_sec Of Utmp Structure?

Jul 30, 2010

I'm using ubuntu9.10 (x86_64) and have some code,

Code:
void show_utmp(struct utmp* ent)
{
time_t tmp;
if (ent->ut_type != USER_PROCESS)
return;

[Code]....

View 8 Replies View Related

Programming :: Disable Structure Alignment Using Gcc Compiler Options?

Jan 25, 2010

How can I disable structure alignment feature of gcc using command-line options ?I recently migrated to 64-bit OS, and doubt that I might be experiencing a structure alignment problem due to the new 64-bit architecture.I checked the sizes of the same C-style struct in both x86 and x86_64, and found out that they appear to be different by 20 bytes.I am not sure if this is due to structure alignment or the differences in data type lengths between two platforms.Hence, I will first disable the structure alignment feature, and then check the struct sizes again.

View 3 Replies View Related

Programming :: Compiling Recursive Makefile In Directory Structure

May 18, 2011

I'm having problems with compiling recursive Makefiles in my directory structure:
My folder layout is:
top/|- one/|- one.c (With main function)|- zero.c|- two/|- two.cin my top folder the make file looks like:

Code:
MAKE_DIRECTORIES = one two
.PHONY: all
all: $(MAKE_DIRECTORIES)

.PHONY: $(MAKE_DIRECTORIES)
$(MAKE_DIRECTORIES):
@echo $@
$(MAKE) --directory=$@
in my one and two folder I have the following Makefile:

Code:
.PHONE: all
all:
@echo $@
$(CC) $(CFLAGS) *.c
But when I compile it from top folder: make

I get following output:
Code:
one
two
Which states that directory statement by echo in main Makefile is ok but the files are not compiled in one and two.

View 5 Replies View Related

Programming :: Using Rsync To Copy Only Certain Folders Within A Directory Structure?

Jun 15, 2011

I am trying to create a simple bash script to rsync some folders within a directory stucture. I am using wild cards, in the rsync source directory structure, but my command always fails. I believe it is the way I am using wild cards within my for loop. Here is my command ;

Code:

for seq in `cat test.txt` ; do rsync -nvP /folder/folder/folder/folder/folder/**/$seq /folder/folder/folder/ ; done This always fails, where if I do a ls to the destination, to test the path, it always works.

View 5 Replies View Related

Programming :: Book Which Explains System Library Structure In Depth?

Sep 7, 2010

Has any one ever come across a book on Linux programming which explains a Library structure in depth?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved