Calling syscalls from the kernel
Calling syscalls from the kernel
Posted Jul 11, 2014 11:33 UTC (Fri) by roblucid (guest, #48964)In reply to: Calling syscalls from the kernel by bourbaki
Parent article: Anatomy of a system call, part 1
More simply, a system call is designed for user space interaction, in general something in kernel, ought to be using an in-kernel service, rather than re-purposing a user space interface.
[ As noone answered this question yet ]
Posted Jul 14, 2014 9:33 UTC (Mon)
by drysdale (guest, #95971)
[Link] (2 responses)
Posted Jul 23, 2014 14:32 UTC (Wed)
by YogeshC (guest, #49966)
[Link] (1 responses)
Posted Aug 11, 2014 12:45 UTC (Mon)
by rwmj (subscriber, #5474)
[Link]
The main user of sys_read at the moment is the code for unpacking the initramfs. You could imagine this "should" be done by a userspace process, because it's doing a lot of userspace-type stuff, like uncompressing a cpio file and then creating a tree of directories and files from it. It's nearly the equivalent of running:
So it's a layering violation, but for understandable reasons.
Calling syscalls from the kernel
Calling syscalls from the kernel
No one answered your question so I'll have a go.
Calling syscalls from the kernel
zcat initramfs | cpio -id
However because the initramfs is needed before userspace is up -- because creating the initramfs is creating the initial userspace -- they have to do this userspace-type stuff in the kernel instead.