flat assembler
Message board for the users of flat assembler.
Index
> Unix > asm4BSD - FreeBSD,OpenBSD,NetBSD,DragonflyBSD fasm headers |
Author |
|
killasmurf86 29 Sep 2010, 15:24
FreeBSD, OpenBSD, NetBSD, DragonflyBSD syscalls for fasm and nasm
https://github.com/graudeejs/asm4BSD I will add data structures as I progress. Also Maybe I will write some perl script that will convert c headers for asm. There are also FreeBSD native Hello World in fasm Last edited by killasmurf86 on 29 Sep 2011, 17:21; edited 10 times in total |
|||
29 Sep 2010, 15:24 |
|
vid 29 Sep 2010, 21:49
have you seen LSCR? What are differences?
|
|||
29 Sep 2010, 21:49 |
|
killasmurf86 29 Sep 2010, 22:26
Yup i've seen it, In fact I have it on my HDD
some (probably many) syscall numbers differ (argument count might differ as well for some syscalls) but the biggest difference is how arguments are passed to kernel Linux pass arguments with registers and fallback to stack, if it runs out of free regs FreeBSD push all args to stack except syscall number (which is stored in eax as well) after that it can call function that will call int 80h Or you can simply push some dummy arg (I prefer push eax, because it's smaller than push 0x0) then call int 0x80. After you called int 0x80 you need to clear stack (for example with lea esp, 4*(arg_count)) Also some data structures might be different After all FreeBSD != Linux for info how to code asm in FreeBSD http://int80h.org/ Also this month there was article in BSDmag [Free journal] about asm in Linux and FreeBSD http://bsdmag.org/magazine/1502-bsd-and-linux Last edited by killasmurf86 on 23 Feb 2011, 06:54; edited 4 times in total |
|||
29 Sep 2010, 22:26 |
|
revolution 29 Sep 2010, 22:45
killasmurf86 wrote: (included file: http://aldis.git.bsdroot.lv/asmFreeBSD/tree/FreeBSD.fasm) |
|||
29 Sep 2010, 22:45 |
|
vid 29 Sep 2010, 22:56
stickied
|
|||
29 Sep 2010, 22:56 |
|
killasmurf86 30 Sep 2010, 05:58
Forgot to mention that in FreeBSD you pass sysargs from right to left
revolution wrote:
ye, I was wondering about that.... Thanks for hint Last edited by killasmurf86 on 23 Feb 2011, 06:54; edited 2 times in total |
|||
30 Sep 2010, 05:58 |
|
killasmurf86 30 Sep 2010, 10:54
Added awk script to convert C/C++ headers to asm
You still will have to edit resulted file manually (edit structures, remove some bloat and remove C macro definitions [Don't know why they are still there, I tried to remove them]) However I think this can be HUGE time-saver Any thoughts appreciated. Also I'd be glad if someone could test if it works on Linux (FreeBSD and Linux Use different awk implementation) http://aldis.git.bsdroot.lv/asm4FreeBSD/tree/scripts/h2fasm.awk Code: $ awk -f h2fasm.awk /usr/include/limits.h > limits.fasm EDIT: Just wrote nice script to convert /usr/src/sys/kern/syscalls.master to fasm readable format: http://aldis.git.bsdroot.lv/asm4FreeBSD/tree/scripts/FreeBSD_syscalls4fasm.pl |
|||
30 Sep 2010, 10:54 |
|
killasmurf86 12 Oct 2010, 22:44
Added support OpenBSD and NetBSD
renamed project to asm4BSD http://git.bsdroot.lv/aldis/asm4BSD.git/ Renamed this thread EDIT: Added DragonflyBSD Last edited by killasmurf86 on 09 Nov 2010, 06:28; edited 1 time in total |
|||
12 Oct 2010, 22:44 |
|
killasmurf86 09 Nov 2010, 06:28
Figured out how to get rid of subdomain....
Changed url: http://git.bsdroot.lv/aldis/asm4BSD.git/ also hg repo is available (I will probably later switch to hg completely) http://hg.bsdroot.lv/pub/aldis/asm4BSD/ |
|||
09 Nov 2010, 06:28 |
|
killasmurf86 29 Sep 2011, 17:23
I will shutdown my server permanently.
My repositories are moved to github under graudeejs nick asm4BSD: https://github.com/graudeejs/asm4BSD |
|||
29 Sep 2011, 17:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.