Re: about EXT3_SUPER_MAGIC

2010-11-13 Thread arshad hussain

On 11/14/2010 9:59 AM, Onkar Mahajan wrote:

What is EXT3_SUPER_MAGIC ?

A signature for identification.
How is it arrived at ?
There is no formula for it. It can be anything.
UFS has signature (magic) which is bill joy's
birth date.

I am writing a file system for which I am referring to
the ext3 code... I am not able to arrive at a magic number

Magic is normally under superblock. So, for your FS your
magic can be anything and it can take any number of bytes of
you choice. Normally magic is limited to 4-8 bytes.

for my filesystem please help

#define EXT3_SUPER_MAGIC0xEF53 < How this is arrived at ?


Regards,
Onkar


Thanks


--
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: segmentation question

2010-10-04 Thread arshad hussain

On 10/2/2010 3:08 AM, Sri Ram Vemulpali wrote:

Hi All,

   I am developing segmentation for my kernel. In that process I
choose to divide whole memory in to fixed size segments. So a 4GB
memory can be divided in to 8192 segments. So I initialize segment
descriptors in to the GTD withs segments base address and limit. Here
base address are 0,0x1,0x2,. and limit is 64kb always for
every segment. For a task if I choose a segment to assign, I will
place the index of that segment descriptor in to CS, DS. Now when
process generates address to put on address bus, then it will do
computation from logical address to linear address.
After processor picks logical address, it chooses segment descriptor
and adds this 32-bit logical address to segment base address to
generate linear address. Now my question is, if my segment size is
64kb, how is that 32-bit offset is added to segment base address,
which is not right.


As you know the limit is the _max_ which a single segment can scale.
IE 32bit or 4GB. Since segments need not have a fix size

It should only consider 16-bit offset to add to

there is a granularity bit which determines the 16bit (1MB)
vs the 32bit.


base to generate linear address. How can I tell to my processor to
choose only 16-bit offset.


the granularity bit if cleared (zero) determines a 16bit address.

Does processor drives offset bit width

automatically based on limit defined in segment descriptor.

Any insight in to this will help me. please clarify my doubt. Waiting
for you reply.

Regards,
Sri.



Thanks

--
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: Regarding IDT

2010-09-19 Thread arshad hussain

On 9/19/2010 4:49 AM, Sri Ram Vemulpali wrote:

Hi all,

This question is regarding Interrupt descriptor table. Why is the
IDTR 48-bits wide and


16Bit Limit + 32 bit Address = 48bits of IDTR.

why do we need limit field in the IDTR.

Because if we access beyond defined interrupt there will
be general protection fault.


Since we know there are 256 interrupts or exceptions possible, can't
we know boundary by deriving it by length of IDT field.


All interrupts are not always defined. There may be fewer
interrupts defined depending upon the requirements. Looking
up the 'limits' field is faster & less error prone than
find the length of the IDT, which i guess could only be
done via probing for all slots with has present flag set to 0.


Also, why is the IDT entry is 8 bytes long.

This 8 byte data structure is explained in intel's manual.
And how is the interrupt

line sharing is provided. Is sharing provided at OS code level.



I did not see any explanation of sharing at Intel manual (data sheet
of x86 system programming guide). Any thoughts.

Please clarify. Thanks.


--
Regards,
Sri.



Thanks.

--
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: Kernel Panic when trying to install Ubuntu 10.04 on my Desktop w/ processor AMD K6/2-450.

2010-09-18 Thread arshad hussain

On 9/18/2010 3:53 AM, David Castillo Fuentes wrote:

Hello,

Some days back I tried to install Ubuntu 10.04 in my old Desktop which
has a processor AMD K6/2-450, but when I tried to do so, I got a Kernel
Panic, and the system reported that it was working under low memory
conditions.

Few months back i got an old machine booted with acpi=off
cmd line option. This machine was otherwise not booting
or very sluggish to boot. ( As far as i remember ). Maybe
old acpi is not your problem, but you can always try.

Thanks.




Did you face a similar issue with this before?

Note: The ISO image that I'm working on is
ubuntu-10.04.1-desktop-i386.iso


Is there any old ISO image where this worked fine?

Thanks fro your support.

David



--
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: filesystem or database??

2010-09-17 Thread arshad hussain

On 9/17/2010 1:28 AM, mohit verma wrote:

hello,
when we install any package (like  in  ubuntu) ,at end the terminal
shows "reading database" . the idea i got by my friend is that package
manager uses this database (like .deb or rpm).
but my question is : everything in linux is a file so it(database or
files that it contains) must be placed somewhere in the  filesystem.what
is the difference  if i say that package manager accesses nothing but
the filesystem


Directory is also a file ( special ) , but we seldom call
it a file.

Thanks

( obviously a part of it) and database of a system(

computer ) is nothing but  the filesystem (part of it ) itself  ?
i mean: what differs between these two that imposes us to name them
differently?



--
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: Best linux distribution

2010-09-17 Thread arshad hussain

On 9/16/2010 6:32 PM, mohit verma wrote:

why LInux mint?

Its just my opinion.

The question was , to be able to run latest ( Almost latest ) kernel
on an old hardware. I am presently running Mint xfce on AMD 2200 with
256 mb ram ( 32 mb shared video ). and its running fine.

Thanks.


please highlight some diverse points which ubuntu or fedora don't provide.













--
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: ask for kernel module programming

2010-09-17 Thread arshad hussain

On 9/16/2010 6:37 PM, jhoni maux wrote:

oh, thank's for all guys :)

what is privilege ring of CPU (0 and 3) can you give a detil about that ??


Have a look at ... 
https://sites.google.com/site/owlkernel/documentation#TOC-Protection1


may i know where is the place to find some guide or reference
about user space and kernel space


But the ultimate "Tour de froce" reference is 
http://www.intel.com/design/pentiumii/manuals/243190.htm


Thanks



--
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: Best linux distribution

2010-09-16 Thread arshad hussain

On 9/16/2010 5:09 PM, Rags Linux wrote:

Hi All,

I have Pentium 4 machine. Which is the best linux distribution to
install? Ubuntu 10 and Fedora 13 are the latest. Can they run on older
machines? If so how much older?

Mint 9 xfce.

Thanks


The latest kernel version is 2.6.35.4 and I have downloaded it to my PC.
Can I build and run this on my older P4 after installing a linux
distribution?

Thanks and Regards,
Raghunand.



--
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: how to add...

2010-09-16 Thread arshad hussain

On 9/16/2010 4:40 PM, matthias wrote:

you can put it in a kernel module. have a read at http://lwn.net/Kernel/LDD3/
it's a bit outdate, but should do for the first steps.

2010/9/14 mohit verma:

hi all,
it is my first time , i am wiriting a simple interrupt handler .how to add
it to system?

Interrupt Handler for what? There must be a hardware device ,
a char driver etc...

i mean ,how can i compile and run this ?

You need not compile the whole kernel. Develop a device driver
( kernel module ) and plug it runtime into your kernel.

do i need to attach it in kernel source code and make changes and then
compile and run kernel each time  or  is there any other way to add this
without whole kernel compilation?

For your kernel module you will require the kernel headers, at least.
Compile your driver against it and 'insmod' it into your kernel.

http://programmermemoir.blogspot.com/2010/05/writing-device-driver-without.html

http://lwn.net/Kernel/LDD3/

Hope this helps.

Thanks.









--
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: ask for kernel module programming

2010-09-16 Thread arshad hussain

On 9/16/2010 11:56 AM, jhoni maux wrote:

HI,

Now i'm learn kernel module programming, but i'm still confuse about
user space context and kernel space context.


Here I think 'user space context' and 'user space' implies
the same thing.


anyone know about what

the different between user space and kernel space and how to see the
underlaying  between user space and kernel space ??


So...

In 'Kernel space' the running program can access all the
CPU instruction set. While in user space the programs
has access to limited CPU instruction. This is accomplished
through setting proper privilege bits in the Segment selector
and Descriptors. For example 'user space' program cannot issue
cli instruction...

CPU designers also call 'kernel space' as Ring0. while
'user space' is known as Ring3.

Thanks

--
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: Question on MMU

2010-09-10 Thread arshad hussain

On 9/11/2010 8:04 AM, Mulyadi Santosa wrote:

Hi Sri...

On Sat, Sep 11, 2010 at 09:19, Sri Ram Vemulpali
  wrote:

Hi all,
   I have a question on MMU. Memory management is used to segregate the
memory between process and make sure no process steps on each other. Also,
it provides abstraction to whole available memory in a conceptual way called
virtual address.
Now my question is, we can do all this in software, I mean simulate and map
the virtual address to physical address not taking hardware support. Now why
is the hardware unit MMU is given with processor. Is there any special
reason.


It sounds like you're comparing the situation between full software
virtualization without any help (Xen dom0 in non VT/SVM enabled
processor) VS KVM in VT/SVM enabled processor.

