32 bit and 64 bit---- doubt

2008-09-29 Thread nidhi mittal
Hi all
its a very basic ques may be for many of you .but i have this confusion from
long that is.
when we say this application is 32 bit application or 64 bit what do we mean
by that
 is it processor which is 32 bit or 64 bit
or the OS which is is 32 bit or 64 bit
or what ?

2. Does it have some relation that in windows in C language int size is 2
bytes in linux gcc it is 4 bytes
i mean any relation of word size with it ??
-- 
Thanks  Regards
Nidhi


Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread pradeep singh
On Mon, Sep 29, 2008 at 12:42 PM, nidhi mittal [EMAIL PROTECTED] wrote:
 Hi all
 its a very basic ques may be for many of you .but i have this confusion from
 long that is.
 when we say this application is 32 bit application or 64 bit what do we mean
 by that
  is it processor which is 32 bit or 64 bit
 or the OS which is is 32 bit or 64 bit
 or what ?

It means the application can access 2^32 bits of memory i.e 4gigs.And
this means a 64 bit application needs a 64 bit kernel atleast, which
will run on a 64 bit processor. Aliter a 32 bit application can run on
top of either 32 or 64 bit kernel. And a 32 bit kernel can run atop a
32 bit processor or 64 but processor.

 2. Does it have some relation that in windows in C language int size is 2
 bytes in linux gcc it is 4 bytes

No such restriction for C in windows. It is still 4 bytes.

 i mean any relation of word size with it ??
word size is 32 bits on both Windows and Linux.

Cu,
--Pradeep
 --
 Thanks  Regards
 Nidhi




-- 
play the game

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: About Bad Magic Number

2008-09-29 Thread pradeep singh
On Tue, Sep 23, 2008 at 7:27 PM, mayank rana [EMAIL PROTECTED] wrote:
 Hi All,

 I am sending fasync from my driver to user space application.
 While sending fasync, I am getting below error :
 kill_fasync:bad magic number in fasync_struct !

 Can anyone suggest any solution for this ?

You fs superblock seems screwed up.
Run fsck manually with a different back up superblock from the disk.

Cu,
--Pradeep

 Thanks.

 Regards,
 _-_Mayank Rana_-_




-- 
play the game

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread Kalpesh Rathod
Apart from these, following wiki link best describes what makes an
architecture as 64 bit.

http://en.wikipedia.org/wiki/64-bit

On Mon, Sep 29, 2008 at 1:22 PM, pradeep singh [EMAIL PROTECTED]wrote:

 On Mon, Sep 29, 2008 at 12:42 PM, nidhi mittal [EMAIL PROTECTED]
 wrote:
  Hi all
  its a very basic ques may be for many of you .but i have this confusion
 from
  long that is.
  when we say this application is 32 bit application or 64 bit what do we
 mean
  by that
   is it processor which is 32 bit or 64 bit
  or the OS which is is 32 bit or 64 bit
  or what ?

 It means the application can access 2^32 bits of memory i.e 4gigs.And
 this means a 64 bit application needs a 64 bit kernel atleast, which
 will run on a 64 bit processor. Aliter a 32 bit application can run on
 top of either 32 or 64 bit kernel. And a 32 bit kernel can run atop a
 32 bit processor or 64 but processor.

  2. Does it have some relation that in windows in C language int size is 2
  bytes in linux gcc it is 4 bytes

 No such restriction for C in windows. It is still 4 bytes.

  i mean any relation of word size with it ??
 word size is 32 bits on both Windows and Linux.

 Cu,
--Pradeep
  --
  Thanks  Regards
  Nidhi
 



 --
 play the game

 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to [EMAIL PROTECTED]
 Please read the FAQ at http://kernelnewbies.org/FAQ




Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread Bernd Petrovitsch
On Mon, 2008-09-29 at 12:42 +0530, nidhi mittal wrote:
 Hi all 
 its a very basic ques may be for many of you .but i have this
 confusion from long that is.
 when we say this application is 32 bit application or 64 bit what do
 we mean by that 
  is it processor which is 32 bit or 64 bit

Primarily it is that.

 or the OS which is is 32 bit or 64 bit

Secondarily that too. But x86_64/amd64/em64t/intel64 has x86
compatibility (and Sparc64 for Sparc perhaps too).
So can install and run a 64bit kernel and run the whole userspace
compiled for 64bit. Or you can run only 32bit apps/libs in userspace on
64bit kernel (because your apps do not need  4GB address space but you
have 64GB RAM in your hardware).

 or what ?

Basically yes. But x86/64/AMD64/EM64T/... can run x86 32bit apps too (if
the necessary libs are installed).

 2. Does it have some relation that in windows in C language int size

According to the C standard, sizeof(int) is the native register width.
And that is basically defined by the CPU. So if sizeof(int) == 2, you 
probably have some 16bit microcontroller.
And at least for WinNT and XP, sizeof(int) == 4 on normal PCs BTW.

  is 2 bytes in linux gcc it is 4 bytes
 i mean any relation of word size with it ??

Yup.

Bernd
-- 
Firmix Software GmbH   http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
  Embedded Linux Development and Services



--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: About Bad Magic Number

2008-09-29 Thread Erik Mouw
On Mon, 29 Sep 2008 13:24:28 +0530 pradeep singh
[EMAIL PROTECTED] wrote:

 On Tue, Sep 23, 2008 at 7:27 PM, mayank rana [EMAIL PROTECTED] wrote:
  Hi All,
 
  I am sending fasync from my driver to user space application.
  While sending fasync, I am getting below error :
  kill_fasync:bad magic number in fasync_struct !
 
  Can anyone suggest any solution for this ?
 
 You fs superblock seems screwed up.
 Run fsck manually with a different back up superblock from the disk.

While it is true that filesystem superblocks contain magic numbers, it
doesn't imply that every magic number has something to do with
filesystem superblocks. Magic numbers are used throughout the kernel to
check if structures passed to a function are indeed correct: if the
magic number fails, it is a sign that something is wrong with the
structure. It could be corrupted by something, it could also be that
the user forgot to set the number. Without seeing the code, it's hard
to tell what's wrong.


Erik

-- 
Erik Mouw -- [EMAIL PROTECTED]
GPG key fingerprint: D6AC 7F15 A26E C5C4 62E0  4A58 FCF9 551C 9B48 B68D

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



network delay simulation

2008-09-29 Thread Bizhan Gholikhamseh (bgholikh)
Hi all,
Is there a mechanism to simulate random network latencies within kernel?
for example do a net/scheduler or just FIFO delay within network driver?
 
Regards,
Bizhan


Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread Pranav Peshwe
On Mon, Sep 29, 2008 at 2:38 PM, Bernd Petrovitsch [EMAIL PROTECTED] wrote:


 snip


  2. Does it have some relation that in windows in C language int size

 According to the C standard, sizeof(int) is the native register width.
 And that is basically defined by the CPU. So if sizeof(int) == 2, you
 probably have some 16bit microcontroller.


Or, you are running an x86 processor in virtual 8086 mode. For eg. running a
DOS app under  Linux or Windows.

Kindly CMIIW.

Best regards,
Pranav
http://pranavsbrain.peshwe.com


Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread Bernd Petrovitsch
On Mon, 2008-09-29 at 17:38 +0530, Pranav Peshwe wrote:
 On Mon, Sep 29, 2008 at 2:38 PM, Bernd Petrovitsch [EMAIL PROTECTED]
 wrote:

 snip 
  2. Does it have some relation that in windows in C language int size
 
 According to the C standard, sizeof(int) is the native register width.
 And that is basically defined by the CPU. So if sizeof(int) == 2, you
 probably have some 16bit microcontroller.
 
 Or, you are running an x86 processor in virtual 8086 mode. For eg.
 running a DOS app under  Linux or Windows.
 
 Kindly CMIIW.

Is that actually possible?
And with which toolchain?

Bernd
-- 
Firmix Software GmbH   http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
  Embedded Linux Development and Services



--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread Sunil
On Mon, Sep 29, 2008 at 5:46 PM, Bernd Petrovitsch [EMAIL PROTECTED] wrote:

 On Mon, 2008-09-29 at 17:38 +0530, Pranav Peshwe wrote:
  On Mon, Sep 29, 2008 at 2:38 PM, Bernd Petrovitsch [EMAIL PROTECTED]
  wrote:

  snip
   2. Does it have some relation that in windows in C language int
 size
 
  According to the C standard, sizeof(int) is the native register
 width.
  And that is basically defined by the CPU. So if sizeof(int) == 2,
 you
  probably have some 16bit microcontroller.
 
  Or, you are running an x86 processor in virtual 8086 mode. For eg.
  running a DOS app under  Linux or Windows.
 
  Kindly CMIIW.

 Is that actually possible?
 And with which toolchain?

Bernd
 --
 Firmix Software GmbH   http://www.firmix.at/
 mobil: +43 664 4416156 fax: +43 1 7890849-55
  Embedded Linux Development and Services



 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to [EMAIL PROTECTED]
 Please read the FAQ at http://kernelnewbies.org/FAQ


Not sure if it does the same thing, Turbo C on windows shows sizeof(int) ==
2.

-- 
Sunil.


Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread Pranav Peshwe
On Mon, Sep 29, 2008 at 5:46 PM, Bernd Petrovitsch [EMAIL PROTECTED] wrote:

 On Mon, 2008-09-29 at 17:38 +0530, Pranav Peshwe wrote:
  On Mon, Sep 29, 2008 at 2:38 PM, Bernd Petrovitsch [EMAIL PROTECTED]
  wrote:

  snip
   2. Does it have some relation that in windows in C language int
 size
 
  According to the C standard, sizeof(int) is the native register
 width.
  And that is basically defined by the CPU. So if sizeof(int) == 2,
 you
  probably have some 16bit microcontroller.
 
  Or, you are running an x86 processor in virtual 8086 mode. For eg.
  running a DOS app under  Linux or Windows.
 
  Kindly CMIIW.

 Is that actually possible?
 And with which toolchain?


Yes, AFAIK.
Windows supports running apps in VM86 mode out of the box. If Nidhi got
sizeof(int) == 2, then it probably might have been done in Turbo C/C++ which
runs in VM86 mode on windows.
On linux, there are DOSEmu and DOSBox.  Both worked well for me. I had
played Doom 2 on DOSBox :)

Best regards,
Pranav
http://pranavsbrain.peshwe.com


Re: network delay simulation

2008-09-29 Thread Alan Menegotto




Bizhan Gholikhamseh (bgholikh) escreveu:

  
  
  Hi
all,
  Is
there a mechanism to simulate random network latencies within kernel?
for example do a net/scheduleror just FIFO delay within network driver?
  
  Regards,
  Bizhan

pktgen can help you.

http://www.mjmwired.net/kernel/Documentation/networking/pktgen.txt



Best regards

Alan Menegotto



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: inode and blocks

2008-09-29 Thread Rohit Sharma
Not an assignment actually, but a project.
We are working on open hierarchical storage management, in which we
store files on disks according to different file placement policies.
For eg. if i say that all the important files, like all the employee
database should be in disk 1 and all the songs on disk 2, then we
place them accordingly in different disks.


On Mon, Sep 29, 2008 at 2:31 AM, Theodore Tso [EMAIL PROTECTED] wrote:
 On Sun, Sep 28, 2008 at 03:49:04PM +0530, Rohit Sharma wrote:
 Suppose i have a file named abc.txt and i want to specify that
 all the *.txt files must be allocated between block groups no. 100 -
 200 in ext2 fs.

 Is there a way to do this?

 can we modify function ext2_new_inode and find_group_orlov for this?

 You would have to modify kernel code to do this; the main question
 which comes to mind is *why* would you want to do something like this?
 It seems like an ideal problem set that a professor might give to a
 student, since it would force them to try to get from an inode to the
 pathname used to open the file.  So it seems to be one of these really
 pointless things that isn't particularly useful in real life, except
 for pedagogical purposes.

- Ted


--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: How to know the maximum memory pages that can be allocated?

2008-09-29 Thread pradeep singh
On Mon, Sep 29, 2008 at 9:48 AM, Peter Teoh [EMAIL PROTECTED] wrote:
 I would like to know the maximum memory I can allocate (using
 alloc_page()) in GFP_KERNEL and __GFP_HIGHMEM memory area - how can I
 know that?

Peter, I doubt you can precisely know that at any given time. :)
A lot of issues come into picture, the order of pages you want to
allocate, fragmentation, pages used as anonymous pages , pages for
other dynamic allocation which is required by kernel etc.
All these make it really difficult for precise answer.
Approximation I think you do it using some simple maths.

HTH,

Thanks,
--Pradeep

 Thanks.

 --
 Regards,
 Peter Teoh

 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to [EMAIL PROTECTED]
 Please read the FAQ at http://kernelnewbies.org/FAQ





-- 
play the game

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: How to know the maximum memory pages that can be allocated?

2008-09-29 Thread Peter Teoh
thank you pradeep singh for the sharing.

In the /proc/meminfo, I saw this (and my questions follows):

MemTotal:  3046884 kB
MemFree:   1502524 kB ===this is the physical free memory?
Buffers: 90820 kB
Cached: 624168 kB
SwapCached:  0 kB
Active: 964128 kB
Inactive:   519928 kB
HighTotal: 2162240 kB
HighFree:   758656 kB===this is the total free memory available
via using __get_free_pages(__GFP_HIGHMEM)?
LowTotal:   884644 kB
LowFree:743868 kB===this is the total free memory available
via using __get_free_pages(GFP_KERNEL)?
SwapTotal: 4192924 kB
SwapFree:  4192924 kB

Thanks for the sharing

On Mon, Sep 29, 2008 at 11:50 PM, pradeep singh [EMAIL PROTECTED] wrote:
 On Mon, Sep 29, 2008 at 9:48 AM, Peter Teoh [EMAIL PROTECTED] wrote:
 I would like to know the maximum memory I can allocate (using
 alloc_page()) in GFP_KERNEL and __GFP_HIGHMEM memory area - how can I
 know that?

 Peter, I doubt you can precisely know that at any given time. :)
 A lot of issues come into picture, the order of pages you want to
 allocate, fragmentation, pages used as anonymous pages , pages for
 other dynamic allocation which is required by kernel etc.
 All these make it really difficult for precise answer.
 Approximation I think you do it using some simple maths.

 HTH,

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: why not new-style I2C eeprom driver?

2008-09-29 Thread Wolfram Sang
Hello Srinivas,

On Mon, Sep 29, 2008 at 10:33:31AM +0530, [EMAIL PROTECTED] wrote:

Would like to know why the I2C eeprom driver is not upgraded to new-style?

Have you checked the latest kernel sources? Since 2.6.27-rc there is AT24 which
should meet your needs.

Why is that some devices are still following legacy I2C driver style.

Because nobody converted them yet. This is mainly a problem of not having the
hardware for testing. Every converted driver is very welcome.

If i want to write an I2C driver, is there any dependency on the
device that makes me to write only legacy driver?

Nope. Please always use the new style.

Actually, i am trying to rewrite the I2C eeprom driver in new-style using
linux kernel device model for my understanding.

Then have a look at at24.c for references :)

All the best,

   Wolfram Sang

-- 
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry


signature.asc
Description: Digital signature


