Re: Regarding getrandom syscall
Hi, Maybe your unistd.h comes from an older kernel? That would explain why it doesn't define that symbol. Here [1] is some code using that syscall successfully, you can see it looks a lot like Sayutin's code, except it does a few more compile-time and runtime checks to fallback on using /dev/urandom if necessary. [1]: https://github.com/ARMmbed/mbedtls/blob/dd9895d8101f17ce804830472cbb140eba1c46a0/library/entropy_poll.c#L85 Manuel. On 21/06/2016 15:41, Avantika Rawat wrote: > Hi, > > Thanks for the suggestion but i am getting following error > > error: 'SYS_getrandom' undeclared (first use in this function) > > then i have replaced the SYS_getrandom by 275 in syscall(275, -- args--); > as 275 is the __NR_getrandom defines in unistd.h file, but it is > returning -1. > Can somebody tell me what i am missing here?? > > . Also in /proc/kallsyms it is showing two syscalls added for getrandom > > 80417a38 T SyS_getrandom > 80417a38 T sys_getrandom > > On Sat, Jun 18, 2016 at 7:12 PM, Sayutin Dmitrywrote: >> Well, in fact it is not hard. >> >> Just use syscall(2) provided by libc. >> >> You need to provide to this function syscall id and syscall args. >> Syscall id can be retrieved from macro constant >> Should look something like: >> >> #define _GNU_SOURCE >> #include >> #include >> >> syscall(SYS_getrandom, -- your - args - here --); >> >> It returns long value - the result of syscall. >> If it is between [-4095; -1] then it is negated errno, otherways it is >> return value. >> >> >> 18.06.2016, 16:32, "Anoop" : >>> Hi Avantika, >>> >>> On Sat, Jun 18, 2016 at 5:32 PM, Avantika Rawat >>> wrote: Hi ALL, I am trying to use getrandom syscall in kernel 3.10.20 by following this link https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895 i have compiled the kernel and now want to call the getrandom syscall from userspace to generate random numbers. But i am getting following error while calling the getrandom () from userspace. (.text.startup+0x18): undefined reference to `getrandom' (.text.startup+0x1c): undefined reference to `getrandom' >>> >>> Your user space program will not know where 'getrandom' is defined >>> unless it's in the C library. You need to research more on how to call >>> custom system calls. >>> >>> -Anoop >>> -- Regards, Avantika Rawat ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >>> >>> ___ >>> Kernelnewbies mailing list >>> Kernelnewbies@kernelnewbies.org >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> - >> Sayutin Dmitry > > > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: oh yeah
On Tue, Jun 21, 2016 at 3:05 PM, ty armourwrote: > if you all want to you can build computers microchip by microchip, just > post tutorials on it if you do! > > these are fun things to think about. IM like a few years out but im sure > ill get it done > > I would recommend this http://kernelnewbies.org/mailinglistguidelines > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > -- Thank you Warm Regards Anuz ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
oh yeah
if you all want to you can build computers microchip by microchip, just post tutorials on it if you do! these are fun things to think about. IM like a few years out but im sure ill get it done ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
cool
yeah ill take a read through them. I am working on building my own computers and cnc machines either analog or microchip by microchip and im sure these will help me. ill figure it out but yeah also look for analog computers in a few years. thanks ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Regarding getrandom syscall
Hi, Thanks for the suggestion but i am getting following error error: 'SYS_getrandom' undeclared (first use in this function) then i have replaced the SYS_getrandom by 275 in syscall(275, -- args--); as 275 is the __NR_getrandom defines in unistd.h file, but it is returning -1. Can somebody tell me what i am missing here?? . Also in /proc/kallsyms it is showing two syscalls added for getrandom 80417a38 T SyS_getrandom 80417a38 T sys_getrandom On Sat, Jun 18, 2016 at 7:12 PM, Sayutin Dmitrywrote: > Well, in fact it is not hard. > > Just use syscall(2) provided by libc. > > You need to provide to this function syscall id and syscall args. > Syscall id can be retrieved from macro constant > Should look something like: > > #define _GNU_SOURCE > #include > #include > > syscall(SYS_getrandom, -- your - args - here --); > > It returns long value - the result of syscall. > If it is between [-4095; -1] then it is negated errno, otherways it is return > value. > > > 18.06.2016, 16:32, "Anoop" : >> Hi Avantika, >> >> On Sat, Jun 18, 2016 at 5:32 PM, Avantika Rawat >> wrote: >>> Hi ALL, >>> >>> I am trying to use getrandom syscall in kernel 3.10.20 by following this >>> link >>> >>> >>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895 >>> >>> i have compiled the kernel and now want to call the getrandom syscall from >>> userspace to generate random numbers. But i am getting following error >>> while >>> calling the getrandom () from userspace. >>> >>> (.text.startup+0x18): undefined reference to `getrandom' >>> (.text.startup+0x1c): undefined reference to `getrandom' >> >> Your user space program will not know where 'getrandom' is defined >> unless it's in the C library. You need to research more on how to call >> custom system calls. >> >> -Anoop >> >>> -- >>> Regards, >>> Avantika Rawat >>> >>> ___ >>> Kernelnewbies mailing list >>> Kernelnewbies@kernelnewbies.org >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > - > Sayutin Dmitry -- Regards, Avantika Rawat ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: boot param to change tick
Hi, >You have to rebuild the kernel to change the HZ value. +1 Rami Rosen ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: What is the point of this function?
So, it's just an override? Why return true and not false? Il 21 giu 2016 4:32 AM, "Nathan Williams"ha scritto: > On Tue, 2016-06-21 at 00:48 +0200, Andrea Benelli wrote: > > Hello, i was looking at the linux/sched.h (kernel version 4.6.2) > > source code and i found this function at line 1174: > > > > static inline bool cpus_share_cache(int this_cpu, int that_cpu) > > { > > return true; > > } > > > > I'm not able to understand the utility of a function that just return > > a true value. > > i've noticed that there are a lot of functions like this (function > > that just return a constant). > > Hi Andrea, > > That's the case for when CONFIG_SMP isn't defined. What happens when > CONFIG_SMP is defined? > > I suggest having a look through the code with a Linux cross reference: > > http://lxr.free-electrons.com/ident?v=4.6;i=cpus_share_cache > > Regards, > Nathan > > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for tutorials
On Mon, Jun 13, 2016 at 5:43 PM, ty armourwrote: > I need tutorials on kernel development. And on complete operating system > development. I would prefer them to be in assembly because it is faster, but > it seriously needs to get done. > > If you are interested, simply post all of the tutorials and other relevant > information to coding kernels that you can > > and show the references, like actually say okay so in order to do this we > need to look for this in the assembler manual. > > Thanks and have fun You can start by reading the code for lguest: http://lxr.free-electrons.com/source/drivers/lguest It has very good documentation and it covers a lot of OS fundamental blocks. Daniel. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for tutorials
On Mon, Jun 13, 2016 at 3:43 PM, ty armourwrote: > I need tutorials on kernel development. And on complete operating system > development. I would prefer them to be in assembly because it is faster, > but it seriously needs to get done. > > If you are interested, simply post all of the tutorials and other relevant > information to coding kernels that you can > > and show the references, like actually say okay so in order to do this we > need to look for this in the assembler manual. > > Thanks and have fun > > If you look at the Archives I posted a lot of links in a mail few weeks ago. > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > -- Thank you Warm Regards Anuz ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for tutorials
On Mon, 13 Jun 2016, ty armour wrote: > I need tutorials on kernel development. And on complete operating > system development. I would prefer them to be in assembly because it > is faster, but it seriously needs to get done. > > If you are interested, simply post all of the tutorials and other > relevant information to coding kernels that you can > > and show the references, like actually say okay so in order to do > this we need to look for this in the assembler manual. perhaps you'd like a hot oil massage and a nice chablis while you wait. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: IPV6 Multipath support
Hi, Could some one please update as this is very urgent for me. I am not able to proceed further. Thanks On Mon, Jun 20, 2016 at 5:33 PM, Narasimha Mwrote: > Hi All, > > I am using linux kernel 3.10.20, and tried to add multipath routes > using the below commands. > > ip -6 route add default nexthop via ::1 dev eth1 weight 1 nexthop > via ::2 dev eth0 weight 1. > > But when i run the traffic to the host reachable to both the > interfaces, traffic is always going through eth1, which means the > multipath routing is not working. > > Could you please let us know that do we have multipath support for > ipv6 in linux3.10.20 kernel ? > > Thanks in advance. -- Narasimha ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies