Re: Non-web based LXR

2017-10-31 Thread François
On Tue, Oct 31, 2017 at 01:14:30PM +1100, Tobin C. Harding wrote:
> So, thank you for your ideas. I'll consider this issue resolved by;
> 
> Use git grep
> Use ctags/etags
> Use free-electrons as a last resort

Also, there's a tool called cscope [1].
There are also occurences of coccigrep [2] in the kernel.

[1] 
https://courses.cs.washington.edu/courses/cse451/12sp/tutorials/tutorial_cscope.html
[2] https://home.regit.org/software/coccigrep/

--
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: I want write more important things

2017-05-18 Thread François
On Thu, May 18, 2017 at 06:34:40PM +0300, Roman Storozhenko wrote:
> 1) Complete eudyptula challenge. It contains 20 kernel-related tasks.
> I have completed 8th task and awaiting to response and I want to say that
> this is a very good challenge for newbies.

Eudyptula is now closed to new registrations :(

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Per container uptime?

2017-04-13 Thread François
Hi,

after reading that post [1] on serverfault, I was wondering whether it
would make sense to implement a per container uptime.

Do you think it makes sense at all?
Any hint on how to get started on that?

Thanks

François

[1] 
http://serverfault.com/questions/830643/uptime-command-gives-weird-results-in-a-docker-image

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Free Linux/Ubuntu VMs for Kernal Development?

2017-03-14 Thread François
On Tue, Mar 14, 2017 at 12:18:33PM +0800, Freeman Zhang wrote:
> On 3/14/17 12:04 PM, Balaji Barmavat wrote:
> > Anybody's has any VM's links to download, for practice kernel
> programming?
> 
> Well, I am using QEMU system emulator, for it's easier to connect to GDB
> debugging and itself handles bootloader thing. You can set all things up
> by one line parameters, really tidy.
> 
> The disadvantage is that I've been told system running in QEMU is slow,
> but for kernel programming that wouldn't be the problem, will it?
> 
> What about others?

Depending on what you're working on, you can also use User Mode Linux
(UML) [1] which produces a elf, that you can run easily on top of your
existing linux distro.
Basically, you have to choose the "um" arch when compiling your kernel.

[1] http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO.html

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Char device write repeating

2016-10-05 Thread François
On Tue, Oct 04, 2016 at 03:42:52PM -0300, Daniel. wrote:
> Because the libc is calling it again based on what has been passed as
> argument and what was received as return value. Here is one example
> https://gist.github.com/gkos/5479135. I don't really know if this code is
> working since I made it a long time ago.

Your test to check wether the device is already open looks weak to me.
You should rather use atomic operations such as described in [1] or
mutex like in [2].

[1] http://www.oreilly.com/openbook/linuxdrive3/book/ch06.pdf p 40
[2] http://pete.akeo.ie/2011/08/writing-linux-device-driver-for-kernels.html

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: insmod failing to insert a simple module

2016-09-29 Thread François
On Thu, Sep 29, 2016 at 05:54:55PM +0530, Madhu K wrote:

> So both are machining, what could be the problem?

You've been said to watch on the kernel logs.
What's in there?

What kind of simple module is that? Can you provide some code?
It's a bit hard to find issues with no informations...

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eduyptula task 2 doubt.

2016-09-08 Thread François
On Thu, Sep 08, 2016 at 01:21:22PM -0700, Vipul Jain wrote:
> Hi,
> 
> I got kernel from
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git and
> build and booted my kernel with CONFIG_LOCALVERSION_AUTO set and uname
> -r comes out as 4.8.0-rc5-42-desktop and even the git tag list
> v4.8-rc5 as the latest but still penguin did not accept my task just
> wanted to know is penguin correct and I need to focus on getting the
> latest linux source or this is penguin issue. Please kindly let me
> know I have submitted twice to penguin but he does not seems to be
> happy.

You may have not activated the right config option.
My output was more like:

root@localhost ~]# uname -ra
Linux localhost 4.4.0fser-06534-gece6267 #2 SMP Mon Jan 18 22:36:48 CET 2016 
x86_64 x86_64 x86_64 GNU/Linux

Try again :)

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Send packets from userspace program to kernel interface

2016-08-16 Thread François
On Mon, Aug 15, 2016 at 11:30:56PM -0700, Bhaskar Upadhyayula wrote:
> Hello All,

Hi!

