HLA Linux syscalls and related stuff

From: T.M. Sommers (tms2_at_mail.ptd.net)
Date: 10/17/03


Date: Fri, 17 Oct 2003 07:09:57 GMT

I'm not 100% certain about how Linux handles the return codes from
syscalls, and what the HLA syscall wrappers do with those codes.

It looks like the syscalls' return value is in %eax, and that in the
case of an error, the return value is the negative of the C error
code, and that the HLA wrappers leave this value alone. Is that correct?

I thought I had seen a global errno variable, as in C, but now I don't
find it. Is it correct that there is none?

Outside of the linux directory, I found about 90 instances that test
for os.linux in the library. For a FreeBSD version, I can see two
ways to deal with them:

1) Duplicate the code; or
2) Try to unify the Linux and FreeBSD code somehow (I'm thinking of
something analogous to the method FreeBSD uses to implement its Linux
compatibility mode. The kernel's structure for each proc has a
pointer to a table of pointers to the kernel functions that implement
the syscalls. Native procs point to a FreeBSD table, Linux procs
point to a Linux table.)

The latter would be more work initially, but should make porting to
other Unices easier. However, I'm not sure that it could be done
without some runtime penalties, especially for calling the syscall
functions. Do you think it would be worthwhile to try this approach?

A final question: do HLA procedures pass their arguments on the stack?



Relevant Pages

  • Re: mysql scaling questions
    ... Does anyone have a theory why syscalls are so expensive in FreeBSD? ... larger L2 cache is likely to be especially helpful in benchmarks. ... Linux wins this benchmark by a lot mainly because too much weight is given ...
    (freebsd-performance)
  • Re: FreeBSD Assembly
    ... Under Windows and Linux, the code reads a 19K file in a ... the HLA code takes 5 seconds. ... I had the same problem, and from what I can gather, libc (on FreeBSD) ... character at a time was also on the SAMBA drive. ...
    (comp.lang.asm.x86)
  • Re: mysql scaling questions
    ... are the results of unixbench 4.1 on two machines. ... Per the comments in this thread, i386 syscalls should be less ... FreeBSD 7.0-RC1: System Call Overhead ... Knoppix Linux 2.6.9: System Call Overhead ...
    (freebsd-performance)
  • Re: HLA Linux syscalls and related stuff
    ... > syscalls, and what the HLA syscall wrappers do with those codes. ... > Outside of the linux directory, I found about 90 instances that test ...
    (alt.lang.asm)
  • Re: HLA Linux syscalls and related stuff
    ... >>I'm not 100% certain about how Linux handles the return codes from ... >>syscalls, and what the HLA syscall wrappers do with those codes. ... For a FreeBSD version, I can see two ...
    (alt.lang.asm)