My assembly prints out hello world, from the linux assembly how to,
reproduced here
If i replace int 0x80 with my int 0x40 I end up with a segmentation fault.
Is there any thing other than set_system_gate and writing the my_system_call
handler, that i need to do to have a successful int 0x40? I had tried
a) commenting out just the deference of the system handler function
within system_call (call *sys_call_table(0, %eax, 4) )
b) using &system_call itself in set_system_gate
but still the same situation.
Any suggestions will be appreciated.
Thanks
Raman
.data # section declaration
msg:
.string "Hello, world!\n" # our dear string
len = . - msg # length of our dear string
.text # section declaration
# we must export the entry point to the ELF linker or
.global _start # loader. They conventionally recognize _start as their
# entry point. Use ld -e foo to override the default.
_start:
# write our string to stdout
movl $len,%edx # third argument: message length
movl $msg,%ecx # second argument: pointer to message to write
movl $1,%ebx # first argument: file handle (stdout)
movl $4,%eax # system call number (sys_write)
int $0x80 # call kernel
# and exit
movl $0,%ebx # first argument: exit code
movl $1,%eax # system call number (sys_exit)
int $0x80 # call kernel
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/