Got the picture? You could draw the advantage? One word: speed



Speed definitely . And it reduces the complexity of the code. Easier
on us developers. :-)

Thanks.

--
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: Integer Division on 32 Bit Machines

2010-09-10 Thread arshad hussain

On 9/10/2010 12:22 PM, Bond wrote:



On Fri, Sep 10, 2010 at 10:08 AM, arshad hussain mailto:arshad.su...@gmail.com>> wrote:

I agree with Silesh 100% here.


Thanks.

Rather than agreeing with Silesh show some real suggestion to original
posters question.

Do not tell me what to do... Not going to take suggestions form
someone who does not understand plain instruction that hijacking
mail is a no-no.


I have a habit of understanding what other people ask and try to
understand what they have problem.

No body cares. The only point is there is a _process_ and that's
need to be adhered.






--
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: Integer Division on 32 Bit Machines

2010-09-09 Thread arshad hussain

It would be better if you do not hijack other e-mail threads to post
your own question.


I agree with Silesh 100% here.

Thanks.



--
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

2010-09-01 Thread arshad hussain

On 9/1/2010 9:45 PM, Tayade, Nilesh wrote:

-Original Message-
From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-
bou...@nl.linux.org] On Behalf Of Hiren Panchasara
Sent: Wednesday, September 01, 2010 9:08 PM
To: kernelnewbies@nl.linux.org
Subject: A question

Process context is schedulable but interrupt context is not. Why and
how?


Interrupt line can be shared by multiple interrupts or to avoid delay in
handling subsequent interrupts on single line - the handler has to be
quick enough. So we avoid scheduling out or sleeping inside the
interrupt handlers.


Adding...

Scheduling blocks. And if interrupt handler is blocked ( scheduled ) it
will lead to freeze.

Thanks.




Any examples I can look at?



--
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: what is static inline void tvec_base

2010-08-27 Thread arshad hussain

On 8/28/2010 11:07 AM, Mulyadi Santosa wrote:

On Sat, Aug 28, 2010 at 12:19, James Bond  wrote:

Please don't top post :)


What is that top post I never came across such a thing in timer code?


top post is a way to put your reply on top of the quoted previous
message...while what we do in kernelnewbies is the other way around...


That's why...IIRC,


and what is IIRC


If I Remember Correctly :)



now we have "always inline" and just " inline" :)


  What is the difference between them?



casual "inline" is at the mercy of compiler to decide, whether to
really inline the functions or not.

while "always inline"...you surely have the good guess now :D



There is another variation called "noinline".

When GCC is set to maximum optimization option
it automatically selects functions that it finds suitable
and inlines it. "noinline" attribute is used to suppress this.

Thanks

--
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: macro or inline

2010-08-23 Thread arshad hussain

On 8/23/2010 4:09 PM, Parmenides wrote:

Hi,

In kernel, some codes implemented by macro while the others by inline
function.  I wonder how to determine in what situation to use one,
whereas in what situation to use the other.



Inlining functions have benefits when debugging and type checking. 
Macro's do not. Macro's are guaranteed to be substituted, while

inline function are at the mercy of the optimizing compiler.

Thanks.

--
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: address space of kernel thread

2010-08-22 Thread arshad hussain

On 8/22/2010 3:58 PM, Parmenides wrote:

Hi,

It's said that kernel thread is running in kernel address space only.
I wonder what's the meaning of "running in kernel address space only".
   

X86 Architecture defines 4 logical rings which acts as
a protection mechanism.

When code is running in ring 0 (aka kernel thread)
it means its segment selector (RPL) and Descriptor
data structures are 'marked' with 0.  This is in contrast
with user space programs with segment selector is 3
(ring 3). So kernel space threads or user space threads
are the CPL , RPL and DPL values.

When kernel thread running, which page table is used? Is there any
special characteristics of this page table?
   

Page table keeps mapping between virtual pages and
physical page frames.  And when ever a kernel thread
allocates memory each page allocated is marked as only
readable or writable via kernel code. etc...

Thanks

--
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: linux/module.h does not exist

2010-08-22 Thread arshad hussain

On 8/22/2010 12:39 PM, Tapas Mishra wrote:

He he tried what you said.
I wont 2 cents :)

It did not worked
   



Ok. So you included linux/syscalls.h instead of sys/syscalls.h
and still it cannot find "__NR_exit" symbol. Right? Or it
compiled successfully but did not load.

--snip--

sys/syscall.h: No such file or directory
/home/tapas/LKP/pandora/temp/sample2/sample2.c: In function ‘init_module’:
/home/tapas/LKP/pandora/temp/sample2/sample2.c:14: error: ‘__NR_exit’
undeclared (first use in this function)
--snip--

From your previous errors, sys/syscall.h is not there.
I'll second Mulyadi you have to use linux/syscalls.h or unistd.h
or different header file which defines __NR_exit. And this
part is only for unresolved symbol.




Following is new program

#include
#include
#include
extern void *sys_table[];
asmlinkage int(*main_sys_exit)(int);
asmlinkage int alt_exit_function(int err_code)
{
 printk("Sys_exit called with err_code=%d\n",err_code);
 return main_sys_exit(err_code);
}

int init_module()
{
 main_sys_exit=sys_table[__NR_exit];
 sys_table[__NR_exit]=alt_exit_function;
}
void cleanup_module()
{
 sys_table[__NR_exit]=main_sys_exit;
}



Following is way I compiled
gcc -I /usr/include/ -Wall -DMODULE -D__KERNEL__ -DLINUX -c sample2.c
and following are the errors
http://pastebin.com/u3mPhfUf

Then I compiled it also in following way
gcc -I /usr/src/linux-headers-2.6.28-11-generic/include/linux/ -Wall
-DMODULE -D__KERNEL__ -DLINUX -c sample2.c

and got following errors
http://pastebin.com/HzX0DBz1
.
So 2 cents :)
any how this is the original link where I was trying the code
page 48 left hand column
https://docs.google.com/fileview?id=0B2A4urYOAf6POTI1OGE1MjctM2UyMC00OGUzLThlNDUtZDBhOWFjY2Y1MDUz&hl=en

Any more suggestions.
   



--
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: linux/module.h does not exist

2010-08-21 Thread arshad hussain

On 8/22/2010 11:11 AM, Tapas Mishra wrote:

/home/tapas/LKP/pandora/temp/sample2/sample2.c:2:25: error:
sys/syscall.h: No such file or directory
   


My 2 cents ...

#includehttp://lxr.linux.no/linux+*/include/linux/syscalls.h>>  , try this include.

Thanks



Re: Unable to remove sctp kernel module.

2010-08-21 Thread arshad hussain
On Sat, Aug 21, 2010 at 4:09 PM, Padmalochan Moharana
 wrote:
> Dear All,
>
> To load the sctp module in kernel I have used the modprobe command. But when
> I am trying to remove the sctp module using rmmod command with –f option,
> kernel shows below error message as ipv6 module uses the sctp module.

You have to do something like 'unwind the stack' . First try to
remove ipv6 then try sctp. Maybe you'll find ipv6 is referenced by
some other module, go and remove that first.

Other option is to leave sctp alone, guess its harmless.

Thanks.

>
>
>
> ERROR: Module sctp is in use by [unsafe]
>
>
>
> Is there any other way to remove the sctp module without rebuild the kernel
> with setting CONFIG_MODULE_FORCE_UNLOAD?
>
>
>
>
>
> Regards,
>
> Padmalochan
>
>
>
>
>
>

--
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: rep instruction without ecx's control

2010-08-19 Thread arshad hussain
On Fri, Aug 20, 2010 at 8:16 AM, Parmenides  wrote:
> Hi,
>
> In the following code, the nop instruction prefixed by rep will
> execute several times. How many times the instruction executes  is
> controlled by ecx register. But, there is no explicit setting of ecx

Looks like decb instruction is reducing the spin lock value.

Thanks

> register. What's the meaning of this instruction?
>
> --
> 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: Reason for %ss==%ds?

2010-08-18 Thread arshad hussain
On Tue, Aug 17, 2010 at 10:45 PM, nascent mind  wrote:
> Hi,
>
>    I am trying to understand the boot process of the kernel and I am not
> able to understand why the stack segment should be equal to the data segment
> here http://lxr.linux.no/#linux+v2.6.31.2/arch/x86/boot/header.S#L260 . Can
> somebody explain this? Wouldn't it overlap with the code segment?

CMIIW.

No it will not. Taking your lxr reference it says
"# Now %dx should point to the end of our stack space".
So it is assumed by the developer that there will not big
number of push's and the Data would not be big enough
to run over each other. Kind of 'tiny' model. ( aka .com ).

Thanks




>
> Thanks.
>

--
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: Need List of Books

2010-08-03 Thread arshad hussain
On Fri, Jul 30, 2010 at 6:27 PM, Usman S. Ansari  wrote:
> Which OS dev site ?
http://wiki.osdev.org/Main_Page  .

