flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Porting FASM/NASM to MikeOS (Written in NASM)

Author
Thread Post new topic Reply to topic
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 31 Jul 2013, 15:17
Hello FASM Community,
I have recently joined this forum for our Assembly Project...
A few days ago I found out this small-open-source OS project :
mikeos.berlios.de - MikeOS by Mike Saunders,
Note that it runs on BIOS(not protected-mode because of certain driver problems) and it will not run on UEFI machines.
I have also seen projects like :
Kolibri OS
Menuet OS
DEX OS
The very common thing (not mikeos) I have seen is that they have FASM compiler within them.
Of course I cannot directly port the "FASM.exe" to my OS. It will be something
to Do with the source.
I successfully generated a FASM.o file through the FASM compiler, but now my question is :
"How do I use this in MikeOS (made in NASM)"
I doubt this is possible, cause the .o file is made by FASM, and is used in NASM.
If not then,
How to do I port NASM to MikeOS?
I would be grateful to those who response to my question Smile
P.S. : I have existing knowledge of C,C++,Java,C# and NASM,
Since FASM is a lil different from NASM, I end up with some syntax error! Razz

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 31 Jul 2013, 15:17
View user's profile Send private message Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 243
Mike Gonta 31 Jul 2013, 19:54
sid123 wrote:
Hello FASM Community,
I have recently joined this forum for our Assembly Project...
A few days ago I found out this small-open-source OS project :
mikeos.berlios.de - MikeOS by Mike Saunders
sid123 wrote:
Since FASM is a lil different from NASM, I end up with some syntax error!
Converting MikeOS from NASM to FASM is trivial.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Last edited by Mike Gonta on 10 Jun 2014, 10:10; edited 1 time in total
Post 31 Jul 2013, 19:54
View user's profile Send private message Visit poster's website Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 01 Aug 2013, 08:59
Thanks! Mike Gonta, for porting MikeOS to FASM;
Got it to work but still can't figure out to port FASM,
Any docs available for that job?
Or anyone here who knows how to?
Post 01 Aug 2013, 08:59
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 01 Aug 2013, 09:27
I once released a guide for this purpose: http://board.flatassembler.net/topic.php?p=28103#28103
It is old and may not be up to date in all the details, though. If you have any specific problems with it, please ask.
Post 01 Aug 2013, 09:27
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 01 Aug 2013, 09:31
sid123 wrote:
Any docs available for that job?


FASM is relatively easy portable program. That is why it is so popular for assembly OS development.

The most of FASM sources are OS independent and it needs only very thin OS dependent layer, that to provide interface to the target OS.

The official guide to FASM internals should be enough to port FASM to any platform.

Reading sources also helps a lot.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 01 Aug 2013, 09:31
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 01 Aug 2013, 22:20
The main problem you will have is that MikeOS is for real mode and is limited to apps that fit into a single 64K memory segment, this is also the case for read/write.
So you will need to study the Dos ver of fasm.

PS: I did write a ver for MiniDos thats also is a realmode OS with very basic functions, but i simple used a cut down ver of DexOS that included a fasm port and fat drivers etc in one app, that just needed to be loaded and run to work.
It did all the work in pmode before returning to realmode with the assembler OK info or any errors messages.
Post 01 Aug 2013, 22:20
View user's profile Send private message Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 243
Mike Gonta 02 Aug 2013, 17:10
Dex4u wrote:
The main problem you will have is that MikeOS is for real mode and is limited to apps
that fit into a single 64K memory segment, this is also the case for read/write.
Of course, there is always MikeOS32

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com
Post 02 Aug 2013, 17:10
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 04 Aug 2013, 22:50
Mike Gonta wrote:
Dex4u wrote:
The main problem you will have is that MikeOS is for real mode and is limited to apps
that fit into a single 64K memory segment, this is also the case for read/write.
Of course, there is always MikeOS32

Cool, that would make it much easier to port.
Post 04 Aug 2013, 22:50
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 10 Aug 2013, 08:18
Thanks for the reply FASM Community, and especially Mike Gonta for his splendid MikeOS resources, Since MikeOS has been ported to 32-bit mode. I think the milestone is near.
I studied the FASM internals, and got to know that the 2 files FASM.ASM And SYSTEM.INC are the 2 main files of the Assembler. Assembling them with Flat Assembler gives a FASM.O file. I think it's some type of library, which has to be called by a MikeOS executable i.e. a .bin file. The executable will ask for the .ASM filename and then will compile the .ASM into a .bin file like NASM does for the applications. Any guesses on how to do this?
Post 10 Aug 2013, 08:18
View user's profile Send private message Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 243
Mike Gonta 10 Aug 2013, 18:08
sid123 wrote:
Since MikeOS has been ported to 32-bit mode.
Technically it has not actually been ported. This would require the OS to include code to handle the initial
(and subsequent CPU mode switching). MikeOS32 is a simple translation to PM32 and requires a suitable
BIOS extender to run. aeBIOS provides this service in a simple transparent way. The important thing is
that aeBIOS allows an OS or standalone application/game to be programmed in the simple old time style
of RM16 without the inherent restrictions.
Quote:
I think the milestone is near.
I don't want to discourage you, but it is still a long ways off.
Quote:
I studied the FASM internals, and got to know that the 2 files FASM.ASM And SYSTEM.INC are the 2 main
files of the Assembler. Assembling them with Flat Assembler gives a FASM.O file. I think it's some type of
library, which has to be called by a MikeOS executable i.e. a .bin file.
Actually the "O" file is an Object File, an intermediary executable file representation. A linker is then required
to convert it into an actual binary executable file. This is one option in FASM. However, FASM can generate
the final executable binary (the same as NASM) directly without the use of a linker. This is how the kernel32.asm
file in MikeOS32 can be assembled in FASM and the kernel32.bin produced.

The main issue with porting FASM to MikeOS32 is the current lack of certain file system support (also of
course lacking in MikeOS). This includes open, close and lseek. MikeOS32 / MikeOS is currently limited to reading
and writing complete files (as well as some auxiliary support) and only from the root directory and only in FAT12.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com
Post 10 Aug 2013, 18:08
View user's profile Send private message Visit poster's website Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 15 Aug 2013, 02:31
So Any Ideas?????
By the way Anybody knows how to compile a exe file in nasm without the .asm in the output, like when I compile a source file like, source.asm
the output is source.asm.exe, (PS: I am using the bin extension) because I want to change the format of the MikeOS executable........
Post 15 Aug 2013, 02:31
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 17 Aug 2013, 13:03
Is there any way to increase the memory segment in mikeos?
:::::
Is this forum dead?
Post 17 Aug 2013, 13:03
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 24 Aug 2013, 15:43
Hey Guys! MikeOS has an utility called Monitor.Bin which converts HEX to MACHINE CODE so that does half the job, Now what remains is ASM TO HEX (which we will make)
Also I have heard that making assemblers is easy if one knows good assembly. And we can make one in MIKE assembly? And assemblers don't Need some complex File System they can run on any environment which supports reading and writing to a storage device. Forget FASM,NASM,GAS,YASM,NASM,TASM and complex assembler but yes we can write out own simple assembler, So anybody, Yeah but first we are going to need
Intel x86 manuals, IA-32 manuals and x86 assembly knowledge....
Post 24 Aug 2013, 15:43
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 14 Oct 2013, 08:43
Finally a guy has wrote an Assembler for MikeOS
Here it is https://github.com/leonardo-ono/asm4mo
I am porting it to MikeOS32....
YAY!
Post 14 Oct 2013, 08:43
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.