i was able to get it to work ....  but sadly it's on nasm .. at first
i've tried using nasm, yasm, gas and it all came to that one
conclusion "Operation not Permitted" but i was able to get this
workaround code to label the file OpenBSD so that OpenBSD will run it
.. i dunno how this is exactly done .. (I'm still thinkering) but I'll
get there :) here's what i founded out

you can check the difference when you do a : 

$ file hell
hell: ELF 32-bit LSB executable, Intel 80386, version 1, for OpenBSD,
statically linked, stripped
$ file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1, statically
linked, stripped

the first file "hell" has the id code (see below) 

====================================================
section .note.openbsd.ident align=2
    dd 8
    dd 4
    dd 1
    db 'OpenBSD',0
    dd 0
====================================================

to brand the file as OpenBSD 

the 2nd one is the gas asm code i was working on .. i did some
checking on a simple C "hello world" code and found out this

$ gcc -o hellO hello.c
$ hellO
hello world
$ file hellO
hellO: ELF 32-bit LSB executable, Intel 80386, version 1, for OpenBSD,
dynamically linked (uses shared libs), not stripped

it seems that with assembly your always on your own =)



that solves it .. atleast for the mean time i can play around with
nasm .. and think of a way to make it work for gas

thanks for all the comments, support, etcetera :)

dee

On 7/2/05, Ted Hanna <[EMAIL PROTECTED]> wrote:
> mount info; no "noexec" option on my /etc/fstab too
> 
> $ mount
> /dev/wd0a on / type ffs (local)
> /dev/wd0d on /home type ffs (local, nodev, nosuid)
> /dev/wd0e on /tmp type ffs (local, nodev, nosuid)
> /dev/wd0g on /usr type ffs (local, nodev)
> /dev/wd0f on /var type ffs (local, nodev, nosuid)
> 
> 
> The code I'm trying to build using gas
> 
> $ cat hello.S
> .data
> 
> msg:
>          .ascii  "my OpenBSD is on GAS!\n"
>          len =3D . - msg
> 
>  .text
> 
>          .global _start
> 
>  _start:
> 
>          movl    $len,%edx
>          movl    $msg,%ecx
>          movl    $1,%ebx
>          movl    $4,%eax
>          int     $0x80
> 
>          movl    $0,%ebx
>          movl    $1,%eax
>          int     $0x80
> 
> here's how i build it
> 
> $as -o hello.o hello.S
> $ld -s -o hello hello.o
> $hello
> sh: hello: Operation not permitted
> 
> it doesn't want to run at all =/ anyways... any help, comments will be
> very much appreciated
> 
> 
> 
> dee

Reply via email to