mouse commands

2010-11-18 Thread Bond
Hi,as mentioned on this link
http://books.google.co.in/books?id=Boo57V0IOq0Cpg=PA140lpg=PA140dq=xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.csource=blots=pwIuaVO7T5sig=qcB-fhT4qb0M36BYvf2CM3uNYFohl=enei=be3kTKS6D47fcZKxoeUKsa=Xoi=book_resultct=resultresnum=3ved=0CCUQ6AEwAg#v=onepageq=xc%2Fprograms%2FXserver%2Fhw%2Fxfree86%2Fos-support%2Fshared%2Fposix_tty.cf=false
the author mentions a code snippet
what are the commands passed to mouse to which he is trying to explain
poll ,select system calls.

-- 
http://vger.kernel.org/vger-lists.html

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



[OOT] Core Duo: closer as Pentium M or Pentium 4 architecture

2010-11-18 Thread Mulyadi Santosa
Dear all

As the subject says, I wanna make it clear. According to
http://en.wikipedia.org/wiki/Intel_Core, it seems that Core Duo use
the same core as Pentium M, that's Yonah. However, looking at the
timeline of the product release, I would expect it's somewhat a slight
modified version of Pentium 4.

So, which one is right? I asked this because I wanna optimize my
kernel optimization with the hope of reducing power consumption as
much as possible in kernel space (besides the no_hz and ticks
frequency etc of course).

Thanks in advance..

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: mouse commands

2010-11-18 Thread Mulyadi Santosa
On Thu, Nov 18, 2010 at 16:13, Bond jamesbond.2...@gmail.com wrote:
 Hi,as mentioned on this link

It's unreadable, at least in my side. I think the best way here is to
just paste the code here or somewhere like pastebin.com

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



structure for Super IO chip detection

2010-11-18 Thread Bond
On this link
http://lxr.free-electrons.com/source/drivers/parport/parport_pc.c?v=2.6.29#L97
they defined a structure superio_struct and initialized as

superios[NR_SUPERIOS] = { {0,},};
I am not able to understand above initialization has what is it
getting initialized to.

What I deduce till now is superios is a structure array of struct superio_struct
and NR_SUPERIOS is defined as 3 hence an array of structure of size 3
but
superios[0]=??
superios[1]=??
superios[2]=??


I had a look at following links
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/designators.htm
http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
https://www.acrc.bris.ac.uk/RedHat/rhel-gcc-en-4/designated-inits.html
also checked the C books available with me.

This part is not clear to me as to what these individual members are
initialized to.
-- 
http://vger.kernel.org/vger-lists.html

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: mouse commands

2010-11-18 Thread Mulyadi Santosa
On Thu, Nov 18, 2010 at 20:24, Bond jamesbond.2...@gmail.com wrote:
 and the portion I asked
 http://pastebin.com/j0tK0jGW

It seems to me like this:
1. Send E , 5 , E then 5 consecutively

2. Write it serially as mouse is categorized as char device.

3. Wait for inputquite likely it's using poll() underneath..

4. If there's indeed input (in buffer) read it...I think it just read
1 byte. If there no input, break the loop altogether.

5. Back to (1).

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



RE: hi

2010-11-18 Thread Viral Mehta
Seems like kernelnewbies is becoming more popular than Google
It looks like some Google Query which showed up in kernel list :D


From: kernelnewbies-bou...@nl.linux.org [kernelnewbies-bou...@nl.linux.org] On 
Behalf Of nidhi mittal hada [nidhimitta...@gmail.com]
Sent: Thursday, November 18, 2010 1:16 PM
To: Robert P. J. Day
Cc: Mulyadi Santosa; navatha reddy; kernelnewbies@nl.linux.org; Manish Katiyar
Subject: Re: hi

is this usb filesystem...
http://tali.admingilde.org/linux-docbook/usb/ch07.html



