From: "Rafael Sisto" <rafael.sisto@gmail.com>
To: "Rafael Sisto" <rafael.sisto@gmail.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
"Linux kernel" <linux-kernel@vger.kernel.org>
Subject: Re: new file in kernel.
Date: Sat, 19 Jan 2008 11:57:29 -0300 [thread overview]
Message-ID: <ee3dc96c0801190657x54edb8cve8a4c09a6efbbb2a@mail.gmail.com> (raw)
In-Reply-To: <20080119143051.GB9896@lug-owl.de>
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:
> On Sat, 2008-01-19 11:21:11 -0300, Rafael Sisto <rafael.sisto@gmail.com> wrote:
> > Dear Arnaldo, I didnt see your mail before.
> > I read some of the code you suggested, but it seems so complicated! I
> > just need to create a file named "file" on the path /tmp/.. Isn't
> > there an easier way?
>
> In my opinion, you're heading totally into the wrong direction. Nobody
> will help you solving your problem with a given fixed method (file
> accessing in kernel mode) unless you describe your problem in detail.
>
> There's probably a much better and cleaner way. But unless you
> describe your application and the overall goal in detail, please don't
> expect too much help.
>
> MfG, JBG
>
> --
> Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
> Signature of: Wenn ich wach bin, träume ich.
> the second :
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHkgmbHb1edYOZ4bsRAmvTAJ0RXMAnOfFUApNNaPO7Gl+pdkrUvwCcDsJd
> +hpuhG9WunLb5rIAlwvWP6Q=
> =Orr2
> -----END PGP SIGNATURE-----
>
>
next prev parent reply other threads:[~2008-01-19 14:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-19 13:42 Rafael Sisto
2008-01-19 13:48 ` Arnaldo Carvalho de Melo
2008-01-19 14:21 ` Rafael Sisto
2008-01-19 14:30 ` Jan-Benedict Glaw
2008-01-19 14:57 ` Rafael Sisto [this message]
2008-01-19 15:26 ` Stefan Richter
2008-01-19 16:15 ` Rafael Sisto
2008-01-19 16:23 ` Arnaldo Carvalho de Melo
2008-01-19 17:57 ` Stefan Richter
2008-01-19 13:49 ` Jan Engelhardt
2008-01-19 14:08 ` Rafael Sisto
2008-01-19 14:30 ` Jan Engelhardt
2008-01-19 15:12 ` Rafael Sisto
2008-01-20 1:29 ` Jan-Benedict Glaw
2008-01-21 13:00 ` Rafael Sisto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee3dc96c0801190657x54edb8cve8a4c09a6efbbb2a@mail.gmail.com \
--to=rafael.sisto@gmail.com \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome