Re: new file in kernel.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rafael Sisto <rafael.sisto@...>, Arnaldo Carvalho de Melo <acme@...>, Linux kernel <linux-kernel@...>
Date: Saturday, January 19, 2008 - 10:57 am

Dear Jan,
I wrote a mail 10 hours ago with the subject "create a file in kernel
mode. help please!" explaining what I want to do but nobody answered,
so I decided to write a short mail with a specific question.

I don't doubt there's a much cleaner and better way to do it, because
I am a beginner in kernel programming...

The thing is, it is for a college project. we have to build something
like IPC, but simpler. we have a "get" system call (we thought we
would just create a file in /tmp, not use it from the kernel, just
create it) and then the users that want to access the shared memory
will call the system call "attach". That will map the file into user
space, as shared.

The problem is that we are not successfuly creating the file, and when
some user calls the system call "attach" and then uses the memory, he
gets a "Bus Error" message. (We tried creating the file not with a
system call, but with "vi", then calling our system call "attach" to
the file created, and it worked fine)

So, my question is how to successfully create a file in kernel mode,
for later use... (I read the implementation of IPC, and it seems they
create a file in tmpfs, on the "get" system call, so my idea was to do
something similar)

I hope it is much clearer now, and would gratefuly accept any answer,
with new ideas, or an approach to make me realise what I am doing
wrong..

Thanks in advance,
Greetings, Rafael Sisto.


On Jan 19, 2008 11:30 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
new file in kernel., Rafael Sisto, (Sat Jan 19, 9:42 am)
Re: new file in kernel., Jan Engelhardt, (Sat Jan 19, 9:49 am)
Re: new file in kernel., Rafael Sisto, (Sat Jan 19, 10:08 am)
Re: new file in kernel., Jan Engelhardt, (Sat Jan 19, 10:30 am)
Re: new file in kernel., Rafael Sisto, (Sat Jan 19, 11:12 am)
Re: new file in kernel., Jan-Benedict Glaw, (Sat Jan 19, 9:29 pm)
Re: new file in kernel., Rafael Sisto, (Mon Jan 21, 9:00 am)
Re: new file in kernel., Arnaldo Carvalho de Melo, (Sat Jan 19, 9:48 am)
Re: new file in kernel., Rafael Sisto, (Sat Jan 19, 10:21 am)
Re: new file in kernel., Jan-Benedict Glaw, (Sat Jan 19, 10:30 am)
Re: new file in kernel., Rafael Sisto, (Sat Jan 19, 10:57 am)
Re: new file in kernel., Stefan Richter, (Sat Jan 19, 11:26 am)
Re: new file in kernel., Rafael Sisto, (Sat Jan 19, 12:15 pm)
Re: new file in kernel., Stefan Richter, (Sat Jan 19, 1:57 pm)
Re: new file in kernel., Arnaldo Carvalho de Melo, (Sat Jan 19, 12:23 pm)