On Thu, Nov 18, 2010 at 12:36 PM, Robert P. J. Day
rpj...@crashcourse.ca wrote:
 On Thu, 18 Nov 2010, Mulyadi Santosa wrote:

 On Thu, Nov 18, 2010 at 13:12, navatha reddy navat...@gmail.com wrote:
  Hi,
   plz send the information about file system.its not supporting the
  usb file system without ext2 and ext3.

 guys, have we ever heard usb filesystem? Or is this Reddy is talking
 about something that we need deep meditation first?

  might be the deprecated USB filesystem:

 http://cateee.net/lkddb/web-lkddb/USB_DEVICEFS.html

 rday

 --

 
 Robert P. J. Day   Waterloo, Ontario, CANADA
http://crashcourse.ca

 Twitter:   http://twitter.com/rpjday
 LinkedIn:   http://ca.linkedin.com/in/rpjday
 



--
Thanks  Regards
Nidhi Mittal Hada
Scientific officer D
Computer Division
Bhabha Atomic Research Center
Mumbai

http://nidhi-searchingmyself.blogspot.com/
?��칻?��~��?��+-���jw�j)p��n�˛���m�?�w���?��-��?�ج�Yb��h�?�y�?�杶?�??���i��?�w���?��(�?�?

__

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

__


Re: structure for Super IO chip detection

2010-11-18 Thread hiren panchasara
On Thu, Nov 18, 2010 at 5:47 AM, Bond jamesbond.2...@gmail.com wrote:

 On this link

 http://lxr.free-electrons.com/source/drivers/parport/parport_pc.c?v=2.6.29#L97
 they defined a structure superio_struct and initialized as

 superios[NR_SUPERIOS] = { {0,},};
 I am not able to understand above initialization has what is it
 getting initialized to.


Please put it into a small c prog and try it yourself. You will come to know
in a minute.

Thanks,
Hiren


Re: hi

2010-11-18 Thread Carlo Caione

On Nov 18, 2010, at 5:23 PM, Viral Mehta wrote:

 Seems like kernelnewbies is becoming more popular than Google
 It looks like some Google Query which showed up in kernel list :D

+1 :)

--
Carlo Caione
PhD student - University of Bologna
Dept. of Electronics, Computer Science and Systems (DEIS)

carlo.cai...@gmail.com
carlo.cai...@unibo.it

skype: lyapunov84
mobile: +39 340 8030096






--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: hi

2010-11-18 Thread Anuz Pratap Singh Tomar
On Thu, Nov 18, 2010 at 6:46 PM, Carlo Caione carlo.cai...@gmail.comwrote:


 On Nov 18, 2010, at 5:23 PM, Viral Mehta wrote:

  Seems like kernelnewbies is becoming more popular than Google
  It looks like some Google Query which showed up in kernel list :D

 +1 :)


I guess as soon as someone subscribes to mailing list, s/he should be sent
with some guidelines, which can prevent this from happening.
good idea would be  if we can make a list of such dos and do-nots.


RE: hi

2010-11-18 Thread Viral Mehta
On Thu, Nov 18, 2010 at 6:46 PM, Carlo Caione 
carlo.cai...@gmail.commailto:carlo.cai...@gmail.com wrote:
I guess as soon as someone subscribes to mailing list, s/he should be sent 
with some guidelines, which can prevent this from happening.
good idea would be  if we can make a list of such dos and do-nots.


http://kernelnewbies.org/FAQ
http://www.catb.org/~esr/faqs/smart-questions.html


This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

__

Re: hi

2010-11-18 Thread John Mahoney
On Thu, Nov 18, 2010 at 1:57 PM, Anuz Pratap Singh Tomar
chambilketha...@gmail.com wrote:



 On Thu, Nov 18, 2010 at 6:46 PM, Carlo Caione carlo.cai...@gmail.com
 wrote:

 On Nov 18, 2010, at 5:23 PM, Viral Mehta wrote:

  Seems like kernelnewbies is becoming more popular than Google
  It looks like some Google Query which showed up in kernel list :D

 +1 :)


 I guess as soon as someone subscribes to mailing list, s/he should be sent
 with some guidelines, which can prevent this from happening.
 good idea would be  if we can make a list of such dos and do-nots.


