flat assembler
Message board for the users of flat assembler.

Index > Linux > Various Linux Questions...

Author
Thread Post new topic Reply to topic
unknown



Joined: 08 Feb 2007
Posts: 5
unknown
1) How do I allocate and deallocate memory?

2) How do I access, (create, destroy, read, and write) files?

3) In Windows, the API procedures LoadLibrary, FreeLibrary, and GetProcAddress allows programms to dynamically access DLL procedures. Can the same be done in Linux? If so, how?
Post 18 Feb 2007, 13:43
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
on linux, you should be calling libc, not linux kernel.

if you want to call kernel, you need
1) for usual alloc()/free() you need some heap manager
2) http://lscr.sf.net
Post 18 Feb 2007, 17:53
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
What, no link to the flatasslib thread?! Laughing
Post 18 Feb 2007, 20:26
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
rugxulo: hey, that's a good name!!! I would have to consider it!
Post 18 Feb 2007, 20:51
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
andreism



Joined: 10 Feb 2007
Posts: 9
Location: Russia, Moscow
andreism
About dynamical allocation of memory:

http://asm.sourceforge.net/howto/faq.html#AEN1004

ThereĀ“s also a small library function implementing memory allocating functions in asmutils package, see lib/heap.asm for further details:

http://asm.sourceforge.net/asmutils/asmutils-0.18.tar.gz

For functions such as read, write etc, it's implemented through system calls. Their list (not much up-to-date but very detailed) is to be found here:

http://www.lxhp.in-berlin.de/lhpsyscal.html

How to use Linux system calls you will read in any tutorial on linuxassembly.org.
Post 25 Feb 2007, 20:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.