Can you send link + link for Arch manual for Intel / AMD you mentioned.

http://www.intel.com/products/processor/manuals/
http://developer.amd.com/documentation/guides/pages/default.aspx

Thanks

--
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: Adding command line option in kernel.

2010-08-03 Thread arshad hussain
On Tue, Aug 3, 2010 at 7:56 PM, Victor Rodriguez  wrote:
> On Tue, Aug 3, 2010 at 2:21 AM, Raahi Mehra  wrote:
>>
>> Hi,
>>
>> I wish to add a new command line option in my kernel.
>> Can anybody help me with steps to achieve that ??
>> As I read somewhere that __setup is now obsolete and since i need to use
>> this new option in early boot time

If you are using GRUB/GRUB2 as your bootloader.
Then one possible option is to let GRUB import that
for you. Have a look at GRUB_CMDLINE_LINUX,
(for GRUB2) and GRUB1's "kernel" option.

This should help https://wiki.ubuntu.com/Grub2

Thanks


so I need to use early_param().
>> So how can I do that ??
>> Is there any documentation available anywhere that i can use ??
>>
>>
>> Regards,
>> Raahi
>>
>

--
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: Need List of Books

2010-07-30 Thread arshad hussain
My 2 cents ...

Additional to the Linux specific books mentioned in this thread.
To get the _philosophy_ behind the Linux kernel / or any operating
system you must read one of the x86 architecture books. Or any
other architecture you are interested in.

My pick for x86. These are also available in the SAARC country.

>From the the top draw ...

1. Intel / AMD architecture manual. Free down loadable from their site.
2. Operating Systems Design and Implementation (minix)
3. OS Dev website.

Thanks

--
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: multiple alternate superblocks

2010-07-08 Thread arshad hussain
On Wed, Jul 7, 2010 at 6:37 PM, Manish Katiyar  wrote:
> On 7/7/10, Onkar Mahajan  wrote:
>> Is it possible to supply multiple alternate superblocks
>> while doing a mount in Linux ?

If I got your question correctly, It is already being done
that way automatically. Although kernel uses superblock
in block group 0, the superblock is copied to rest of the
block group in the file-system.  So there are multiple
copies of superblock, and in-case of corruption e2fsck
can be instructed to use alternate superblock using the
'-b' switch.

>
> Why would you want to do that ? What is the expected behavior in such cases ?
I will second Manish here. What is that you want to achieve.
Recover a bad ext2/3/4 ...?, create filesystem with with different
options ? etc... Let us know.

Thanks
>
>
>>
>> -Regards,
>> Onkar
>>
>> --
>> 
>>
>> Your work is going to fill a large part of your
>> life, and the only way to be truly satisfied is
>> to do what you believe is great work. And the
>> only way to do great work is to love what
>> you do. If you haven’t found it yet, keep
>> looking, and don’t settle. As with all matters
>> of the heart, you’ll know when you find it.
>>                                        -  Steve Jobs
>> 
>>
>
>
> --
> Thanks -
> Manish
> ==
> [$\*.^ -- I miss being one of them
> ==
>
> --
> 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: doubt regarding partition table and bootloader

2010-06-27 Thread arshad hussain
On Mon, Jun 28, 2010 at 3:40 AM, raja roy  wrote:
> Hi All,
>   I was trying to understand the booting steps,
>
>  BIOS loads the first sector (MBR) of a bootable device(considering disk
> only) in RAM (:7c00)and then jumps to that addr to execute the primary
> boot loader which in turn loads the secondary boot loader(grub) pointed to
> by an active partition in the partition table.

Expanding it a little...

Under x86 Architecture, BIOS starts executing at fff0, that is
one paragraph less than 65535. Here its still in real mode. After
the BIOS does its 'stuff' , the last instruction executed by BIOS
is int 0x19 which causes it to jump to  7c00 where it starts executing
code.  This code is responsible for loading the operating system or
the kernel.

Now, the primary and the secondary boot-loader you mention
are the same. Grub in this case. Its only because there is just
500 bytes (taking away 55AA) to execute. This 500 bytes
is sometimes (most of the time actually) very less to put in
substantial amount of code to boot load any Kernel. Grub uses
this to jump to stage1.5 and then stage2 to completely load
any kernel.

>
>  If i m wrong above,please correct me.
>
>   Now my doubt is that-
>
> If the partition table has multiple active partitions(in case of multiple
> OS) , in that case, are those other partitions are read by the primary boot
> loader ,if yes then when??
>    how does the secondary boot loader(grub) come to know about the various
> active partitions in the disk (since it does not read the partition table in
> MBR)??
Grub (any modern bootloader)does not care about
active partitions. Once grub is installed you have to
register ( let grub know, if not done automatically)
where all your multiple OS are in the disk. It is not
true grub does not read partition table, once you do
something like (hd0,0) it know about first partition
'start / end ' by going through partition table.

There is also new version of grub. Which they say is very scriptable.
Not tried that though.

Thanks

>
> thanks
> Raja
>
>

--
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: Getting driver module name from device node?

2010-06-22 Thread arshad hussain
lshal command can spit out some interesting stuff too.
This is what i got for my network card.

Thanks

-- snip ---
udi = '/org/freedesktop/Hal/devices/pci_14e4_169c'
  info.linux.driver = 'tg3'  (string)
  info.parent = '/org/freedesktop/Hal/devices/pci_1002_4371'  (string)
  info.product = 'NetXtreme BCM5788 Gigabit Ethernet'  (string)
  info.subsystem = 'pci'  (string)
  info.udi = '/org/freedesktop/Hal/devices/pci_14e4_169c'  (string)
  info.vendor = 'Broadcom Corporation'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'pci'  (string)
  linux.sysfs_path =
'/sys/devices/pci:00/:00:14.4/:02:01.0'  (string)
  pci.device_class = 2  (0x2)  (int)
  pci.device_protocol = 0  (0x0)  (int)
  pci.device_subclass = 0  (0x0)  (int)
  pci.linux.sysfs_path =
'/sys/devices/pci:00/:00:14.4/:02:01.0'  (string)
  pci.product = 'NetXtreme BCM5788 Gigabit Ethernet'  (string)
  pci.product_id = 5788  (0x169c)  (int)
  pci.subsys_product_id = 12427  (0x308b)  (int)
  pci.subsys_vendor = 'Hewlett-Packard Company'  (string)
  pci.subsys_vendor_id = 4156  (0x103c)  (int)
  pci.vendor = 'Broadcom Corporation'  (string)
  pci.vendor_id = 5348  (0x14e4)  (int)
--- snip end ---

--
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: basic ques --- installation from rpm and source

2010-05-25 Thread arshad hussain
When you did "make install" it has overwritten the files created
by e2fsprogs rpm.

Thanks

--
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: retaining messages from previous boot - /var/log/messages OR /var/log/boot.log

2010-05-18 Thread arshad hussain
On Sun, May 16, 2010 at 10:03 AM, Mulyadi Santosa
 wrote:
> On Sat, May 15, 2010 at 18:50, Onkar Mahajan  wrote:
>> The Situation is this :
>>
>> I have compiled Xen Hypervisor , and it just hangs at some point
>> during the boot. I want to send to a relevant Xen mailing list the sequence
>> of events before the hang.
>>
>> When the System hangs , I just restart the system uncleanly ( press the
>> power button for 30 sec)
>> and reboot the machine with the working kernel. Now, I want to see in
>> /var/log/messages the
>> sequence of events that occured  before the hang in the previous boot. I am
>> not able to
>> see those log messages , they are overwritten during every boot.
>

Check the xend and xend-debug logs. Also have a look at
http://wiki.xensource.com/xenwiki/XenSerialConsole.

At worst times I found myself scribbling the contents with pen or pencil,
or lately using the camera when capturing crash was difficult. Just throwing
my thoughts on table...

Thanks
write down the last few lines

--
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: retaining messages from previous boot - /var/log/messages OR /var/log/boot.log

2010-05-18 Thread arshad hussain
On Wed, May 19, 2010 at 5:36 AM, arshad hussain  wrote:
> On Sun, May 16, 2010 at 10:03 AM, Mulyadi Santosa
>  wrote:
>> On Sat, May 15, 2010 at 18:50, Onkar Mahajan  wrote:
>>> The Situation is this :
>>>
>>> I have compiled Xen Hypervisor , and it just hangs at some point
>>> during the boot. I want to send to a relevant Xen mailing list the sequence
>>> of events before the hang.
>>>
>>> When the System hangs , I just restart the system uncleanly ( press the
>>> power button for 30 sec)
>>> and reboot the machine with the working kernel. Now, I want to see in
>>> /var/log/messages the
>>> sequence of events that occured  before the hang in the previous boot. I am
>>> not able to
>>> see those log messages , they are overwritten during every boot.
>>
>
Check the xend and xend-debug logs. Also have a look at
http://wiki.xensource.com/xenwiki/XenSerialConsole.

At worst times I found myself scribbling the contents with pen or pencil,
or lately using the camera when capturing crash was difficult. Just throwing
my thoughts on table...

Thanks

--
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: retaining messages from previous boot - /var/log/messages OR /var/log/boot.log

2010-05-15 Thread arshad hussain
On Sat, May 15, 2010 at 3:04 PM, Onkar Mahajan  wrote:
> But some linux distributions do keep the previous boot logs , this will help
> me to know
> where the kernel Paniced ??
>
> Regards,
> Onkar
>
> On Sat, May 15, 2010 at 2:33 PM, arshad hussain 
> wrote:
>>
>> On Sat, May 15, 2010 at 9:50 AM, Onkar Mahajan 
>> wrote:
>> > I want to retain the messages from all the previous boots in the
>> > /var/log/messages
>> > How do I append the messages in /var/log/messages rather than create a
>> > new
>> > file
>> > each time during the boot ?
>> >
>> > Regards,
>> > Onkar
>> >
>> >
>>
>> One way to do it would be. Copy /var/log/message to any file at every
>> shutdown. And use logger command to insert contents of this new file
>> at every startup. This would boil down to ...
>>
>> /* Inside Your shutdown script ( rc6.d ) */
>> $ cat /var/log/message > /tmp/my_logfile
>>
>> /* Inside Your startup script */
>> $ logger -f /tmp/my_logfile
>>
>> Be advised, /var/log/message will not grow indefinitely, after reaching
>> some
>> size it will start "chopping" out the top. Have a look at man pages of
>> logger
>> and syslog.
>>
>> Thanks
>
>

Oh!, I thought your question was "How to append message in /var/log/messages".
I am afraid, It is not clear to me what exactly you are saying.
Guessing, it seems like once
you get a panic, inevitably your kernel reboots and you need some way to find
to find out where. And you want to log it into /var/log/message. If I
got this correct then you have to look at the 'crash' command.

Thanks

--
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: retaining messages from previous boot - /var/log/messages OR /var/log/boot.log

2010-05-15 Thread arshad hussain
On Sat, May 15, 2010 at 9:50 AM, Onkar Mahajan  wrote:
> I want to retain the messages from all the previous boots in the
> /var/log/messages
> How do I append the messages in /var/log/messages rather than create a new
> file
> each time during the boot ?
>
> Regards,
> Onkar
>
>

One way to do it would be. Copy /var/log/message to any file at every
shutdown. And use logger command to insert contents of this new file
at every startup. This would boil down to ...

/* Inside Your shutdown script ( rc6.d ) */
$ cat /var/log/message > /tmp/my_logfile

/* Inside Your startup script */
$ logger -f /tmp/my_logfile

Be advised, /var/log/message will not grow indefinitely, after reaching some
size it will start "chopping" out the top. Have a look at man pages of logger
and syslog.

Thanks

--
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: Doubts in System call mechanism in linux

2010-05-11 Thread arshad hussain
On Tue, May 11, 2010 at 9:50 AM, Daniel (Youngwhan) Song
 wrote:
> On 5/10/10 6:37 PM, Balachandar wrote:
>
> Hello,
>   We transit from ring3 to ring0 using 'int' or the new 'syscall/sysenter'
> instruction. Does that mean that the page tables and other stuffs that needs
> to be modified for the kernel is automatically done by the 'int' instruction
> or the interrupt handler for the 'int 0x80' will do the required stuff and
> jump to the respective system call.

IMHO, As you know 'int 0x80' is just an exception ( intel speak ). Under Linux
this 'slot' is chosen to switch to priviledge mode. So to answer your question,
setting up of kernel stack ( pointed bs TSS ) etc needs to be done by the
handler. Also remember, when bringing up the board (booting) we set up IDT and
all its slots greater than 32 to zero, and slowly pick up a slot and
assign duty
to it.

Thanks
>
> Also when returning from a system call, we again need to go to user space.
> For this we need to know the instruction address in the user space to
> continue the user application. Where is that address stored. Does the 'ret'
> instruction automatically changes the ring from ring3 to ring0 or where/how
> this ring changing mechanism takes place?
>
> Then, i read that changing from ring3 to ring0 is not as costly as changing
> from ring0 to ring3. Why is this so??
>
> Thanks,
>
> Bala
>
> Hi Bala,
>
> Have you referred this?
>
> http://tldp.org/HOWTO/html_single/Implement-Sys-Call-Linux-2.6-i386/
>
> http://www.ibm.com/developerworks/linux/library/l-system-calls/index.html
>
> Daniel
>

--
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: linux0.01 build failed

2010-04-14 Thread arshad hussain
On Thu, Apr 15, 2010 at 11:42 AM, Sameer Rahmani  wrote:
> i read that before but my problem is ( my 64bit linux box) it seems
> linux0.01 do not compiled with a 64bit gcc
>

If you want to compile 32bit binary, on linux which is 64bit
"-m32" gcc option must be used. I guess you also need
to "apt-get"/"yum" 32bit libs if its not already installed. Anyway
once you start compiling gcc will let you know what all is missing.

Thanks

--
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: linux0.01 build failed

2010-04-14 Thread arshad hussain
On Wed, Apr 14, 2010 at 10:21 PM, Manish Regmi  wrote:
> On Wed, Apr 14, 2010 at 11:39 AM, Sameer Rahmani  wrote:
>> i'm new to kernel hacking and as i read in kernelnewbies.org it is a
>> good idea to begin with linux0.01
>>
>
> even if you managed to compile it. I doubt if it can run applications
> that come in today's distributions.
> i think its just good for reading the code.
> you might be able to run just the kernel though.
> good luck :-)
>
> for a start try using -32 switch with as command since you are using
> 64 bit system.
>
> ---
> regards
> Manish Regmi
>
> http://manish-cs.blogspot.com
> http://ext2read.sf.net
>
> --
> 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
>
>

