Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging linux kernel system call number
    primarykey
    data
    text
    <p>I wanted to build my own custom kernel with a different syscall table. (same syscalls but in different position/numbers)</p> <p>I was working on kernel 3.2.29.</p> <p>Changing the kernel was quite easy:</p> <p>1) changing the syscall position in ‫‪arch/x86/kernel/syscall_table_32.S‬‬</p> <p>2) changing the syscall macro number in arch/x86/include/asm/unistd_32.h</p> <p>3) compiling and installing the new kernel</p> <p>I switched the syscalls around: <code>sys_open</code> took the place and number of <code>sys_read</code>, and vice versa.</p> <p>I figured that if I compile <code>glibc</code> with the modified kernel headers, I could have a running system, but unfortunately, it wasn't enough and my system won't boot.</p> <p>Am I missing something? What else do I need to do in order to have a running system?</p> <hr> <p>The steps I have taken are:</p> <p>1) building and installing the kernel as described in my question</p> <p>2) extracting the new kernel headers using <code>make headers_install INSTALL_HDR_PATH=[path]</code></p> <p>3) building glibc with the parameter <code>--with-headers=[path/include]</code></p> <p>4) I used a live cd to access the file system externally in order to install the new <code>glibc</code>, using the <code>make install install_root=[the original file system]</code> (so the system won't break during the install)</p> <p>I hope that the new <code>glibc</code> was built properly, but I am not sure.</p> <p>After that, when booting the system, the boot stops in the (initrafms) shell screen: I guess I need to rebuild the <code>initrd</code>, but how do I compile it according to the new syscall table?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload