kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: daniel.baluta@gmail.com (Daniel Baluta)
To: kernelnewbies@lists.kernelnewbies.org
Subject: char driver error
Date: Mon, 9 May 2011 15:08:34 +0300	[thread overview]
Message-ID: <BANLkTinpect1he7AVao=KV8rkP01_-M1bg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimAH6msz3YAt99RWPF=hOqWk6LkfQ@mail.gmail.com>

OK. See how write and read works.

> $strace echo -n "abcd" > /dev/memory(/home/aravind/me
> write(1, "abcd", 4) ? ? ? ? ? ? ? ? ? ? = 1
> write(1, "bcd", 3) ? ? ? ? ? ? ? ? ? ? ?= 1
> write(1, "cd", 2) ? ? ? ? ? ? ? ? ? ? ? = 1
> write(1, "d", 1) ? ? ? ? ? ? ? ? ? ? ? ?= 1

>$ strace cat /dev/memory(/home/aravind/memory)

> read(3, "d", 32768) ? ? ? ? ? ? ? ? ? ? = 1
> write(1, "d", 1d) ? ? ? ? ? ? ? ? ? ? ? ?= 1

Please allocate space for more than 1 char, and also
correct memory_write

  tmp=buf+count-1; -> tmp=buf+*f_ps-1;

thanks,
Daniel.

  parent reply	other threads:[~2011-05-09 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 11:26 char driver error Aravind Vijayan
2011-05-09 11:33 ` Manohar Vanga
     [not found]   ` <BANLkTimiQg3WmVRC1rOVK0+S_W095r_3Jg@mail.gmail.com>
2011-05-09 12:04     ` Manohar Vanga
2011-05-09 11:35 ` Daniel Baluta
     [not found]   ` <BANLkTimAH6msz3YAt99RWPF=hOqWk6LkfQ@mail.gmail.com>
2011-05-09 12:08     ` Daniel Baluta [this message]
2011-05-09 12:06 ` Vikash Kumar

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='BANLkTinpect1he7AVao=KV8rkP01_-M1bg@mail.gmail.com' \
    --to=daniel.baluta@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).