http://kerneltrap.org/Linux/Dusting_Off_the_0.01_Kernel. Have a
look at this url. They got linux0.01 working with gcc 4. Have fun :)

Thanks

--
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: need to get blocks per group in user space

2010-04-07 Thread arshad hussain
On Wed, Apr 7, 2010 at 1:37 PM, arshad hussain  wrote:
> On Wed, Apr 7, 2010 at 1:10 PM, Manish Katiyar  wrote:
>> On Wed, Apr 7, 2010 at 1:06 PM, nidhi mittal hada
>>  wrote:
>>> hello All
>>>
>>> I want to get some of filesystem specific information
>>> like blocksize , s_blocks_per_group
>>> etc in userspace c program
>>>
>>> How do i get it ?
>>
>> Use libext2fs or see the code of dumpe2fs
My bad. I jumped to answer without going
through the question throughly.  Manish
is correct, in case your requirement is to get
FS blk size  etc ... through userspace 'c' program
libext2fs is the way. One another way is to
read fs partition or img raw read in first 1024
bytes and cast it to super block struct. You will
be need to include ext2_fs.h.

Thanks

> debugfs . Assuming you want it for ext2/3/4.
>
> Thanks.
>>
>>> i have obtained block size by stat() function
>>> but not more than that :(
>>>
>>>
>>>
>>>
>>> --
>>> Thanks & Regards
>>> Nidhi Mittal Hada
>>> Scientific officer D
>>> Computer Division
>>> Bhabha Atomic Research Center
>>> Mumbai
>>>
>>>
>>>
>>
>>
>>
>> --
>> Thanks -
>> Manish
>> ==
>> [$\*.^ -- I miss being one of them
>> ==
>>
>> --
>> 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: need to get blocks per group in user space

2010-04-07 Thread arshad hussain
On Wed, Apr 7, 2010 at 1:10 PM, Manish Katiyar  wrote:
> On Wed, Apr 7, 2010 at 1:06 PM, nidhi mittal hada
>  wrote:
>> hello All
>>
>> I want to get some of filesystem specific information
>> like blocksize , s_blocks_per_group
>> etc in userspace c program
>>
>> How do i get it ?
>
> Use libext2fs or see the code of dumpe2fs
debugfs . Assuming you want it for ext2/3/4.

Thanks.
>
>> i have obtained block size by stat() function
>> but not more than that :(
>>
>>
>>
>>
>> --
>> Thanks & Regards
>> Nidhi Mittal Hada
>> Scientific officer D
>> Computer Division
>> Bhabha Atomic Research Center
>> Mumbai
>>
>>
>>
>
>
>
> --
> Thanks -
> Manish
> ==
> [$\*.^ -- I miss being one of them
> ==
>
> --
> 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: Help needed for setup a simulation environment.

2010-03-07 Thread arshad hussain
With vmware its the easiest to setup quickly. And if you are worried
about large linux distro , use ubuntu server distro, this is really small.
Few apt-gets for linux-headers... and build-essentials should get you going.

This will also avoid blockades like ...

> I can setup QEMU. But, I will be needing a filesystem with my desired kernel
> and neccessary utils. How create such simple filesystem? and boot it from
> QEMU?
>
> Thanks all for your helpful responses. :)

Thanks.

--
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: how to support long file name in vfat format under linux

2009-10-13 Thread arshad hussain
>
> I have another question right now.
> I write a autorun.sh to detect the hotplug event and mount the disk.
> But if I got a usb HD that have vfat, NTFS and ext3 formats at
> different partitions,
> how could I write one mount command for all cases?
> I cannot mount every /dev/sda[1-9] as -t vfat, right?
> appreciate your help,
> miloody
>
blkid 

this is what i got from my system.

ruby # blkid /dev/sda1
/dev/sda1: UUID="dc705c94-0f0e-42b8-aecc-d0da7d8119ea" TYPE="ext3"
ruby #

Thanks

--
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: determine SCSI HBA

2009-07-20 Thread arshad hussain
On Mon, Jul 20, 2009 at 12:50 PM, arshad hussain wrote:
> On Mon, Jul 20, 2009 at 11:44 AM, Leena M. wrote:
>> Hi All,
>>
>> here are few outputs , based on this can I say that there is a SCSI
>> adapter (which I cant see on my MB)  somewhere.
>>
>> le...@debian:~$ ls /proc/scsi/
>> device_info  scsi  usb-storage
>>
>> le...@debian:~$ ls /proc/scsi/ <--- Your Prompt
>> device_info  scsi  usb-storage
>> on...@debian:~$ cat /proc/scsi/device_info <-- Prompt from another machine
>> 'Aashima' 'IMAGERY 2400SP' 0x1
>> 'CHINON' 'CD-ROM CDS-431' 0x1
>> 'CHINON' 'CD-ROM CDS-535' 0x1
> 
>
> First, are you sure you are not switching between machines you have ssh'ed.?
> As i can see two different prompts. IMHO, you have mistaken you sata
> controller,
> (built into your MB) as HBA. Linux does drive sata via scsi layer.
>
> Another easy method is to find out the model of your MB, and check the specs.
> Which i am sure does not have HBA.
>
> Thanks.
>

--
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: filesystem info

2009-03-14 Thread arshad hussain
On Sat, Mar 14, 2009 at 2:00 PM, krushnaal pai  wrote:
> is there any link/e-book where the filesystem source code of 2.6.* kernel is
> explained
>
> or
>
> plz suggest an ebook on linux 2.6 filesystems( in detail )

Not an ebook. But it has detail chapters on vfs and ext.
"Understanding the Linux Kernel, Third Edition by Daniel Bovet and Marco Cesati"

Thanks.
>
>
>

--
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: Recovering Partition using linux

2009-02-19 Thread arshad hussain
On Fri, Feb 20, 2009 at 7:30 AM, Rishi Bhushan Agrawal
 wrote:
>
>
> On Thu, Feb 19, 2009 at 6:47 PM, arshad hussain 
> wrote:
>>
>> On Thu, Feb 19, 2009 at 9:23 PM, Rishi Bhushan Agrawal
>>  wrote:
>> > yes all the data has been recovered back and even the directory
>> > structure is
>> > intact.
>> >
>> > But I want to find a proper solution to these kind of problems.
>> >
>> > So I have not deleted the partition and still want to recover it.
>> >
>> > The point behind it is that when every thing is correct and in place
>> > then
>> > only MBR and the Partition table needs to be modified.
>>
>> Backup is the key. In this case, backing up MBR and Extended partition
>> chain and then restoring it.
>
> How do I proceed with it ?

# sfdisk -d /dev/ SAVE.COPY
# sfdisk /dev/ < SAVE.COPY

There is also libparted, if you wish to have more control over your
partitioning.

Thanks.

>
>>
>> Thanks.
>>
>> >
>> > So what modification can result in correcting it ?
>> >
>> > On Thu, Feb 19, 2009 at 3:45 PM, Pranav Peshwe 
>> > wrote:
>> >>
>> >> Hi Rishi,
>> >> If you have recovered *all* your data from the partition then, you
>> >> can
>> >> just delete the partition (using fdisk) and create a new one in the
>> >> same
>> >> place. Then, format it with whatever filesystem you want and start
>> >> using it.
>> >>
>> >> Hope, i am not missing anything :-?
>> >>
>> >> - P
>> >>
>> >>
>> >> On Thu, Feb 19, 2009 at 8:02 PM, Rishi Bhushan Agrawal
>> >>  wrote:
>> >>>
>> >>> I could recover all the files using the "testdisk" program on windows.
>> >>>
>> >>> I would like to proceed with correcting the MBR and the partition
>> >>> table.
>> >>>
>> >>>
>> >>> How do i do it ??
>> >>>
>> >>> On Thu, Feb 19, 2009 at 7:17 AM, Pranav Peshwe
>> >>> 
>> >>> wrote:
>> >>>>
>> >>>> On Thu, Feb 19, 2009 at 10:25 AM, rishi agrawal 
>> >>>> wrote:
>> >>>>>
>> >>>>> Sorry for the previous mails
>> >>>>>
>> >>>>> I tried a NTFS recovery tool named as
>> >>>>>
>> >>>>> 1st NTFS Recovery 3.3.1.0( evaluation Version).
>> >>>>>
>> >>>>> It is very good. It took out the whole directory structure
>> >>>>> correctly.
>> >>>>> The only problem is that in order to access the files I need to pay
>> >>>>> for it
>> >>>>> and I dont want to do that.
>> >>>>>
>> >>>>> As the directory structure is correct it is proved that the
>> >>>>> partition
>> >>>>> is untouched and correct and simple MBR manipulations can result in
>> >>>>> recovering the drive correctly.
>> >>>>>
>> >>>>> I am quite hesitant to do anything without a clear cut idea as i may
>> >>>>> lose the data.
>> >>>>
>> >>>> Although it is off-topic on this list - i would suggest a simple
>> >>>> thing
>> >>>> here since you seem to have valuable data on the disk. Before you use
>> >>>> any
>> >>>> tools for recovery, create a raw copy(image) of the entire partition
>> >>>> on
>> >>>> another hard disk. The dd command in linux/unix will be useful for
>> >>>> doing
>> >>>> that. Once you have the image, you can mount it (in linux or any
>> >>>> other OS of
>> >>>> your choice)  and experiment on it in various ways. This way, you
>> >>>> won't risk
>> >>>> losing your data in case, any tool behaves badly.
>> >>>>
>> >>>>
>> >>>> Best regards,
>> >>>> Pranav
>> >>>> http://pranavsbrain.peshwe.com
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Regards,
>> >>> Rishi B. Agrawal
>> >>>
>> >>
>> >
>> >
>> >
>> > --
>> > Regards,
>> > Rishi B. Agrawal
>> >
>> >
>
>
>
> --
> Regards,
> Rishi B. Agrawal
>
>

--
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: Recovering Partition using linux

2009-02-19 Thread arshad hussain
On Thu, Feb 19, 2009 at 9:23 PM, Rishi Bhushan Agrawal
 wrote:
> yes all the data has been recovered back and even the directory structure is
> intact.
>
> But I want to find a proper solution to these kind of problems.
>
> So I have not deleted the partition and still want to recover it.
>
> The point behind it is that when every thing is correct and in place then
> only MBR and the Partition table needs to be modified.

Backup is the key. In this case, backing up MBR and Extended partition
chain and then restoring it.

Thanks.

>
> So what modification can result in correcting it ?
>
> On Thu, Feb 19, 2009 at 3:45 PM, Pranav Peshwe 
> wrote:
>>
>> Hi Rishi,
>> If you have recovered *all* your data from the partition then, you can
>> just delete the partition (using fdisk) and create a new one in the same
>> place. Then, format it with whatever filesystem you want and start using it.
>>
>> Hope, i am not missing anything :-?
>>
>> - P
>>
>>
>> On Thu, Feb 19, 2009 at 8:02 PM, Rishi Bhushan Agrawal
>>  wrote:
>>>
>>> I could recover all the files using the "testdisk" program on windows.
>>>
>>> I would like to proceed with correcting the MBR and the partition table.
>>>
>>>
>>> How do i do it ??
>>>
>>> On Thu, Feb 19, 2009 at 7:17 AM, Pranav Peshwe 
>>> wrote:

 On Thu, Feb 19, 2009 at 10:25 AM, rishi agrawal 
 wrote:
>
> Sorry for the previous mails
>
> I tried a NTFS recovery tool named as
>
> 1st NTFS Recovery 3.3.1.0( evaluation Version).
>
> It is very good. It took out the whole directory structure correctly.
> The only problem is that in order to access the files I need to pay for it
> and I dont want to do that.
>
> As the directory structure is correct it is proved that the partition
> is untouched and correct and simple MBR manipulations can result in
> recovering the drive correctly.
>
> I am quite hesitant to do anything without a clear cut idea as i may
> lose the data.

 Although it is off-topic on this list - i would suggest a simple thing
 here since you seem to have valuable data on the disk. Before you use any
 tools for recovery, create a raw copy(image) of the entire partition on
 another hard disk. The dd command in linux/unix will be useful for doing
 that. Once you have the image, you can mount it (in linux or any other OS 
 of
 your choice)  and experiment on it in various ways. This way, you won't 
 risk
 losing your data in case, any tool behaves badly.


 Best regards,
 Pranav
 http://pranavsbrain.peshwe.com
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Rishi B. Agrawal
>>>
>>
>
>
>
> --
> Regards,
> Rishi B. Agrawal
>
>

--
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: module state:permanent

2008-12-10 Thread arshad hussain
On Wed, Dec 10, 2008 at 3:05 PM, Balamurugan Subbian
<[EMAIL PROTECTED]> wrote:
> Even i faced the same problem. After analysis i found that
>
> It should not create problem in removing the mod as well if you are using
> "init_module" function.
> If you are using a different name for the startup function it should be
> declared as static as:
>
> static int __init startup(void)
>
> module_init(startup)
>
> Probably if the function is not static the kernel loses its refernce to the
> function and that
> makes it permanent.
>
> --Bala
> 
> From: amit mehta <[EMAIL PROTECTED]>
> To: Sandeep K Sinha <[EMAIL PROTECTED]>
> Cc: Kernel Newbie 
> Sent: Wednesday, 10 December, 2008 6:40:42
> Subject: Re: module state:permanent
>
> Thanks Sandeep, but still the question holds.
> Why this module would become permanent ?
>
> ~amit
>
> On Wed, Dec 10, 2008 at 11:46 AM, Sandeep K Sinha <[EMAIL PROTECTED]>
> wrote:
>>
>> Ya that's right.
>>
>> On Wed, Dec 10, 2008 at 10:48 AM, amit mehta <[EMAIL PROTECTED]> wrote:
>> > Hi All,
>> >
>> > Why would some module's state become permanent ?
>> > i inserted one module and when i try to remove it, i get:
>> > ERROR: Removing 'procsfs1': Device or resource busy

Hope this will help you.
http://lists.gllug.org.uk/pipermail/gllug/2006-January/057803.html

Thanks
>> >
>> > 
>> >
>> > Module  Size  Used by
>> > procsfs13204  0 [permanent] <-
>> >
>> > 
>> >
>> > The program code is here:
>> > http://tldp.org/LDP/lkmpg/2.6/html/x710.html
>> >
>> > rmmod help shows:
>> > [EMAIL PROTECTED]:/home/amit/# rmmod --h
>> > Usage: rmmod [-fhswvV] modulename ...
>> >  -f (or --force) forces a module unload, and may crash your
>> > machine.  This requires the Forced Module Removal option
>> > when the kernel was compiled.
>> >
>> > i looked into the .config file under /usr/src/linux
>> > and this seem to be the reason for even the --force option in rmmod not
>> > working:
>> > # CONFIG_MODULE_FORCE_UNLOAD is not set
>> >
>> >
>> You have to set that flag to enable forced unmount.
>>
>>
>>
>> > ~amit
>> >
>> > --
>> > "Everyone has a photographic memory. Some people just don't have film."
>> >
>> > — Mel Brooks
>> >
>>
>>
>>
>> --
>> Regards,
>> Sandeep.
>>
>>
>>
>>
>>
>>
>> "To learn is to change. Education is a process that changes the learner."
>
>
>
> --
> "Everyone has a photographic memory. Some people just don't have film."
>
> — Mel Brooks
>
>

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



Re: compiling kernel module for UML

2008-10-04 Thread arshad hussain
On Thu, Oct 2, 2008 at 9:20 PM, Chetan Nanda <[EMAIL PROTECTED]> wrote:
>
>
> On Tue, Sep 30, 2008 at 11:50 PM, arshad hussain <[EMAIL PROTECTED]>
> wrote:
>>
>> On Tue, Sep 30, 2008 at 11:12 PM, Chetan Nanda <[EMAIL PROTECTED]>
>> wrote:
>> > Hi All,
>> >
>> > I am trying my hands with User mode Linux.
>> > I am able to configure and kernel 2.6.24 under UML.
>> >
>> > Next It am trying to compile kernel module (so that modules can be
>> > insmod
>> > into running UML).
>> > But not able to compile my kernel module for UML.
>>
>> Hoping you are not missing "ARCH=um" in your "Makefile".
>> You also need the linux source.
>
> My Make file look like this:
> ##
> CC=gcc
> ARCH=um
> KERNELDIR=/root/Work/linux_src/linux-source-2.6.24
> ARCHDIR=$(KERNELDIR)/arch/um
> TTDIR=$(ARCHDIR)/kernel/tt
> SKASDIR=$(ARCHDIR)/kernel/skas
> CFLAGS= -DDEBUG -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include
> -I$(ARCHDIR)/include  -I$(TTDIR)/include -I$(SKASDIR)/include -Wall -Wunused
> -Wuninitialized -g -O
> ALL = hello_1.o
>
> all: $(ALL)
> 
>
> But on compiling module using 'make' make command gives me following error:
>  from hello_1.c:7:
> /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h: In
> function 'current_thread_info':
> /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h:50:
> error: 'CONFIG_KERNEL_STACK_ORDER' undeclared (first use in this function)
> /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h:50:
> error: (Each undeclared identifier is reported only once
> /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h:50:
> error: for each function it appears in.)
>
> Do I still missing something ?

In case you have not got answers from [EMAIL PROTECTED]
Try this... I use Makefile different from yours. Copied the simplest
when i first started
and stuck with it's style.

/* Sample make file , assuming your driver code is
 named driver.c */
obj-m += driver.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules ARCH=um
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean ARCH=um
/* end sample make file */

See to it that "/lib/modules/$(shell uname -r)/build" points to the
kernel source.

[EMAIL PROTECTED]@localhost dd]# ls -l /lib/modules/$(uname -r)/build
lrwxrwxrwx 1 root root 35 Dec 20  2007 /lib/modules/2.6.23.11/build ->
../../../umlkernel/linux-2.6.23.11/
[EMAIL PROTECTED]@localhost dd]#

My huch is there is something with your makefile, do we still need to
pass-D_KERNEL_ (etc)
in 2.6. This was done with 2.4.

Hope this help you in narrowing down the problem.

>
> Thanks,
> Chetan Nanda
>
>>
>>
>>
>> >
>> > Please point me into right direction.
>> >
>> > Thanks,
>> > Chetan Nanda
>> >
>> >
>
>

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



Re: compiling kernel module for UML

2008-09-30 Thread arshad hussain
On Tue, Sep 30, 2008 at 11:12 PM, Chetan Nanda <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am trying my hands with User mode Linux.
> I am able to configure and kernel 2.6.24 under UML.
>
> Next It am trying to compile kernel module (so that modules can be insmod
> into running UML).
> But not able to compile my kernel module for UML.

Hoping you are not missing "ARCH=um" in your "Makefile".
You also need the linux source.



>
> Please point me into right direction.
>
> Thanks,
> Chetan Nanda
>
>

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



Re: Writing onto disk sector

2008-08-20 Thread arshad hussain
Sorry. Missed the list.

On Wed, Aug 20, 2008 at 1:21 PM, Akhil <[EMAIL PROTECTED]> wrote:
> I am not sure whether this is a relevant question...please ignore if
> it seems nonsense
>
> Is it possible in linux (2.6 or 2.4) to write/read directly onto a
> particular disk sector? If yes , how?

I hope i got your question right. Then ...

fd = open("/dev/sda", ...);
lseek(...);
write(fd,...,...);

> where /dev/sda is your whole disk. You may want to change
it to /dev/sda1 (etc... for logical sectors)

> lseek to your distination

> write.

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

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



Re: configuring the Kernel

2008-08-11 Thread arshad hussain
On 8/11/08, onnm <[EMAIL PROTECTED]> wrote:
> Hi , that  was an Idea taken from your book Greg (LKN !) :-) but I am really
> looking out to automate this task - this will save lot of  time and put in
> that time into something more interesting ;-) !
>
>
> On Mon, Aug 11, 2008 at 10:27 AM, Greg KH <[EMAIL PROTECTED]> wrote:
>
>> On Mon, Aug 11, 2008 at 09:04:30AM +0530, onnm wrote:
>> > I am trying to write a script which will enable (update) Kernel to be
>> > automatically configured based on following things :
>> >
>> > (1) active modules in /proc/modules
>> > (2) output of lspci
>> >
>> > where else can I see to get a very minimal  kernel image which will be
>> > required to run on a given machine ( obviously , running all devices
>> which
>> > were previously working !!)