> A colleague suggested looking at Tuntap interfaces. I did a quick
> research and it did not appear that can be done.
> 
> Any suggestions or pointers for further reading will be very
> helpful.

I also think tun/tap will do the work you need.
I did not properly understand what exactly you want to achieve.
Anyway, have a look on that tutorial on tun/tap [1]. It's a great
overview of what you can do with this facility.

[1] http://backreference.org/2010/03/26/tuntap-interface-tutorial/

Best regards,
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: one more new Bie

2016-08-09 Thread François
On Mon, Aug 08, 2016 at 10:40:08PM +0530, Saket Sinha wrote:
> Hi,
> 
> The ideal way to start is to write some basic kernel drivers. Look for the
> tutorial at the following links -
> 
> 
> 1. Linux Device Drivers 3 examples updated to work in recent kernels
> http://examples.oreilly.com/9780596005900/

Not that recent obviously :(
For instance, in sbull, they use blk_fs_request which does not exist
anymore.

--
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: one more new Bie

2016-08-06 Thread François
On Sat, Aug 06, 2016 at 09:54:59PM +0530, Saket Sinha wrote:
> Hi Anurag,
> 
> Welcome to the list. This is a query forum but we can surely help you with
> getting started.
> 
> Take up Eucalyptus challenge or the TODOs in the staging area driver if
> you're interested in kernel development.

I think you're talking about eudyptula [1], unfortunayelly, it seems that little
has been out of business for quite a while now.

[1]  http://eudyptula-challenge.org/

@Anurag: welcome here :)

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Stupid question regarding bogomips and udelay()

2016-08-01 Thread François
Hello, that's an interesting question!
I'm currently reading the same book, but you've read more than me so far :)

On Mon, Aug 01, 2016 at 08:36:07AM +0300, Aleksander Alekseev wrote:
> * bogomips value (see `cat /proc/cpuinfo`) is determined only once
>   during system boot

As far as I know, I is (was?) the case.

> It's my understanding that it shouldn't work. CPU frequency actually
> changes manually (see cpufrequtils) and/or automatically depending for
> instance on laptop's current battery charge. There is also such a nasty
> thing as Intel Turbo Boost. In other words actual MIPS could be higher
> or lower than measured MIPS. So udealy() can't guarantee anything.

Makes sense. Do you have such machine? Did you try to get bogomips and then
reduce your CPU count / speed and get that number again?

Maybe this value is now dynamic.

Also, did you actually try udealay() in high/low frequency to see wether you
see an actual difference between runs?

Sorry I don't have final answers!

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Minimul Config file for Dev Environment

2016-07-30 Thread François
On Sun, Jul 31, 2016 at 01:24:58AM +0530, Jitendra wrote:
> Hi Folks,

Hi!

> I usually compile the linux kernel by copying current system .config file. 
> But the
> problem it compile bunch things that I don't which is required. My aim
> is setup filesystem environmrnt setup on my laptop.
> 
> Could somebody point the minimal .config file that will save from me
> reading all the options and compile the kernel quickly and test it.

I use make default which creates a working .config and then edit it.
You can use qemu (until some point) to make sure the kernel boots.

Good luck!

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Help understanding block layer sample in LDD3

2016-07-29 Thread François
On Fri, Jul 29, 2016 at 04:26:41PM +0530, Pranay Srivastava wrote:
> On Fri, Jul 29, 2016 at 4:15 PM, François  wrote:
> > On Fri, Jul 29, 2016 at 03:58:28PM +0530, Pranay Srivastava wrote:
> >>
> >> I don't see req->buffer. Which version you are using?
> >
> > You're absolutely right. Both [1] and [2] seems to be outdated.
> > I'm currently compiling and testing most of my code on a 3.19 on a 14.04 
> > LTS ubuntu in a VM,
> > rather than the actual kernel. It's simpler for me to work that way.
> >
> > [1] https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c#L119
> > [2] 
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/block/biodoc.txt
> >
> > [...]
> >>
> >> If this is a memory backed block driver, then perhaps you can handle
> >> multiple requests[?]. I don't think you need
> >> to actually break up the same request into multiple requests.
> >
> > Actually, it is a shared memory based. Hence, a request might larger than 
> > the available room in
> > the shared memory. This case has to be handled.
> 
> So basically you hold on to some pages[?] and use that as your disk right?

Well those shared pages are used to exchange chunks of data with another party, 
which will itself
get those data, produce bio, submit bio, and put response on the shared region.

