Page 1 of 1

C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 11:40 am
by bluman
Hello!
This is my first post here and I was wondering if you could help me with a small basic kernel that I've translated to masm. Here is the code: http://pastebin.com/QSJ4sDeR

The problem is with the multiboot header(or at least that is what qemu says). Please don't say that nasm is better or something like that, because I've used this syntax for programming under Win32.

Thanks,
Paul Herman

Re: C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 12:37 pm
by f2
bluman wrote: Please don't say that nasm is better or something like that, because I've used this syntax for programming under Win32.
I just want to say that the MASM license doesn't allow you to write an OS with it. So, you should use JWasm. This assembler is fully compatible with MASM-syntax.

Re: C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 12:40 pm
by gerryg400
Have you checked your output file with a hex editor to make sure the header is correctly formed and in the right place ?

Re: C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 4:37 pm
by Combuster
OS development is not windows development. The barebones assumes a cross-compiler targeting ELF, because that's what the bootloader expects to find. You can not simply use the PE format that windows-targeted tools use because it means you are violating the specification.

Re: C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 8:00 pm
by neon
I just want to say that the MASM license doesn't allow you to write an OS with it. So, you should use JWasm. This assembler is fully compatible with MASM-syntax.
MASM32's license restricts this, not MASM.

Re: C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 9:26 pm
by iLewis
neon wrote:
I just want to say that the MASM license doesn't allow you to write an OS with it. So, you should use JWasm. This assembler is fully compatible with MASM-syntax.
MASM32's license restricts this, not MASM.
MASM64 is under the MASM32 license too right?

Re: C Barebones ported to MASM - Errors

Posted: Sat Dec 04, 2010 9:48 pm
by neon
iLewis wrote:MASM64 is under the MASM32 license too right?
Sorry, not sure, never used MASM64. I would think so if its from the MASM32 site.

MASM is a Microsoft product; MASM32 and MASM64 are not which is probably why it gets confused alot.

Re: C Barebones ported to MASM - Errors

Posted: Sun Dec 05, 2010 1:29 am
by bluman
OK, I've "compiled" with jwASM and linked with LD, now it simply reboots without any message. Also does anyone know how to make the start label global? LD tells me that it can't find the start label. I think there is a problem as in my code I don't have .text and .bss