Re: 32 bit and 64 bit---- doubt

2008-09-29 Thread SK malik
 32 bit. app

1) The addresses are limited to 32 bit(can be more in some cases). The
address space is limited to this value.
2) It will run on both 32 bit OS and 64 bit OS(64 bit OS can run 32 bit
apps)
3) A pointer is of 4 bytes.
4) some other differences wrt to other data types

 64bit app:

1) the address are limited to 2^64 ( theoretically)
2) It will run only on 64 bit OS
3) A pointer is of 64 bits(8 bytes)

BTW, Integer is always 4 bytes.
2 byte integers are history. Very few people use turbo C compiler nowadays.
gcc is the way to go.

-Sri


On Mon, Sep 29, 2008 at 12:42 PM, nidhi mittal [EMAIL PROTECTED]wrote:

 Hi all
 its a very basic ques may be for many of you .but i have this confusion
 from long that is.
 when we say this application is 32 bit application or 64 bit what do we
 mean by that
  is it processor which is 32 bit or 64 bit
 or the OS which is is 32 bit or 64 bit
 or what ?

 2. Does it have some relation that in windows in C language int size is 2
 bytes in linux gcc it is 4 bytes
 i mean any relation of word size with it ??
 --
 Thanks  Regards
 Nidhi




-- 
SK Malik


Re: inode and blocks

2008-09-29 Thread Sunil
On Mon, Sep 29, 2008 at 8:03 PM, Rohit Sharma [EMAIL PROTECTED] wrote:

 Not an assignment actually, but a project.
 We are working on open hierarchical storage management, in which we
 store files on disks according to different file placement policies.
 For eg. if i say that all the important files, like all the employee
 database should be in disk 1 and all the songs on disk 2, then we
 place them accordingly in different disks.


 On Mon, Sep 29, 2008 at 2:31 AM, Theodore Tso [EMAIL PROTECTED] wrote:
  On Sun, Sep 28, 2008 at 03:49:04PM +0530, Rohit Sharma wrote:
  Suppose i have a file named abc.txt and i want to specify that
  all the *.txt files must be allocated between block groups no. 100 -
  200 in ext2 fs.
 
  Is there a way to do this?
 
  can we modify function ext2_new_inode and find_group_orlov for this?
 
  You would have to modify kernel code to do this; the main question
  which comes to mind is *why* would you want to do something like this?
  It seems like an ideal problem set that a professor might give to a
  student, since it would force them to try to get from an inode to the
  pathname used to open the file.  So it seems to be one of these really
  pointless things that isn't particularly useful in real life, except
  for pedagogical purposes.
 
 - Ted
 

 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to [EMAIL PROTECTED]
 Please read the FAQ at http://kernelnewbies.org/FAQ


Hi Rohit,

Just out of curiosity, how are you going to identify the type of file inside
kernel ? from an extension or file format ?

Thanks.

-- 
Sunil.


.config versioning?

2008-09-29 Thread Simon

Hi there,
  I have 3 computers, they are all slightly different yet they all require 
pretty much the same basic options.  However, I am still a newbie with the 
kernel and have found it tedious try to make such hardware work or have it work 
in such a way...  to the point where I just forget what I did (as long as it 
works).  See, I'm looking for a cleaner way!...


  I've had an idea by using a versioning system (hey, why not use git!) but on 
this single file, the .config.


  I was thinking on building a trunk which would include only the changes that 
are needed on the 3 computers and that have passed some testing phase (ie, that 
it really works well on the 3 of them).  I would then have 3 branches, or 
sub-trunks that would complete the main trunk, but with specific changes for 
this computer.  This way, for computer A, the final .config would = main trunk + 
 A-trunk.


  This is all real fun git practice all in all, but I was wondering if there 
were a simpler way of dealing with this?  If not, I'll go ahead and build myself 
a wrapper script to ease the use of git specifically for .config.


Thanks,
  Simon

--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