I like the idea of subscribers being sent a link to a faq/guidellines
when they join.  Yet, this question to me is just poorly worded and i
do not know what the person is even asking.

I saw it as two possible questions.
1.  If I have a usb thumb drive and I want to mount it on linux what
filesystem should I format it to?
or
2.  how do i mount usbfs?(http://www.linux-usb.org/USB-guide/x173.html)

Maybe a guideline of writing clear  and concise questions would be useful

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



RE: hi

2010-11-18 Thread Tayade, Nilesh
From: kernelnewbies-bou...@nl.linux.org 
[mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Anuz Pratap 

 On Thu, Nov 18, 2010 at 6:46 PM, Carlo Caione carlo.cai...@gmail.com wrote:

 On Nov 18, 2010, at 5:23 PM, Viral Mehta wrote:

 Seems like kernelnewbies is becoming more popular than Google
 It looks like some Google Query which showed up in kernel list :D

 +1 :)
 
 I guess as soon as someone subscribes to mailing list, s/he should be sent 
 with some guidelines, which can prevent this from happening. 
 good idea would be  if we can make a list of such dos and do-nots.  

Guess we already have the link describing the common etiquettes.
http://www.tux.org/lkml/#s3 - Partially applicable to our list as well.

Also as Mulyadi pointed out: http://www.catb.org/esr/faqs/smart-questions.html.

--
Thanks,
Nilesh

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Why time() and gettimeofday() can return different values

2010-11-18 Thread Adrian Cornish
Hi all,

The following code will exit (in a few seconds usually) - which I would
expect it not too. Since gettimeofday is called before time(). Obviously
this is compiled without optimization.

I traced this through to the different syscall's implementations of
time() and gettimeofday() in the kernel. 

They both use the same timer (xtime) but gettimeofday() calls
getnstimeofday() which calls timespec_add_ns(), which can modify the
seconds portion of timespec struct. I dont understand why
getnstimeofday() uses a loop and then adds on nanoseconds to the result?

Any insight greatly appreciated :-)

Adrian Cornish


static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
{
   a-tv_sec += __iter_div_u64_rem(a-tv_nsec + ns, NSEC_PER_SEC, ns);
   a-tv_nsec = ns;
}


void do_gettimeofday(struct timeval *tv)
{
   struct timespec now;

   getnstimeofday(now);
   tv-tv_sec = now.tv_sec;
   tv-tv_usec = now.tv_nsec/1000;
}

void getnstimeofday(struct timespec *ts)
{
   unsigned long seq;
   s64 nsecs;

   WARN_ON(timekeeping_suspended);

   do {
  seq = read_seqbegin(xtime_lock);

  *ts = xtime;
  nsecs = timekeeping_get_ns();

  /* If arch requires, add in gettimeoffset() */
  nsecs += arch_gettimeoffset();

   } while (read_seqretry(xtime_lock, seq));

   timespec_add_ns(ts, nsecs);
}

My example code
#include iostream
#include sys/time.h
#include time.h

int main(void)
{
   time_t t;
   timeval tv;
   size_t difference=0;
   for(;;)
   {
  gettimeofday(tv, 0);
  t=time(0);
  if(ttv.tv_sec)
  {
 std::cout  Different   ++difference   times t=  t
  tv.tv_sec=  tv.tv_sec  std::endl;
 break;
  }
   }
   return 0;
}



--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: Why time() and gettimeofday() can return different values

2010-11-18 Thread Mulyadi Santosa
Hi... :)

On Fri, Nov 19, 2010 at 02:56, Adrian Cornish adri...@cqg.com wrote:
 Hi all,

 The following code will exit (in a few seconds usually) - which I would
 expect it not too. Since gettimeofday is called before time(). Obviously
 this is compiled without optimization.

IMO, if both are really fetching time from clock source like RTC, then
it might take long..however, the reality in kernel code, AFAIK, it's
not like that. It's more like jiffies plus ...I could say, fuzzy
factor. Jiffies itself, in turn, is updated only every 1/HZ seconds.
This could be less when we use no_hz...

 They both use the same timer (xtime) but gettimeofday() calls
 getnstimeofday() which calls timespec_add_ns(), which can modify the
 seconds portion of timespec struct. I dont understand why
 getnstimeofday() uses a loop and then adds on nanoseconds to the result?

I can only provide some rough guess:

as I said above, it adds some fuzz factor. And IMO, this is not a
random number. I dare to guess it's calculated time to time as a
representation of clock difference (or shall I say, clock drift?)
between one updated every 1/HZ and the real clock in RTC. AFAIK
fetching time directly RTC is an expensive operation (meaning: needs
many cpu cycles), thus it would be wiser to just use updated jiffies.

As to why it needs to do it repeatedly? That I don't really know.
Likely, it is done more than once since the time value we read might
be a value that is updated in flight. Thus, to be sure, we read
multiple times. AFAIK seq lock is unblocking lock, thus to avoid
contention over several reader that might need time read too.

Hopefully I am offering logical explanation...all above are purely my
interpretation based directly from code reading.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: hi

2010-11-18 Thread Anuz Pratap Singh Tomar
On Thu, Nov 18, 2010 at 7:05 PM, Viral Mehta viral.me...@lntinfotech.comwrote:

  On Thu, Nov 18, 2010 at 6:46 PM, Carlo Caione carlo.cai...@gmail.comwrote:
   I guess as soon as someone subscribes to mailing list, s/he should be
 sent with some guidelines, which can prevent this from happening.
 good idea would be  if we can make a list of such dos and do-nots.


 http://kernelnewbies.org/FAQ
 http://www.catb.org/~esr/faqs/smart-questions.htmlhttp://www.catb.org/%7Eesr/faqs/smart-questions.html


I am am member of this community for long enough to know this already. btw,
i sent that very same link previously to some new user asking very generic
question about probe.
but my point is to send this to anyone who joins it.
Besides these FAQs are old and not updated. And there is nothing specific to
what this mailing list should actually address.
This community is generally more accommodative than most mailing list, but
sometime question are not even well thought or searched.

mail subject likes  like

help
probe
hi
just testing

are utter waste, this mailing list generate enough traffic NOW that such
topics are annoying.

Most new users never dig archives, so a lot of question are asked over and
over again.


Re: hi

2010-11-18 Thread Mulyadi Santosa
On Fri, Nov 19, 2010 at 06:57, Anuz Pratap Singh Tomar
chambilketha...@gmail.com wrote:
 I am am member of this community for long enough to know this already. btw,
 i sent that very same link previously to some new user asking very generic
 question about probe.

I suggest to start simple by putting that Eric S Raymond Asking the
question the smart way URL in each mail footer, together with the
Kernelnewbies FAQ's url too.

And a suggestion, again in the footer, as simple as please search it
first in the archieve would help I think.

Other than that, we could start simply replying like the old days e.g
: RTFM, STFW. Or more economically, like Manish has said take a deep
breath Mulyadithen press Delete.

PS: Now I know why Delete button, at least in my HP laptop, is
positioned in upper rightmost :)


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



RE: Why time() and gettimeofday() can return different values

2010-11-18 Thread Adrian Cornish
 From: Mulyadi Santosa [mailto:mulyadi.sant...@gmail.com]
 IMO, if both are really fetching time from clock source like RTC, then
 it might take long..however, the reality in kernel code, AFAIK, it's
 not like that. It's more like jiffies plus ...I could say, fuzzy
 factor. Jiffies itself, in turn, is updated only every 1/HZ seconds.
 This could be less when we use no_hz...
Hi Mulyadi,

What worries me is that sequence of calling gettimeofday() and then
time(), the value returned by gettimeofday() is in the future and in
front of time()'s return value by more than 1,000,000 microseconds. To
me this is unexpected, return value of time() should always equal tv_sec
value from gettimeofday(). Ok I know there is no spec that says that -
just what I would expect.

  They both use the same timer (xtime) but gettimeofday() calls
  getnstimeofday() which calls timespec_add_ns(), which can modify the
  seconds portion of timespec struct. I dont understand why
  getnstimeofday() uses a loop and then adds on nanoseconds to the
