> >From what I understand, the following should print "Hello, world." on
> stdout. I stole the code from the Linux HOWTO, but I think it should
> work on FreeBSD as well. Instead, the call to write returns 9 (EBADF).

I disassembled FreeBSD programs (create a small C prog, compile, and use
objdump), and it looks more like this: (I haven't tested this yet, but it is definitely
stack based, not register based, the part which I haven't tested is if the placing
the int $0x80 behind a call is required)

pusl $len
pushl $Msg
pushl $1
mov $4,%eax
call _basicsyscall
addl $12,%esp
.
.
.



_basicsyscall:  int $0x80       
                                ret


> As a related question, can anyone point me to the source for the int
> 0x80 handler? I've looked all over but can't find it.

On the libc side?       

It is very fragmented in several files using a lot of macro
code. If you wish I can look up the names for you (I did this some weeks ago)

I never searched for the kernel side. (the actual 0x80 handler)
Marco van de Voort ([EMAIL PROTECTED])
<http://www.stack.nl/~marcov/xtdlib.htm>



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to