All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Barrio <coder@fluzo.org>
To: sparclinux@vger.kernel.org
Subject: Why/when use 0x10 and 0x90 for system calls?
Date: Sun, 09 Dec 2007 18:55:10 +0000	[thread overview]
Message-ID: <1d1b2964cccd05bccee60c12f0abf191@localhost> (raw)


Hi,

I was doing a little research for myself about system calls on Linux sparc64
and, acording to /usr/include/asm-sparc/traps.h, to execute a system call what
I need to do is to generate a software trap: ta 0x90. Then I coded a little .s
file to test that, and worked:

.global _start

_start:

mov 1, %o0
set string, %o1
mov 0x11, %o2
mov 4, %g1
ta 0x90
mov 0, %o0
mov 1, %g1
ta 0x90

string:
.asciz  "write() invoked!\n"

I did compiled it with as and linked with ld, then executed it:

$ as write.s -o write.o && ld write.o -owrite && ./write
write() invoked!
$

Then I straced it to actually see it working, and something weird happened:

$ strace ./write
execve("./write", ["./write"], [/* 35 vars */]) = 0
syscall: unknown syscall trap 91d02090 000100a8
$

I looked everywhere inside /usr/include and also somewhere inside the linux
kernel 2.6.21 source, focusing on entry.S, where I found nothing.

After hours of frustration I did find on Google people using 'ta 0x10' instead
of 'ta 0x90'. I tested it, worked fine and also I was able to strace it, but I
found that '0x10' nowhere. I don't know where it is defined, hardcoded, or
whatever. None of my two books about Sparc speak about that.

Would anyone here be so kind to explain me that behaviour and when or why use
0x90 or 0x10? Maybe 'ta 0x10' is faster than 'ta 0x90'

Thanks in advance.

--
echo "dpefsAgmv{p/psh" | perl -pe 's/(.)/chr(ord($1)-1)/ge'
GnuPG key ID 0x6D2FF8B5 @ pgp.rediris.es
http://www.fluzo.org/


             reply	other threads:[~2007-12-09 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-09 18:55 Javier Barrio [this message]
2007-12-11 10:08 ` Why/when use 0x10 and 0x90 for system calls? Javier Barrio
2007-12-11 15:47 ` Javier Barrio
2007-12-12 23:30 ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d1b2964cccd05bccee60c12f0abf191@localhost \
    --to=coder@fluzo.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.