system-calls

how sys_open works?

孤街醉人 提交于 2020-05-08 17:55:19
问题 I have write a simple char device driver (mydev) with "open" file operation in it. In user space application I open this driver node. using open("/dev/mydev", O_RDONLY); The open() system call internally calls the sys_open(). I just want to know the follow of how sys_open() function call my driver's open file operation. How VFS handles this, which function it internally calls. 回答1: I found the answer in Understanding Linux Kernel book, at section 12.5.1 Steps are, Invokes getname( ) to read

how sys_open works?

允我心安 提交于 2020-05-08 17:49:59
问题 I have write a simple char device driver (mydev) with "open" file operation in it. In user space application I open this driver node. using open("/dev/mydev", O_RDONLY); The open() system call internally calls the sys_open(). I just want to know the follow of how sys_open() function call my driver's open file operation. How VFS handles this, which function it internally calls. 回答1: I found the answer in Understanding Linux Kernel book, at section 12.5.1 Steps are, Invokes getname( ) to read

how sys_open works?

偶尔善良 提交于 2020-05-08 17:49:06
问题 I have write a simple char device driver (mydev) with "open" file operation in it. In user space application I open this driver node. using open("/dev/mydev", O_RDONLY); The open() system call internally calls the sys_open(). I just want to know the follow of how sys_open() function call my driver's open file operation. How VFS handles this, which function it internally calls. 回答1: I found the answer in Understanding Linux Kernel book, at section 12.5.1 Steps are, Invokes getname( ) to read

Would it makes the kernel level thread clearly preferable to user level thread if system calls is as fast as procedure calls?

不打扰是莪最后的温柔 提交于 2020-04-18 03:51:32
问题 Some web searching results told me that the only deficiency of kernel-level thread is the slow speed of its management(create, switch, terminate, etc.). It seems that if the operation on the kernel-level thread is all through system calls, the answer to my question will be true . However, I've searched a lot to find whether the management of kernel-level thread is all through system call but find nothing. And I always have an instinct that such management should be done by the OS

Would it makes the kernel level thread clearly preferable to user level thread if system calls is as fast as procedure calls?

社会主义新天地 提交于 2020-04-18 03:51:06
问题 Some web searching results told me that the only deficiency of kernel-level thread is the slow speed of its management(create, switch, terminate, etc.). It seems that if the operation on the kernel-level thread is all through system calls, the answer to my question will be true . However, I've searched a lot to find whether the management of kernel-level thread is all through system call but find nothing. And I always have an instinct that such management should be done by the OS

linux x86_64 nasm assembly syscalls

萝らか妹 提交于 2020-04-07 06:29:53
问题 I have found charts online showing various syscalls for x86_64 linux nasm assembly and there appears to be 380ish total syscalls, however every book or tutorial I can find only "how a few of the syscalls work and what they do?" Does anyone know where I can find information on every single syscall for x86_64 linux assembly using the nasm assembler? Any help would be great. 回答1: Look at the Linux man pages (section 2). http://man7.org/linux/man-pages/dir_section_2.html It doesn't matter what

Brute force attack test on password for file

你离开我真会死。 提交于 2020-03-05 11:46:06
问题 I'm trying to create a brute force that will work on a specific files password. I'm not sure how to get this code to work. This is what I have so far. This code produces the correct possible combinations for the password but I am not sure how to implement this into a brute force attack. my @alpha = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z); my $password = @alpha[1]; my @combo = (); for my $one(@alpha){ for my $two(@alpha){ for my $three(@alpha){ for my $four(@alpha){ push @combo

Brute force attack test on password for file

浪子不回头ぞ 提交于 2020-03-05 11:46:05
问题 I'm trying to create a brute force that will work on a specific files password. I'm not sure how to get this code to work. This is what I have so far. This code produces the correct possible combinations for the password but I am not sure how to implement this into a brute force attack. my @alpha = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z); my $password = @alpha[1]; my @combo = (); for my $one(@alpha){ for my $two(@alpha){ for my $three(@alpha){ for my $four(@alpha){ push @combo

Force read system call to block

穿精又带淫゛_ 提交于 2020-03-05 07:20:33
问题 I have a program that reads from and writes to serial port. I have a reader thread that reads data and supplies informations to shared memory. The reader thread should sleep until data is available. So I want to make read() system call to block calling thread. Considering man pages, unless you supply O_NONBLOCK to open , read should always block. But I have an active thread which in it read returns -1 continuously. ALso changing VTIME and VMIN does not make a difference. This is how port is

Preventing processes to execute certain system calls

蹲街弑〆低调 提交于 2020-02-26 07:31:54
问题 I'm writing a program that spawns child processes. For security reasons, I want to limit what these processes can do. I know of security measures from outside the program such as chroot or ulimit , but I want to do something more than that. I want to limit the system calls done by the child process (for example preventing calls to open() , fork() and such things). Is there any way to do that? Optimally, the blocked system calls should return with an error but if that's not possible, then