I did it a little differently. Objective was to run a minimal linux kernel
on a verity of hardware(different make of nic's, scsi controller etc).
So I prepared a kernel with most of the things as installable modules.
Very few thing were compiled into the kernel. That few things was
ext2/3, ramdisk etc... (which must be).

This was about it . As Linux boots, a script runs hwinfo and
modprob's the drivers.

Actually as soon as i read this message, i ran to find the config.gz
for that kernel i made but i could not. I do not guarantee,but if i am able
to find i will post here... its being few years now. I also say its easy
to prepare one.

Thanks.

>>
>> That's pretty simple, boot a distro kernel, take the installed modules,
>> and then only configure them in.
>>
>> > I thought Kernel configuration is a daunting task
>> > kernels which are configured for various distros (for instance Debian !
>> > )
>> > are not optimally configured for a specific machine  (hence, make
>> oldconfig
>> > does not necessarily give optimal image !)
>> >
>> > Automatically configured kernel would be a great Idea and save lot of
>> time
>>
>> It would, that's why other people have done this before, you might want
>> to research some of that first :)
>>
>> good luck,
>>
>> greg k-h
>>
>

--
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 kernel debugging

2008-05-05 Thread arshad hussain
Missed the forum Again!!!

On 5/5/08, arshad hussain <[EMAIL PROTECTED]> wrote:
>
>
> On 5/5/08, amol verule <[EMAIL PROTECTED]> wrote:
> >
> > hi to all,
> > i am new to kernel .can any one tell me about document for debugging
> > kernel.
> > is any patch is require for it i.e kdb kgdb?
>
>
> Yes.  IMHO even probes have a patch.
> So you are limited to the kernel which
> the existing patch is available.
>
> i am using 2.6.21 kernel i have compiled this kernel with DEBUG_KERNEL=y
> > option anything else is require to enable?
> > how can i debug my kernel ?
>
>
> Have a look at UML. This way you can use gdb to debug
> your kernel.  There are documentatiton how to do this
> in the UML page.
>
> Thanks
>
>
>
>


Re: SMP and ACPI.

2008-03-17 Thread arshad hussain
I hope, there is some way out. Otherwise, the option i'm thinking of is -
> running the Redmond OS as host and installing the linux server in a
> uniprocessor virtual machine.
>
> Suggestions gladly welcome.
>
>
If your idea is to run linux and not the latest kernel , then
give  OpenSUSE 10.2 (2.6.18.2-34, patched ).
a shot. Not 10.3. I cannot put my finger on the problem
but it got my laptop going where the fedora (forgot the version)
distribution could not. Worth a try.

Thanks.


Re: question about kernel panic

2008-03-06 Thread arshad hussain
On 3/6/08, vichy <[EMAIL PROTECTED]> wrote:
>
> Dear all:
> I download Linux 2.6.20.10 and make the kernel by selecting EVERY ide
> device
> driver
> But I reboot it with a kernel panic like below:
> "Not syncing: VFS: unable to mount root fs on unknown-block (0,0)"
> Could someone tell me where I go wrong?
> Sincerely Yours,
> vichy


Have a look at the "Linux Kernel in a Nutshell" Book from Greg
Kroah-Hartman. You can download it for free at http://www.kroah.com/lkn/.


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


Re: question about kernel panic

2008-03-06 Thread arshad hussain
On 3/6/08, vichy <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> The /proc seems not contain the file you mention.
>