result?
 
 I can only provide some rough guess:
 
 as I said above, it adds some fuzz factor. And IMO, this is not a
 random number. I dare to guess it's calculated time to time as a
 representation of clock difference (or shall I say, clock drift?)
 between one updated every 1/HZ and the real clock in RTC. AFAIK
 fetching time directly RTC is an expensive operation (meaning: needs
 many cpu cycles), thus it would be wiser to just use updated jiffies.
 
 As to why it needs to do it repeatedly? That I don't really know.
 Likely, it is done more than once since the time value we read might
 be a value that is updated in flight. Thus, to be sure, we read
 multiple times. AFAIK seq lock is unblocking lock, thus to avoid
 contention over several reader that might need time read too.
 
 Hopefully I am offering logical explanation...all above are purely my
 interpretation based directly from code reading.

Ok so do I have this right (all function comments are mine)
 213void getnstimeofday(struct timespec *ts)
 214{
 215unsigned long seq;
 216s64 nsecs;
 217

No idea on this line - guessing debug/diagnostic
 218WARN_ON(timekeeping_suspended);
 219
 220do {

Ok 1st time here, so here we are trying to get a read-lock on xtime
using the 
 221seq = read_seqbegin(xtime_lock);
 222

So here we copy xtime to ts which cannot be atomic due to the size of
xtime (on x86)
No care is taken if xtime is currrently being update, so in theory ts
could be junk
 223*ts = xtime;

Work out how many nanoseconds has passed since (guessing) xtime was
update but also
include any ntp clock drift corrections (so nsecs  1 second)
 224nsecs = timekeeping_get_ns();
 225

This does nothing on Intel
 226/* If arch requires, add in gettimeoffset() */
 227nsecs += arch_gettimeoffset();
 228

[Guessing] If xtime did not change by now - then we are good to break
out the loop
But if it did then lets go round again.
 229} while (read_seqretry(xtime_lock, seq));
 230

Since it could have taken some time to get a good complete read of
xtime, we better adjust
it for how long we think it took (also applying any NTP movements). So
now we could return a time 
that is greater the xtime's actual value by over a second. 
 231timespec_add_ns(ts, nsecs);
 232}


Adrian

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Why the kernel is located in user space?

2010-11-18 Thread Parmenides
Hi,

   According to ULK 3rd edition, the kernel stack is located in user
space, such as a linear address of 0x015fa000。As far as this situation
is concerned, I have several questions.

1. Now that the kernel stack is used by the kernel code, why isn't it
allocated in the kernel space?
2. For the kernel code, is it feasible to the use the user stack? Why
do we bother to switch to the kernel stack?
3. What's the difference between the user space and the kernel space on earth?

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



A question regarding GIT

2010-11-18 Thread Rahul Ramasubramanian
Hi ,
I had a query regarding git usage
i am trying to clone a specific branch from a repo. I am following the
instructions from this site
http://www.linux-arm.org/LinuxKernel/LinuxAndroidPlatform(
patching the kernel subsection)
But when i try to clone
http://linux-arm.org/git?p=linux-2.6-stable.git;a=summary
using the following command
 http://linux-arm.org/linux-2.6-stable.git
I dont find the required branch ( it is named 2.6.33-armdroid) . The
git branch shows only 1 branch.
There seems to be another project called armdroid , but that does not
have the sources , it just has few patches and prebuilt images.

So my question is , how do i clone the correct project and then switch
to the correct branch.
Hope my question is clear.

Thanks in advance for the replies
Regards
Rahul

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: Why time() and gettimeofday() can return different values

2010-11-18 Thread Mulyadi Santosa
Hi :)

On Fri, Nov 19, 2010 at 10:00, Adrian Cornish adri...@cqg.com wrote:
 Hi Mulyadi,

 What worries me is that sequence of calling gettimeofday() and then
 time(), the value returned by gettimeofday() is in the future and in
 front of time()'s return value by more than 1,000,000 microseconds. To
 me this is unexpected, return value of time() should always equal tv_sec
 value from gettimeofday(). Ok I know there is no spec that says that -
 just what I would expect.

Perhaps there is something in POSIX specs regarding those functions
that I don't really know. But Linux doesn't always follow POSIX after
all, in few cases...

 Ok 1st time here, so here we are trying to get a read-lock on xtime
 using the
  221                seq = read_seqbegin(xtime_lock);
  222

 So here we copy xtime to ts which cannot be atomic due to the size of
 xtime (on x86)
 No care is taken if xtime is currrently being update, so in theory ts
 could be junk
  223                *ts = xtime;

 Work out how many nanoseconds has passed since (guessing) xtime was
 update but also
 include any ntp clock drift corrections (so nsecs  1 second)
  224                nsecs = timekeeping_get_ns();
  225

 This does nothing on Intel
  226                /* If arch requires, add in gettimeoffset() */
  227                nsecs += arch_gettimeoffset();
  228

 [Guessing] If xtime did not change by now - then we are good to break
 out the loop
 But if it did then lets go round again.
  229        } while (read_seqretry(xtime_lock, seq));
  230

 Since it could have taken some time to get a good complete read of
 xtime, we better adjust
 it for how long we think it took (also applying any NTP movements). So
 now we could return a time
 that is greater the xtime's actual value by over a second.
  231        timespec_add_ns(ts, nsecs);
  232}


I am fairly agree with your above code commenting.

In fact, I suggest you to send a patch, simply to add commentaries
among those codes to LKML. Who knows, it helps lots of other people to
understand that function too? And it might invite further comments,
hopefully to optimize the function

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: Why the kernel is located in user space?

2010-11-18 Thread Venkatram Tummala
2010/11/18 Parmenides mobile.parmeni...@gmail.com

 Hi,

   According to ULK 3rd edition, the kernel stack is located in user
 space, such as a linear address of 0x015fa000。


Not Quite. For each process, there are 2 stacks - User Stack  a Kernel
Stack . This Per-Process kernel stack is located in the data segment of the
kernel. It is not located in the user space as you understood. When a
process switches to kernel mode, the hardware segmentation registers cs(code
segment)  ds(data segment) are set to __KERNEL_CS  __KERNEL_DS
respectively. Hence, depending on whether the process is executing in the
user mode or kernel mode, the user stack or kernel stack is found according
to the current value of the DS segmentation register.

As far as this situation
 is concerned, I have several questions.

 1. Now that the kernel stack is used by the kernel code, why isn't it
 allocated in the kernel space?

Question is based on a wrong assumption of yours. Kernel stack is in the
kernel data segment.

2. For the kernel code, is it feasible to the use the user stack? Why
 do we bother to switch to the kernel stack?

The answer is Yes, you could. But it would be pretty messy  inconvenient.
We just don't do it in the linux kernel atleast on x86. Kernel Data Segment
 User Data Segment is different. I guess you could just map the user space
stack in the kernel address space too  use it. Using two seperate stacks is
just more efficient  convenient.

3. What's the difference between the user space and the kernel space on
 earth?

Well, i guess this question should have been at the top. Before you can
understand the difference between user space stack  kernel space stack, you
have to know the difference between user space  kernel space. How could you
ask questions 1  2 without knowing 3??  Well, i am not sure about the
earth but i can tell you the difference in a computer. :))) .

x86 processor supports multiple privilege levels. The kernel runs in ring 0
(most privilaged) and the user space runs in ring 3(least privileged). There
are certain instructions which you can execute only in the
privileged(kernel) mode. O'wise that instruction will result in a trap.
cli is an example of such instruction (used for disabling interrupts). So,
applications programs run in unprivilaged mode  hence only execute
instructions which no other process needs to know about. For ex. if you
concat two strings, nobody else needs to know about it. On the other hand,
if you want to execute any instruction like cli or reading from file or
using a device, you have to goto the kernel which acts as the mediator for
all processes. Thats why have Operating systems -  Thats why we have user
mode  kernel mode.

Venkatram Tummala


 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to ecar...@nl.linux.org
 Please read the FAQ at http://kernelnewbies.org/FAQ




