flat assembler
Message board for the users of flat assembler.

Index > Unix > What about a BeOS port?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
NULLPointer



Joined: 28 May 2004
Posts: 11
NULLPointer 28 May 2004, 01:57
How difficult would it be?
Post 28 May 2004, 01:57
View user's profile Send private message MSN Messenger Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 28 May 2004, 08:52
Can't you use the Linux version under BeOS? I'm not too familiar with BeOS myself but I know that somewhere on these boards someone was making BeOS programs using the ELF file generation capabilities of FASM and there was a little problem with it but then Privalov gave a workaround which worked for that person. You can maybe try that.

If the Linux version of the FASM executable itself won't work under BeOS, isn't there some sort of a DOS emulator you can install on it? I know there are DOS emulators for practically all OSes. Then you could use the DOS version of FASM to make BeOS executables using the code workaround.

All ports of FASM can generate code (using the same input files) for all of the supported output formats as far as I'm aware.
Post 28 May 2004, 08:52
View user's profile Send private message Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 28 May 2004, 11:16
No, FASM for Linux will *not* run under BeOS (I've tried!). A workaround solution could be achieved using Bochs, but it's far from a practical way to do program. I'd also like to see a native BeOS port of FASM. It'd be somewhat difficult though, as the BeOS system calls are not well documented, and it's easy to crash BeOS when invoking them outside of the C libraries.
Post 28 May 2004, 11:16
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 28 May 2004, 13:23
Doing a native port for BeOS is not hard at all.

You will need to port very few code, all located in system.inc and in particular: basical file manipulation functions and environment function.

I will do it but I have my time fulfilled for several weeks.
Post 28 May 2004, 13:23
View user's profile Send private message Yahoo Messenger Reply with quote
NULLPointer



Joined: 28 May 2004
Posts: 11
NULLPointer 29 May 2004, 20:34
Gracias, pelaillo, vere qué hago.
Post 29 May 2004, 20:34
View user's profile Send private message MSN Messenger Reply with quote
NULLPointer



Joined: 28 May 2004
Posts: 11
NULLPointer 01 Jun 2004, 17:38
He estado investigando el tema de un port a BeOS pero el problema es que BeOS carece de 2 llamadas al sistema:

1. brk
2. sysinfo

Alguien tiene alguna idea?
Sorry for the post in spanish but i think you can understand me, don't you, Pelaillo?

Thanks.
Gracias.
Post 01 Jun 2004, 17:38
View user's profile Send private message MSN Messenger Reply with quote
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
neonz 01 Jun 2004, 19:44
NULLPointer wrote:
How difficult would it be?


Well, take it and port! Smile
Post 01 Jun 2004, 19:44
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 01 Jun 2004, 23:52
Hi neonz, I think he was doing a real question, not a rant.

NULLPointer, we will need to do some tests before getting this working, but there is always a start...


Description:
Download
Filename: os_beos.inc
Filesize: 3.92 KB
Downloaded: 956 Time(s)

Post 01 Jun 2004, 23:52
View user's profile Send private message Yahoo Messenger Reply with quote
NULLPointer



Joined: 28 May 2004
Posts: 11
NULLPointer 02 Jun 2004, 02:56
If this file is from asmutils, and i'm sure it is, then i've already read it and i repeat:

there are two syscalls that BeOS miss, BRK and SYSINFO.

How do i manage that??!! Shocked
Any idea?

Thanks for your attention.
Post 02 Jun 2004, 02:56
View user's profile Send private message MSN Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 02 Jun 2004, 03:30
Code:
...
%define __NR_mmap               90
...
%assign SYS_brk           SYS_exit
...    

We don't need to do a verbatim translation. We could write code that do the equivalent operation. For this case in particular (there's only one call to SYSINFO), Fasm needs to reserve a big chunk of memory, so we need to find some alternatives and choose a good one.
A starting point could be doing tests with mmap or maybe is safer to disassembe some C written program (opensource of course to avoid infringing the law Smile )
Post 02 Jun 2004, 03:30
View user's profile Send private message Yahoo Messenger Reply with quote
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
neonz 02 Jun 2004, 13:31
NULLPointer wrote:
there are two syscalls that BeOS miss, BRK and SYSINFO.

How do i manage that??!! Shocked


Maybe you could check out source of MenuetOS port. When fasm was ported to MenuetOS, it (mos kernel) hasn't any memory management system calls yet (AFAIK they simply defined data segment size in executable header and used fixed size buffer).
Post 02 Jun 2004, 13:31
View user's profile Send private message Visit poster's website Reply with quote
NULLPointer



Joined: 28 May 2004
Posts: 11
NULLPointer 03 Jun 2004, 00:35
If fasm uses BRK to increase the data segment size, could i use malloc instead?
After all malloc is like a wrapper for brk, isn't it?

Thnks.
Post 03 Jun 2004, 00:35
View user's profile Send private message MSN Messenger Reply with quote
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
neonz 03 Jun 2004, 02:08
NULLPointer wrote:
If fasm uses BRK to increase the data segment size, could i use malloc instead?
After all malloc is like a wrapper for brk, isn't it?


Don't know about BeOS, but in Linux malloc() is C function that calls BRK syscall.
Post 03 Jun 2004, 02:08
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 08 Jun 2004, 17:45
Post 08 Jun 2004, 17:45
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 11 Jun 2004, 13:17
It's almost working at last (see http://board.flatassembler.net/topic.php?p=10727#10727 for a longer post). I'll try to fix the single problem I've found with it and then all of us BeOS users can enjoy FASM.
Post 11 Jun 2004, 13:17
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 13 Jun 2004, 12:09
FASM now works perfectly under BeOS! See See http://board.flatassembler.net/topic.php?p=10763#10763 for the download (source + binary)
Post 13 Jun 2004, 12:09
View user's profile Send private message Visit poster's website Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph 14 Jun 2004, 21:57
I guess it's a little late for that now, but I had most of fasm ported to beos once using syscalls. If you still need it, brk is syscall number 8 on BeOS.
Post 14 Jun 2004, 21:57
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 14 Jun 2004, 22:55
Ralph wrote:
I guess it's a little late for that now, but I had most of fasm ported to beos once using syscalls. If you still need it, brk is syscall number 8 on BeOS.


IMHO, pure assembly port will be better than one using clib. Smile

Regards.
Post 14 Jun 2004, 22:55
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 15 Jun 2004, 11:32
Does BeOS have a syscall for mprotect? This is one of the few syscalls my programs rely on heavily and I haven't found any decent documentation on the BeOS syscalls yet.
Post 15 Jun 2004, 11:32
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 15 Jun 2004, 11:55
JohnFound wrote:
IMHO, pure assembly port will be better than one using clib. Smile

I agree. But libc port gives you a working fasm on such systems, and this should make developing any pure assembly port easier.
Post 15 Jun 2004, 11:55
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:  
Goto page 1, 2  Next

< 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.