My bad. Its /proc/config.gz (without the dot). This entry only
comes if your kernel is configured for it. Else you can find
config under /boot/config-... .



Sincerely Yours,
>
> vichy
>
>
> ----------
>
> *From:* arshad hussain [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, March 06, 2008 7:43 PM
> *To:* [EMAIL PROTECTED]
> *Cc:* kernelnewbies@nl.linux.org
> *Subject:* Re: question about kernel panic
>
>
>
>
>
> BTW, how could I get the old configuration, since I install the present OS
> by Fedora8-install-DVD.iso
>
> Also  /proc/.config.gz has your configuration for the running kernel.
>
>
>
> *rom:* arshad hussain [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, March 06, 2008 5:17 PM
>
>
> *To:* [EMAIL PROTECTED]
> *Cc:* kernelnewbies@nl.linux.org
> *Subject:* Re: question about kernel panic
> --
>
>
>
>
>
> On 3/6/08, *vichy* <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> Here the .config is.
>
>
> A quick look shows if the /root is on IDE device the .config look OK.
> The SCSI is missing though. However Danial advice is appropriate
> use oldconfig to build the new kernel.
>
> Thanks.
>
>
> --
>
> *From:* arshad hussain [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, March 06, 2008 4:14 PM
> *To:* [EMAIL PROTECTED]
> *Cc:* kernelnewbies@nl.linux.org
> *Subject:* Re: question about kernel panic
>
>
>
>
>
> On 3/6/08, *vichy* <[EMAIL PROTECTED]> wrote:
>
> Dear all:
> I download Linux 2.6.20.10 and make the kernel by selecting EVERY ide
> device
> driver
> But I reboot it with a kernel panic like below:
> "Not syncing: VFS: unable to mount root fs on unknown-block (0,0)"
> Could someone tell me where I go wrong?
> Sincerely Yours,
> vichy
>
>
> IDE device driver is OK. But you also need FS (ext2/3, xfs ...)
> build into you kernel.  Post you .config file if you think its
> more comlicated than this.
>
> Thanks.
>
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [EMAIL PROTECTED]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
>
>
>
>
>
>
>


Re: question about kernel panic

2008-03-06 Thread arshad hussain
BTW, how could I get the old configuration, since I install the present OS
> by Fedora8-install-DVD.iso
>
Also  /proc/.config.gz has your configuration for the running kernel.

*rom:* arshad hussain [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, March 06, 2008 5:17 PM
> *To:* [EMAIL PROTECTED]
> *Cc:* kernelnewbies@nl.linux.org
> *Subject:* Re: question about kernel panic
> --
>
>
>
>
>
> On 3/6/08, *vichy* <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> Here the .config is.
>
>
> A quick look shows if the /root is on IDE device the .config look OK.
> The SCSI is missing though. However Danial advice is appropriate
> use oldconfig to build the new kernel.
>
> Thanks.
>
>
> --
>
> *From:* arshad hussain [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, March 06, 2008 4:14 PM
> *To:* [EMAIL PROTECTED]
> *Cc:* kernelnewbies@nl.linux.org
> *Subject:* Re: question about kernel panic
>
>
>
>
>
> On 3/6/08, *vichy* <[EMAIL PROTECTED]> wrote:
>
> Dear all:
> I download Linux 2.6.20.10 and make the kernel by selecting EVERY ide
> device
> driver
> But I reboot it with a kernel panic like below:
> "Not syncing: VFS: unable to mount root fs on unknown-block (0,0)"
> Could someone tell me where I go wrong?
> Sincerely Yours,
> vichy
>
>
> IDE device driver is OK. But you also need FS (ext2/3, xfs ...)
> build into you kernel.  Post you .config file if you think its
> more comlicated than this.
>
> Thanks.
>
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [EMAIL PROTECTED]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
>
>
>
>


Re: question about kernel panic

2008-03-06 Thread arshad hussain
On 3/6/08, vichy <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> Here the .config is.
>

A quick look shows if the /root is on IDE device the .config look OK.
The SCSI is missing though. However Danial advice is appropriate
use oldconfig to build the new kernel.

Thanks.

------
>
> *From:* arshad hussain [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, March 06, 2008 4:14 PM
> *To:* [EMAIL PROTECTED]
> *Cc:* kernelnewbies@nl.linux.org
> *Subject:* Re: question about kernel panic
>
>
>
>
>
> On 3/6/08, *vichy* <[EMAIL PROTECTED]> wrote:
>
> Dear all:
> I download Linux 2.6.20.10 and make the kernel by selecting EVERY ide
> device
> driver
> But I reboot it with a kernel panic like below:
> "Not syncing: VFS: unable to mount root fs on unknown-block (0,0)"
> Could someone tell me where I go wrong?
> Sincerely Yours,
> vichy
>
>
> IDE device driver is OK. But you also need FS (ext2/3, xfs ...)
> build into you kernel.  Post you .config file if you think its
> more comlicated than this.
>
> Thanks.
>
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [EMAIL PROTECTED]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
>
>


Re: question about kernel panic

2008-03-06 Thread arshad hussain
On 3/6/08, vichy <[EMAIL PROTECTED]> wrote:
>
> Dear all:
> I download Linux 2.6.20.10 and make the kernel by selecting EVERY ide
> device
> driver
> But I reboot it with a kernel panic like below:
> "Not syncing: VFS: unable to mount root fs on unknown-block (0,0)"
> Could someone tell me where I go wrong?
> Sincerely Yours,
> vichy


IDE device driver is OK. But you also need FS (ext2/3, xfs ...)
build into you kernel.  Post you .config file if you think its
more comlicated than this.

Thanks.

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


Re: unclean root file-system after shutting down from single-user-mode

2008-02-13 Thread arshad hussain
> The problem comes when stopping the system.
> The only way to do it is by pressing CTRL+ALT+DEL as CTRL+C does not
> work in that mode.
> Unfortunately, by using CTRL+ALT+DEL combination, Linux kernel does
> the unclean unmounting of root filesystem.
> This causes the file-system check on next boot time. :-(
>
> Try Ctrl-D.  Editing /etc/inittab to boot single user is another option.

Thanks


Re: Can a filesystem be mounted twice?

2008-02-12 Thread arshad hussain
On 2/13/08, Raseel Bhagat <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> On Feb 13, 2008 7:37 AM, Peter Teoh <[EMAIL PROTECTED]> wrote:
>
> > I attempted to mount the different harddisk to the same logical
> > filesystem (the other way is multiple logical filesystem to the same
> > harddisk, or double mounting, which i don't see it as a problem, and
> > it is allowed as well), but this is not logical==>
> >
> > mount /dev/sda2 /mnt/fdrive
> > mount /dev/sdb2 /mnt/fdrive
> >
> > and both device will get mapped to the same logical filesystem
> > (fdrive)..this is a bug?
> >
>
>
> >
No its design. A directory which is used as a mount point,
after any filesystem is mounted on it, its previous contents
are not accessiable.  Threrefore...

# mount /dev/sda2 /mnt/fdrive
# mount /dev/sdb2 /mnt/fdrive

/dev/sda2 contents will not be visiable. /dev/sda2 can
only be visiable after "umounting" /dev/sdb2.

Thanks


Fwd: driver associated with device

2008-01-30 Thread arshad hussain
-- Forwarded message --
From: arshad hussain <[EMAIL PROTECTED]>
Date: Jan 31, 2008 12:07 PM
Subject: Re: driver associated with device
To: Onkar <[EMAIL PROTECTED]>



On 1/31/08, Onkar <[EMAIL PROTECTED]> wrote:
>
> How to get the driver associated with the device ? for e.g. dirver
> associated with SATA drive , driver associated with eth0 ?
>
> This one comes quickly to the mind.
# ls /lib/modules/`uname -r`/kernel/drivers

Thanks


Re: initrd image ??

2008-01-21 Thread arshad hussain
On 1/21/08, arshad hussain <[EMAIL PROTECTED]> wrote:
>
>
> Any way(tool) to know which modules constitute the initrd image of X ?? or
> > Any more sophisticated way ??
> >
> >
> > Thanks & regards,
> > Onkar Mahajan
>
>
> /proc/ config.gz have bailed me out in many occasion.
> Not a sophisticated method, but effective.
>
> Thanks
>
>
> Missed kernelnewbies.


Re: Partitions ?? Boot flag ??

2008-01-18 Thread arshad hussain
> What is the significance of Boot flag ???


BIOS looks for boot flag to determin which
partiton to find bootloader. That is if you have
installed grub in two differnt partitions say /dev/hda5
and /dev/hda7, boot partition will point either to
/dev/hda5 or /dev/hda7.

Its for user to select using `which fdisk`

and the there are K for RAID and LVM partitions what are those ?
>
>
> Are you talking about partition id? Other than this
i do not know this 'K'.


Re: scull device driver query !!

2008-01-07 Thread arshad hussain
On Jan 6, 2008 6:58 PM, Onkar <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> i am implementing scull (character device driver in LDD : chapter 3 ) , in
> that I found ::
>
> Please refer to Linux Device Drivers Rubunu et al  , 3/e.pg 57
>
> ssize_t scull_read(struct file *filp, char __user *buf, size_t count,loff_t
> *f_pos)
>
> Scull_Dev *scull_follow(Scull_Dev *dev, int n)
> {
> while (n--) {
> if (!dev->next) {
> dev->next = kmalloc(sizeof(Scull_Dev), GFP_KERNEL);
> <<<== why memory allocations in read operations??
> memset(dev->next, 0, sizeof(Scull_Dev));
> }
> dev = dev->next;
> continue;
> }
> return dev;
> }
>
> IMHO this implementation is WRONG ?? Correct me if I am wrong.
>
> other implementation is :
>
> /*
>  scull_follow
> Take a walk in the linked list until node 'n' has been reached.
> */
> struct scull_qset* scull_follow(struct scull_dev *dev, int n){
>   struct scull_qset *qs = dev->data;
>
>   // Allocate first node if needed


 Only if qs == NULL then allocate memory. (In case of write)
else skip this statement block altogether. For read and if qs has
some persistent data already, this statement block will be skipped.


>   if(!qs) {
> // Reserve memory
> qs = dev->data = kmalloc(sizeof(struct scull_qset), GFP_KERNEL);
> // Failure :(
> if(qs == NULL){
>   return NULL;
> }
> // Zero out the region
> memset(qs, 0, sizeof(struct scull_qset));
>   }


Same  below.

>
>
>   while(n--){
> // If the next node does not exist, allocate it.
> if(!qs->next){
>   qs->next = kmalloc(sizeof(struct scull_qset), GFP_KERNEL);
>   if(qs->next== NULL){
> return NULL;
>   }
>   memset(qs->next, 0, sizeof(struct scull_qset));
> }
> qs = qs->next;
> continue;
>   }
>   return qs;
> }
>
> But here too i am not convinced with memory allocation ?? Why memory
> allocations in read when we only
> want to reach the first partially filled node ??
>
>
Thanks.


Re: Debugging functions for kernel modules

2007-12-31 Thread arshad hussain
On 12/31/07, Manish Katiyar <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Do we have any helper functions present in the kernel code to print
> the information about commonly used data structures in the code which
> might help in debugging.
> For example something like :
>
> void print_buffer_head(struct buffer_head *bh, char *level){
>  printk(level "Buffer state = %d \n",bh->b_state);
>  printk(level "Buffer users = %d\n",bh->b_count);
> ..
>..
>/* Print other relevant fields */
>return;
> }
>
> Similarly for other structures like superblock etc. so that it will
> help newbies who are in kernel development to quickly add a debugging
> statement and see the values. We can also have a callback if the
> structure contains any module/filesystem specific info to be printed.
>
> If they are not present , how about having them ??? Any
> thoughts/suggestions/comments/ appreciated.
>
> --
> Thanks & Regards,
> 
> Manish Katiyar  ( http://mkatiyar.googlepages.com )
> 3rd Floor, Fair Winds Block
> EGL Software Park
> Off Intermediate Ring Road
> Bangalore 560071, India
> ***
>
>
>
Most debugger allows to make a function call. For complicated data
structures,  a function can be written to traverse that data structure.
This function may not be called withing the code , its just needs to
be there.

Now withing the debugger you can manually check the
values of data structure by calling you traverse->print routine.


Re: Ext3 layout and I/O performace

2007-12-27 Thread arshad hussain
Sorry , missed the forum.
On 12/27/07, arshad hussain <[EMAIL PROTECTED]> wrote:
>
>
>
> On 12/27/07, Wang Yu <[EMAIL PROTECTED]> wrote:
> >
> >  My questions are:
> > 1.Why the performances under different subdirs varies so much? for example 
> > in /mnt/test/0 the performance is 72/80, while in /mnt/test/1 the 
> > performance is 49/53
> >
> >
> My guess is this is not consistent. Over several calls, this is bound to
> vary. As the kernel caches the directory.
>
> 2.The extents of all files are nearly the same, but their performances are 
> different. Are there other factors that influence the performance beside of 
> the extents(fragmentation) of the file?
> >
> >
> Kernel can bunch various call to block device,  together for performance.
> It always caches recently accessed data. (Slab allocator)
>
> 3.Is it true that more files exist in a directory, lower performance? for 
> example the performance in /mnt/test/5/tmpfile is 66/75, while the 
> performances in /mnt/test/5/tmpfile2 and tmpfile3 are 57/64 and 54/59
> >
> >
>  I think you are correct, as the directory grows large enough to jump a
> group
> the performance is bound to suffer.
>
> Thanks
> >
> > --
> > National Research Center for Intelligent Computing Systems
> > Institute of Computing Technology, Chinese Academy of Sciences
>
>
>


Re: why use memcpy when memmove is there

2007-08-14 Thread arshad hussain
On 8/13/07, SK malik <[EMAIL PROTECTED]> wrote:
>
> Hi, All
>
> We were looking at  "[kernel]/lib/string.c"
> (http://lxr.linux.no/source/lib/string.c#L500)
>
> memcpy copies a part of memory to some other location
> but It will not work for all cases of overlapping
> blocks.(if the start of destination block falls
> between the source block)
>
> while memove copes with overlapping areas.
>
> then why is memcpy present in the sources can't we
> simply do
>
> "#define memcpy memmove" in include/linux/string.h
>
> or am I missing something?
>
> Regards
> Sri--
> SK Malik
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [EMAIL PROTECTED]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
Hi Sri,

My guess ...
1. fitness of purpose,
2. memcpy _MAY_ be faster than memmove

Thank You