Re: hi

2010-11-18 Thread Vimal
This discussion might be relevant:

  http://news.ycombinator.com/item?id=1886310

-- 
Vimal

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: structure for Super IO chip detection

2010-11-18 Thread Bond
On Thu, Nov 18, 2010 at 10:56 PM, hiren panchasara
hiren.panchas...@gmail.com wrote:
 Please put it into a small c prog and try it yourself. You will come to know
 in a minute.
I am not able to understand what program do I make to put thats why I asked.

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: A question regarding GIT

2010-11-18 Thread Mandeep Sandhu
This question might be OT here! :) More suited for GIT discussion forum.

To see remote branches, try 'git branch -r' not just 'git branch'.

For checking out a specific branch, use 'git checkout -b local
branch remote branch as shown in git branch -r o/p

HTH,
-mandeep


On Fri, Nov 19, 2010 at 9:03 AM, Rahul Ramasubramanian
ramasubramanian.ra...@gmail.com wrote:
 Hi ,
 I had a query regarding git usage
 i am trying to clone a specific branch from a repo. I am following the
 instructions from this site
 http://www.linux-arm.org/LinuxKernel/LinuxAndroidPlatform    (
 patching the kernel subsection)
 But when i try to clone
 http://linux-arm.org/git?p=linux-2.6-stable.git;a=summary
 using the following command
  http://linux-arm.org/linux-2.6-stable.git
 I dont find the required branch ( it is named 2.6.33-armdroid) . The
 git branch shows only 1 branch.
 There seems to be another project called armdroid , but that does not
 have the sources , it just has few patches and prebuilt images.

 So my question is , how do i clone the correct project and then switch
 to the correct branch.
 Hope my question is clear.

 Thanks in advance for the replies
 Regards
 Rahul

 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to ecar...@nl.linux.org
 Please read the FAQ at http://kernelnewbies.org/FAQ



--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: structure for Super IO chip detection

2010-11-18 Thread hiren panchasara
On Thu, Nov 18, 2010 at 9:58 PM, Bond jamesbond.2...@gmail.com wrote:

 On Thu, Nov 18, 2010 at 10:56 PM, hiren panchasara
 hiren.panchas...@gmail.com wrote:
  Please put it into a small c prog and try it yourself. You will come to
 know
  in a minute.
 I am not able to understand what program do I make to put thats why I
 asked.


A simple C program with only 2 things:
1) structure that you are confused about - simply copy and paste
2) printf statement to see how values are assigned.

Now change the value in 1) while initializing the structure and repeat.

You should be able to find how structures are declared/defined/used in any
good C programming book.

Thanks,
Hiren


Re: hi

2010-11-18 Thread Mulyadi Santosa
On Fri, Nov 19, 2010 at 12:43, Vimal j.vi...@gmail.com wrote:
 This discussion might be relevant:

  http://news.ycombinator.com/item?id=1886310

Thanks for sharing the URL :) In that matter, Indonesia (my country)
is also the same... and here, I dare to point my finger, it's due to
high competition but also high laziness among students. They go to CS
but they don't really want to study CS. So, how would that be?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: structure for Super IO chip detection

2010-11-18 Thread Tapas Mishra
On Fri, Nov 19, 2010 at 12:27 PM, hiren panchasara
hiren.panchas...@gmail.com wrote:
 You should be able to find how structures are declared/defined/used in any
 good C programming book.
I doubt if such a thing is mentioned on any good C book.
Coming to OP's question.You need to know to understand this is that,
in C/C++, if you initialise part of an array or struct, i.e. supply
fewer initialisation values than there are elements, then the
remainder of the elements in the array/struct are initialised to 0.
So, in this case, if you just initialise the first element to 0, then
you are effectively initialising all elements to 0. This is what's
happening in the example above, except that it's an array of structs,
hence the double { }
superios[NR_SUPERIOS] = { { 0 } };
The code should not have been done
superios[NR_SUPERIOS] = { { 0 ,}, };
These commas are redundant and all compilers will not support it.

-- 
http://mightydreams.blogspot.com

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