flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > A binary choice... |
Author |
|
JohnFound 24 Feb 2005, 13:57
Well, this forum is not very suitable place to ask such questions...
My opinion is: "Not simply assembler - FASM". Why: 1. There are only few assemblers that can be used for OS developement. gas - the syntax is too strange for almost everyone, but Linux wizards. NASM - too slow. It is not smart to bind whole your OS to such assembler. FASM - clean syntax, lightning fast compilation even on very big sources. highly portable - you will be able to make your OS self-dependent at very early stage of developement. About C - what to say... if it have to be HLL, beter use PHP. Regards. |
|||
24 Feb 2005, 13:57 |
|
FlashBurn 24 Feb 2005, 15:41
I use asm for the kernel and I hope to use C for the rest of the system. But this is only good if you want to write a microkernel. Because for a monolithkernel it would be better to do all the work in one language!
|
|||
24 Feb 2005, 15:41 |
|
joachim_neu 24 Feb 2005, 15:42
maybe you should say also the other part most problem is (bigger for beginners, smaller for good coders) that actually most code you'll find in the internet is written for NASM. so at the beginning it's not clever i think to learn more syntaxes and to port every code from NASM to FASM and so on. i think first you should use NASM and if you can code bether you can choice FASM, too, so you can port everything when you understand it and you can optimize it the same time...
|
|||
24 Feb 2005, 15:42 |
|
smiddy 24 Feb 2005, 16:28
I suppose it really depends on how fast you wish to develop your system or how fast you want your code to be. From the development standpoint it will be very benificial to write in C if speed of devlopment is a key goal. However, from the sheer speed of running your OS, assembly is an order of magnitude faster (at the clock tick level) than C. Other aspects include library support; C will require you to create your library according to your OS design, ASM you will not have to as you're writting specifically for the processor and not specifically the OS (a layer of abstraction has been removed), that is until you want applications to work within your OS, then they have to interact with your API. Integrated Development Environment and Debuging; neither one has either initially, so it might be a moot point, though there are IDEs and DEBUGs written in assembly with there sources available and are very portable (relatively speaking) to your new OS, C on the other hand requires you to have that library already written, as above.
|
|||
24 Feb 2005, 16:28 |
|
f0dder 24 Feb 2005, 16:54
It really depends on what you feel comfortable with, I guess. Unless you want to support very old hardware *or* you are a bad C programmer *or* you are using a bad compiler, there shouldn't really be runtime (size/speed) problems with using C for the kernel.
Proper design (including algorithms and memory organization) is a lot more important than choosing between C/Asm. My first kernel was written entirely in asm. After I had implemented a keyboard handler with codepage support and basic paging and some task-switching, I abandoned the project for some years. During those years, my experience with various things have increased, and compilers have become a lot better. I've moved from the "OMFG! Everything must be written in assembly" attitude to "assembly where it makes sense / where it matters". I recently got interested in os-dev again, and now my kernel is written in a mix of (F)ASM and C. I'm using VC2003 to compile, since it's one of the best out there, and it's free (and even the free vc2003 toolkit license is a lot less restrictive than the MASM license, it actually allows things like osdev!). But well, it's a personal choice |
|||
24 Feb 2005, 16:54 |
|
FlashBurn 24 Feb 2005, 18:00
My problem is that I cannot "think" in C but in ASM So my ASM code works and my C doesn´t I also think that a ASM kernel is simplier to debug than a C kernel, because you know what you´ve written and what it should do (when you debug with Bochs this will help you).
|
|||
24 Feb 2005, 18:00 |
|
Octavio 24 Feb 2005, 19:47
JohnFound wrote: 1. There are only few assemblers that can be used for OS developement. gas,NASM,FASM,octasm,a386(not free),tasm and others. thats a lot compared to the HLL that can be used for OS developement. Of course all languages can be used with a little help from assembly. |
|||
24 Feb 2005, 19:47 |
|
wishmaster 26 Feb 2005, 17:07
Hello !
f0dder wrote:
Could you explain me how to use VC2003 for osdev ? How to link to flat binary ? Thx |
|||
26 Feb 2005, 17:07 |
|
f0dder 27 Feb 2005, 18:18
I don't link to a flat binary, I actually have PE support in my bootloader. The code required for loading a PE at boottime (ie, not supporting all the stuff a PE can do) is very simple, and it's pretty nice to have your kernel in a standard format.
My old kernel was in flat binary format, back then I used NASM and DJGPP (32bit dos extended port og GCC). |
|||
27 Feb 2005, 18:18 |
|
bubach 28 Feb 2005, 11:37
I suggest that you use the language that your good at.
|
|||
28 Feb 2005, 11:37 |
|
wishmaster 01 Mar 2005, 14:06
I am using GRUB as bootloader. Is GRUB able to load PE files ? If not is it possible to add the multiboot header to a PE file made with VC2003 ?
|
|||
01 Mar 2005, 14:06 |
|
f0dder 01 Mar 2005, 20:59
Hmmm, never really fancied grub... but it should be possible to write either a multiboot header (haven't researched those), or write a small PE loader, prepend it to the PE kernel, and have grub load+execute as binary...
|
|||
01 Mar 2005, 20:59 |
|
scientica 07 Mar 2005, 09:13
just a legal question does the EULA of VC2k3 allow wrting OSes? (iirc MASMs EULA forbids it) - I don't have access (nor want to for that matter, but that's OT) VC2k3 so I can't check this...
|
|||
07 Mar 2005, 09:13 |
|
f0dder 07 Mar 2005, 11:38
Yes it does, scientica - of course the version with visual studio.net does (like the commercial MASM license), but even the VC2003 toolkit license allows it - it's very unrestricted. And it's one of the best compilers around, so it's quite suitable
|
|||
07 Mar 2005, 11:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.