> I guess setcapacity should take care of this [no?]

The set_capacity() value is the one reported by the other party which queries 
an actual block device.
Eventhough request size could be resized, if the other party takes time to 
respond, very few memory
might be available, but large request can be enqueued. So limiting the capacity 
does not seem to be an option here.

> I think if you just take care of the proper mapping of sector(s) to
> your driver then
> it should be alright.
> 
> Too large request shouldn't reach your driver even when you
> have the device opened as raw and not mounted it.
> 
> >
> > Thanks for your input!
> >
> > --
> > François
> 
> 
> 
> -- 
> ---P.K.S

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Help understanding block layer sample in LDD3

2016-07-29 Thread François
On Fri, Jul 29, 2016 at 03:58:28PM +0530, Pranay Srivastava wrote:
> 
> I don't see req->buffer. Which version you are using?

You're absolutely right. Both [1] and [2] seems to be outdated.
I'm currently compiling and testing most of my code on a 3.19 on a 14.04 LTS 
ubuntu in a VM, 
rather than the actual kernel. It's simpler for me to work that way.

[1] https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c#L119
[2] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/block/biodoc.txt

[...]
> 
> If this is a memory backed block driver, then perhaps you can handle
> multiple requests[?]. I don't think you need
> to actually break up the same request into multiple requests.

Actually, it is a shared memory based. Hence, a request might larger than the 
available room in 
the shared memory. This case has to be handled.

Thanks for your input!

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Help understanding block layer sample in LDD3

2016-07-29 Thread François
Hi there,

I've been reading LDD3's chapter 16 on block devices a few times, and have made 
toys 
block layers module. Now I've been looking at the up-to-date examples provided 
by martinez javier[1],
but still there's a fundamental concept I fail to understand.

Considering only the RM_FULL and RM_SIMPLE cases, a request queue is created, 
bound with a lock, and associated
with a request function.

In the simple case, that function "sbull_request" processes each request from 
the request queue, and delegates
the work to "sbull_transfer", which basically performs some arithmetic and does 
the actual data copy.
This function is given a sector, a number of sectors, a pointer to a buffer, 
and a read or write parameter
extracted from the request using blk_rq_pos(), blk_rq_cur_sectors(), 
req->buffer and rq_data_dir() respectively.
 
On the other hand, the same mechanism is used, but a different function is 
associated: "sbull_full_request".
That function also extracts requests and delegates the actual work to 
"sbull_xfer_request" which iterates on
the request's bio, calls "sbull_xfer_bio" which itself iterates on the bio's 
segments and finally, 
calls the same "sbull_transfer" function.

What I fail to understand is: how (with the same initialization) the behaviour 
of the module using those two
somehow different mechanism is equivalent.

One has to understand the full complexity of the underlying data structure 
(requests having bio, having segments)
while the other only reads the containing structure (the struct request) and do 
the same job, without iterations.

Bonus point, to give some context: I'm writing an asynchronous block-layer 
which has to split requests into custom subrequest.
I'm wondering which approach (between those two) I should pickup.

Thanks for reading so far, and for any hints :) 


[1] https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c
-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Are these books outdated?

2016-07-23 Thread François
On Thu, Jul 14, 2016 at 02:01:55PM +0300, Aleksander Alekseev wrote:

Hello Aleksander,

I only know LDD 3:
> * Linux Device Drivers, 3rd Edition (2005)

Since this book is freely available in PDF, I would advise you to read it.
It is out-dated (in sense you won't compile snippets as is) but it is well
written, and pleasant to read.

The version 4 was scheduled for dec 2015 iirc, but is now annonced for nov 2017
on O'Reilly's website.

> Could you tell me please, are these books considered worth reading in
> year 2016 or they are completely out of date? Perhaps there are some
> newer books and/or tutorials you could recommend?

That's an interesting question, I'm willing to know the opinion of 
other members of kernelnewbies on those books, and others they would recommand.

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Are these books outdated?

2016-07-14 Thread François
On Thu, Jul 14, 2016 at 02:01:55PM +0300, Aleksander Alekseev wrote:

Hello Aleksander,

I only know LDD 3:
> * Linux Device Drivers, 3rd Edition (2005)

Since this book is freely available in PDF, I would advise you to read it.
It is out-dated (in sense you won't compile snippets as is) but it is well
written, and pleasant to read.

The version 4 was scheduled for dec 2015 iirc, but is now annonced for nov 2017
on O'Reilly's website.

> Could you tell me please, are these books considered worth reading in
> year 2016 or they are completely out of date? Perhaps there are some
> newer books and/or tutorials you could recommend?

That's an interesting question, I'm willing to know the opinion of
other members of kernelnewbies on those books, and others they would recommand.

--
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: LINKS PLEASE

2016-05-17 Thread François
Hello,

On Tue, May 17, 2016 at 08:48:59AM +, Gnoleba GNOGBO wrote:
> Hi !
> I am beginning my learn of Linux !
> Can you show (give) me the good link for :
> 
> 
>1. the management of the all memory in Linux ( Rom, Ram, cache,
>Registers, swap and fs)
>2. the management of the all process (initialization, user process,
>kernel process )
>3. the all tables in memory to manage the data and process

There might be out-dated things in the document, but I think it's a good start 
for you.
http://www.csn.ul.ie/~mel/projects/vm/guide/pdf/understand.pdf

-- 
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: can anyone tell me which function to call to pause the kernel

2016-05-12 Thread François
On 05/12/2016 04:55 PM, walkerlala wrote:
> I successfully insert some function into the kernel code and make it 
> execute when the kernel start up, but I just can't make the kernel stop 
> executing. Are there any functions which can pause the kernel so that I 
> prompt the user, and let the user input a command(maybe a comment to 
> display the current time. Something like a shell would do) and interact ?

I don't think you can actually stop the kernel. The linux kernel is
multi-threads and events driven, so I doubt you can stop and restart it
that easily.

BUT

if you want to interract with userland, you can implement a syscall on
your own, or create a proc device (for instance) to let user read /
write data to the kernel.

For instance, you could create a proc entry called gettime, and when
user reads it (ie: cat /proc/gettime) you would provide a proper answer.

Hope this help.

François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Reading disks sectors

2016-03-29 Thread François
Hello,

I'm trying to read raw disks sectors using bio requests.
I found a sample in a stackoverflow answer which seems to do exactly
what I'm trying to : http://stackoverflow.com/a/17527300/51760
Reading this, a few questions came to me:


1/ The API is outdated, and bio struct no longer have bi_sector for instance.
Those fields are now in bvec_iter (see
http://lxr.free-electrons.com/source/include/linux/blk_types.h?v=3.19).

bio struct do have  bi_iter field, so I was wondering wether it's safe
to populate the bi_iter directly ie:

- bio->bi_sector = sector;
+ bio->bi_iter.bi_sector = sector;

2/ There is a generic bi_endio function in bio.c.
What should readComplete implement? IMO it should just complete the
"event" (of type struct completion), and then I can just call the
bio_endio function provided by bio.c. Is that correct?

Thanks in advance!

---
François

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Re: [Qemu-devel] [PATCH v4 4/4] devicetree: update documentation for fw_cfg ARM bindings

2015-11-26 Thread François Revol
On 17/11/2015 23:14, Rob Herring wrote:
> On Mon, Nov 16, 2015 at 2:38 AM, Paolo Bonzini  wrote:
>>
>>
>> On 15/11/2015 03:07, Rob Herring wrote:
>>> We generally don't want DT docs to depend on other kernel documentation.
>>
>> DT docs do not contain a copy of the data sheets, either.  There is no
>> reason to say how to use the device (and even then, only doing so
>> partially) in the DT docs.
> 
> The difference is datasheets apply to all OS's, kernel documentation
> does not. In theory at least this could be used for other OS's, right?

Would be nice indeed, as it's part of their intended purpose.

For now we have to shoehorn things into linux-only stuff (like initrd)
because well, nobody cares enough about NetBSD to compile U-Boot with
its internal API, so let alone adding custom Haiku code.

And of course, for things linux doesn't care about (like framebuffer
description) then we're stuck trying to guess where it's at and writing
drivers for our bootloader.

So if at least people were considering they aren't the only users of
this, that'd make life better for everyone.

> Perhaps QEMU is the right place to thoroughly describe this and DT and
> sysfs docs can refer to it.

The brilliant idea of FDT was that we could have a canonical source and
blob for it where people could send patches, but of course Linux and BSD
freaks disagreed, so you now find Linux-flavoured DTs for rPi and other
things, as well as BSD versions.

Please, at least get the binding documentation for this unique and
usable for everyone!

François.


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies