flat assembler
Message board for the users of flat assembler.

Index > Linux > .text

Author
Thread Post new topic Reply to topic
maslan



Joined: 08 Sep 2003
Posts: 54
maslan 15 Apr 2004, 14:36
hi guys
i have question here

in linux can i write to the code segment (.text segment) like dos
or only the bss

_________________
Maslan
I'm searching for perfection so, even if u need portability u 've to use Assembly
---
http://www.maslanlab.org
---
http://libosdk.berlios.de
http://maslanedit.sf.net
http://maslancms.sf.net
Post 15 Apr 2004, 14:36
View user's profile Send private message Reply with quote
maslan



Joined: 08 Sep 2003
Posts: 54
maslan 20 Apr 2004, 15:34
Smile
ok no answer !!

all i need to use one segment for code ,data ,bss as i do for dos !!!!!
any answer

_________________
Maslan
I'm searching for perfection so, even if u need portability u 've to use Assembly
---
http://www.maslanlab.org
---
http://libosdk.berlios.de
http://maslanedit.sf.net
http://maslancms.sf.net
Post 20 Apr 2004, 15:34
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 20 Apr 2004, 15:46
I don't know anything about Linux programming (Wink) But why can't you just try? Try to define your section:
Code:
section readable writeable executable    

and see if it works.

Unfortunatelly I can't check it myself as I don't use (and don't have) Linux.
Post 20 Apr 2004, 15:46
View user's profile Send private message Visit poster's website Reply with quote
maslan



Joined: 08 Sep 2003
Posts: 54
maslan 20 Apr 2004, 15:49
Smile
oh why u don't use linux it is the best OS

_________________
Maslan
I'm searching for perfection so, even if u need portability u 've to use Assembly
---
http://www.maslanlab.org
---
http://libosdk.berlios.de
http://maslanedit.sf.net
http://maslancms.sf.net
Post 20 Apr 2004, 15:49
View user's profile Send private message Reply with quote
maslan



Joined: 08 Sep 2003
Posts: 54
maslan 24 Apr 2004, 17:48
hey it doesn't work 100% it gives me segmentation fault

_________________
Maslan
I'm searching for perfection so, even if u need portability u 've to use Assembly
---
http://www.maslanlab.org
---
http://libosdk.berlios.de
http://maslanedit.sf.net
http://maslancms.sf.net
Post 24 Apr 2004, 17:48
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 24 Apr 2004, 18:19
Please post some source to clarify your problem.
Post 24 Apr 2004, 18:19
View user's profile Send private message Visit poster's website Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 01 May 2004, 12:13
To write to the code segment, you need to tell Linux to set the read/write permissions. I use this code at the start of a RetroForth to do this:

Code:
  mov eax, 07dh              ;sys mprotect (pinched from IsForth Smile
      mov ebx, 08048000h
  mov ecx, 00100000h
  mov edx, 7
  int 080h                   ;make the entire program space rwx    


Once this is done, you can write to the code segment freely.
Post 01 May 2004, 12:13
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.