flat assembler
Message board for the users of flat assembler.
Index
> Linux > linux 2.6+ system calls reference Goto page 1, 2, 3, 4 Next |
Author |
|
arafel 03 Oct 2006, 05:16
Hi,
I want to introduce a small project which came to life a couple of month ago. You may get it from here (grab the latest release): http://sourceforge.net/project/showfiles.php?group_id=173983 It's a reference for Linux 2.6+ system calls. Which provides a description of (almost)all system calls found in kernel 2.6 and later branches from Assembly point of view Also it includes a set of include files for FASM and GAS with structures and symbol definitions necessary for programming with syscalls. And also there is a number (currently only two..) of examples provided which demonstrate some syscalls usage. The project is currently in an alpha stage. A lot of things has not been verified yet, so please take this into account . Hope someone will find it useful. |
|||
03 Oct 2006, 05:16 |
|
vid 03 Oct 2006, 11:26
i will move it to Linux section and mark it as announcement, okay?
|
|||
03 Oct 2006, 11:26 |
|
arafel 03 Oct 2006, 11:47
vid wrote:
Yeah, haven't added this one yet. Just want to clean/test/verify already existing stuff before adding anything new. Quote:
Hmmm. Don't know about 80h, 200h, and 40h. But 100, 200, 1000 should be correct. They are taken directly from the linux kernel source (2.6.18. however afaik those particular values haven't changed since Linux 1.0 so they should be the same on all kernel versions): #define O_CREAT 00000100 /* not fcntl */ #define O_EXCL 00000200 /* not fcntl */ #define O_TRUNC 00001000 /* not fcntl */ Could you please assemble samples/basic/filecreate.asm and see whether it works on that system? (it uses sys_open with O_CREAT and O_EXCL to create a file.) Quote:
Sure. Thanks. |
|||
03 Oct 2006, 11:47 |
|
vid 03 Oct 2006, 12:07
Code: vid@cray:~$ strace ./filecreate execve("./filecreate", ["./filecreate"], [/* 28 vars */]) = 0 open("newfile.txt", O_RDWR|O_APPEND|O_CREAT|O_TRUNC|O_EXCL|O_NOCTTY|O_ASYNC|0x3c, 01274) = -1 EEXIST (File exists) write(1, "The file already exists and can "..., 47The file already exists and can not be created ) = 47 _exit(0) = ? Process 20269 detached |
|||
03 Oct 2006, 12:07 |
|
arafel 03 Oct 2006, 12:32
ok works like it should. creates file on the first execution. fails on any sequent execution if file newfile.txt is not deleted.
what worries me however is that O_SYNC and permission bits got screwed somehow. i'll check this a bit later.. need to eat something first. |
|||
03 Oct 2006, 12:32 |
|
vid 03 Oct 2006, 12:34
btw, system is "grsecurity applied on vanila kernel" as described by friend. i was playing with it, and i found values of constants to be such as i told you.
|
|||
03 Oct 2006, 12:34 |
|
vid 03 Oct 2006, 12:41
no, it is even without grsec... hm...
|
|||
03 Oct 2006, 12:41 |
|
arafel 03 Oct 2006, 12:43
what was the filename (and location) of the file where you found those constants?
|
|||
03 Oct 2006, 12:43 |
|
vid 03 Oct 2006, 12:51
same output on another machine... try yours. it may even be problem of strace. but i am using values that strace was using in FASMLIB, and it seems to work... hm
|
|||
03 Oct 2006, 12:51 |
|
arafel 03 Oct 2006, 14:39
lol. what a stupid mistake.
I totally forgot that FASM does not handle octal numbers like C does. So it actually sees all the octals (prefixed with "0" in C) as decimals! Will fix this asap. edit: here is a fixed versions of symbols.inc |
|||
03 Oct 2006, 14:39 |
|
vid 03 Oct 2006, 15:16
OH! i was also wondering why there is no "0x"... but i thought radix is defaultly based to 16 somehow.
prefixing octal numbers with "0" is the most stupid thing i ever saw... thanks for clearing this up for me |
|||
03 Oct 2006, 15:16 |
|
vid 03 Oct 2006, 15:17
and don't forget to check ALL constants whether they weren't octal.
|
|||
03 Oct 2006, 15:17 |
|
arafel 03 Oct 2006, 15:25
already fixed see the attachment in the previous post.
|
|||
03 Oct 2006, 15:25 |
|
a16b03 07 Oct 2006, 20:26
|
|||
07 Oct 2006, 20:26 |
|
arafel 07 Oct 2006, 22:28
thanks a16b03
|
|||
07 Oct 2006, 22:28 |
|
arafel 08 Oct 2006, 01:15
New release has been uploaded to the sourcforge..
It fixes some critical bugs in include files. + some fixes in the reference. |
|||
08 Oct 2006, 01:15 |
|
arafel 13 Oct 2006, 17:35
After a lot of thinking I have decided to take this project into a completely, well,.. maybe not completely, but nevertheless different direction.
LSCR from now on will incorporate more than just a reference and a few examples. Namely, there will be set of miscellaneous helper utilities, much more extended set of include files and sample applications covering not only the system calls usage but a more broad range of programming aspects. Currently documentation of the first 127 system calls has been reviewed and tested. A bunch of new samples has been added: IPC, sockets, kernel modules, gui (one xlib and one xaw example). And I finally settled with the package layout, so there won't be any major changes in the directory structure anymore. As for development cycle, highest priority for now stands on: - completing review of the remaining 200+ system calls. - finishing include files (especially xlib). - and continuing to add new examples and utilities. and plans for a near future: - create include files for GTK+ and Qt. - make 64bit version. (most likely will go into separate package. not sure yet.) - create some kind of automated solution for porting FASM examples/includes onto other assemblers (GAS, maybe NASM). - ... |
|||
13 Oct 2006, 17:35 |
|
a16b03 13 Oct 2006, 18:44
I know You're very busy, but, if possible it would bee GREAT if you could add info (at least basic info) how to program some basic devices under linux...
This info is very hard to find, and it would be usefull for new programmers and maby someone else.[/b] |
|||
13 Oct 2006, 18:44 |
|
orbital_fox 17 Oct 2006, 10:16
i would recomment that u create a web accessible version tooo..
SF provides web space |
|||
17 Oct 2006, 10:16 |
|
Goto page 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.