public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][3/11][MANUX] Kernel compatibility : syscall numbers
@ 2014-04-15 13:42 Emmanuel Colbus
  2014-04-15 15:02 ` One Thousand Gnomes
  2014-04-16  7:03 ` Clemens Ladisch
  0 siblings, 2 replies; 5+ messages in thread
From: Emmanuel Colbus @ 2014-04-15 13:42 UTC (permalink / raw)
  To: linux-kernel

Continuing the discussion regarding syscalls, I have a question
regarding vector 0x80.

As I mentionned earlier, my OS's internals are very different from
Linux's, thus I have had a need for a few new syscalls. Since I wanted
to avoid any collision with Linux, but I also wanted to keep the
ability to put the syscall table in a single 4096-byte page on 64-bit
computers (on which I hope to run one day), I chose to start taking
syscall number 511, and to progress downwards - currently, I'm using
numbers 511 through 501 included (with a hole at 503, but I'll likely
fill it again in the future).

Is this okay for you? And in this case, if this isn't asking too much,
could you avoid using them for now, to avoid any conflict?

Thank you!

Emmanuel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][3/11][MANUX] Kernel compatibility : syscall numbers
  2014-04-15 13:42 [RFC][3/11][MANUX] Kernel compatibility : syscall numbers Emmanuel Colbus
@ 2014-04-15 15:02 ` One Thousand Gnomes
  2014-04-15 15:10   ` Emmanuel Colbus
  2014-04-16  7:03 ` Clemens Ladisch
  1 sibling, 1 reply; 5+ messages in thread
From: One Thousand Gnomes @ 2014-04-15 15:02 UTC (permalink / raw)
  To: Emmanuel Colbus; +Cc: linux-kernel

On Tue, 15 Apr 2014 15:42:51 +0200
Emmanuel Colbus <ecolbus@manux.info> wrote:

> Continuing the discussion regarding syscalls, I have a question
> regarding vector 0x80.
> 
> As I mentionned earlier, my OS's internals are very different from
> Linux's, thus I have had a need for a few new syscalls. Since I wanted
> to avoid any collision with Linux, but I also wanted to keep the
> ability to put the syscall table in a single 4096-byte page on 64-bit
> computers (on which I hope to run one day), I chose to start taking
> syscall number 511, and to progress downwards - currently, I'm using
> numbers 511 through 501 included (with a hole at 503, but I'll likely
> fill it again in the future).
> 
> Is this okay for you? And in this case, if this isn't asking too much,
> could you avoid using them for now, to avoid any conflict?

I don't see why the question arises. Your non Linux ABI binaries will be
the ones to use such calls. They can have a different ELF header to Linux
binaries. Linux then won't even try and run them by mistake. At that
point your worst case is Linux calls eventually collide with your own and
you have two tables according to ABI.

Alan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][3/11][MANUX] Kernel compatibility : syscall numbers
  2014-04-15 15:02 ` One Thousand Gnomes
@ 2014-04-15 15:10   ` Emmanuel Colbus
  0 siblings, 0 replies; 5+ messages in thread
From: Emmanuel Colbus @ 2014-04-15 15:10 UTC (permalink / raw)
  To: One Thousand Gnomes; +Cc: linux-kernel

Le 15/04/2014 17:02, One Thousand Gnomes a écrit :
> On Tue, 15 Apr 2014 15:42:51 +0200
> Emmanuel Colbus <ecolbus@manux.info> wrote:
> 
>> Continuing the discussion regarding syscalls, I have a question
>> regarding vector 0x80.
>>
>> As I mentionned earlier, my OS's internals are very different from
>> Linux's, thus I have had a need for a few new syscalls. Since I wanted
>> to avoid any collision with Linux, but I also wanted to keep the
>> ability to put the syscall table in a single 4096-byte page on 64-bit
>> computers (on which I hope to run one day), I chose to start taking
>> syscall number 511, and to progress downwards - currently, I'm using
>> numbers 511 through 501 included (with a hole at 503, but I'll likely
>> fill it again in the future).
>>
>> Is this okay for you? And in this case, if this isn't asking too much,
>> could you avoid using them for now, to avoid any conflict?
> 
> I don't see why the question arises. Your non Linux ABI binaries will be
> the ones to use such calls. They can have a different ELF header to Linux
> binaries. Linux then won't even try and run them by mistake. At that
> point your worst case is Linux calls eventually collide with your own and
> you have two tables according to ABI.

Hmmm... I see your point... Currently, I simply use the Linux ELF
header, and I hadn't even thought about using a different one. Indeed,
using a different header seems like a good solution.

OK, unless a better idea arises, I think I'll use this solution.

Thanks!

Emmanuel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][3/11][MANUX] Kernel compatibility : syscall numbers
  2014-04-15 13:42 [RFC][3/11][MANUX] Kernel compatibility : syscall numbers Emmanuel Colbus
  2014-04-15 15:02 ` One Thousand Gnomes
@ 2014-04-16  7:03 ` Clemens Ladisch
  2014-04-16 10:23   ` Emmanuel Colbus
  1 sibling, 1 reply; 5+ messages in thread
From: Clemens Ladisch @ 2014-04-16  7:03 UTC (permalink / raw)
  To: Emmanuel Colbus, linux-kernel

Emmanuel Colbus wrote:
> I have a question regarding vector 0x80.
>
> As I mentionned earlier, my OS's internals are very different from
> Linux's, thus I have had a need for a few new syscalls. Since I wanted
> to avoid any collision with Linux

... you could just use another vector, such as 0x81.

> but I also wanted to keep the ability to put the syscall table in
> a single 4096-byte page on 64-bit computers (on which I hope to run
> one day), I chose to start taking syscall number 511, and to progress
> downwards - currently, I'm using numbers 511 through 501 included

These implementation details do not need to show up in the interface:

int syscall_0x81(int nr, ...)
{
    if (nr in range)
        return table[511 - nr](...);
}


Regards,
Clemens

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][3/11][MANUX] Kernel compatibility : syscall numbers
  2014-04-16  7:03 ` Clemens Ladisch
@ 2014-04-16 10:23   ` Emmanuel Colbus
  0 siblings, 0 replies; 5+ messages in thread
From: Emmanuel Colbus @ 2014-04-16 10:23 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: linux-kernel

Le 16/04/2014 09:03, Clemens Ladisch a écrit :
> Emmanuel Colbus wrote:
>> I have a question regarding vector 0x80.
>>
>> As I mentionned earlier, my OS's internals are very different from
>> Linux's, thus I have had a need for a few new syscalls. Since I wanted
>> to avoid any collision with Linux
> 
> ... you could just use another vector, such as 0x81.
> 
>> but I also wanted to keep the ability to put the syscall table in
>> a single 4096-byte page on 64-bit computers (on which I hope to run
>> one day), I chose to start taking syscall number 511, and to progress
>> downwards - currently, I'm using numbers 511 through 501 included
> 
> These implementation details do not need to show up in the interface:
> 
> int syscall_0x81(int nr, ...)
> {
>     if (nr in range)
>         return table[511 - nr](...);
> }
> 
> 
> Regards,
> Clemens
> 

This would stop working as soon as I implemented any syscall/sysret or
sysenter/sysexit-like thing, as this technique has no notion of a
syscall vector.

Regards,

Emmanuel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-16 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 13:42 [RFC][3/11][MANUX] Kernel compatibility : syscall numbers Emmanuel Colbus
2014-04-15 15:02 ` One Thousand Gnomes
2014-04-15 15:10   ` Emmanuel Colbus
2014-04-16  7:03 ` Clemens Ladisch
2014-04-16 10:23   ` Emmanuel Colbus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox