Page 1 of 1

NASM 0.98.39: Ported!

Posted: Mon Feb 25, 2008 3:38 pm
by pcmattman
Hi everyone,

I just got NASM 0.98.39 ported to my OS (currently fixing some minor bugs before I go on and port binutils) and assembled a file properly.

Before I got 0.98 ported I accidentally tried 2.02 (which isn't actually a stable version) and had no end to my troubles - but thanks to the NASM team for making such an easy-to-port program!

Screenshot of NASM running -v is attached, as well as a screenshot of NASM run with "-o /dev/tty" and input as a simple file ("start: jmp $").

(Note: the name "MirrorOS" is temporary, this is actually a project for school but once I hand it in I'll rename all the "MirrorOS" references with "Mattise" and release the kernel).

Posted: Tue Feb 26, 2008 1:13 am
by xyzzy
Nice, love that startup text about crashing :P

Posted: Tue Feb 26, 2008 2:41 pm
by t0xic
Wow, that's pretty cool. I'm sort of working on porting nasm/fasm to my OS.

Posted: Tue Feb 26, 2008 2:46 pm
by pcmattman
The advantage to having NASM ported is that it revealed a ton of bugs that I'd overlooked, and some basic coding mistakes (relying on uninitialized variables, using memory just allocated without ensuring it's mapped, etc...).

I'm currently writing up my execve function and once done I'll whip up a tiny shell and have a bit more choice about what to run (because at the moment, this is all hardcoded into the kernel).

Posted: Tue Feb 26, 2008 2:53 pm
by t0xic
By hard coded do you mean that it is compiled into the kernel?

Posted: Tue Feb 26, 2008 2:56 pm
by pcmattman
No, I mean the loading of the program and its argv is hard-coded.

Right now I'm changing my thread creation code to support passing an argv/argc pair so that I don't have to keep modifying a hard-coded set of strings to test different parts of NASM :D.

EDIT: loading of the program = grabbing it from the ramfs.

Posted: Tue Feb 26, 2008 2:57 pm
by t0xic
Any hope of code being uploaded to your CVS for perusal? *crosses fingers*

Posted: Tue Feb 26, 2008 6:04 pm
by pcmattman
Code will be uploaded within the next 2 weeks ;).

As I said in the original post, this is a school project which, once handed in, will be renamed to my main OS name (Mattise) and uploaded to repositories and packaged for a release.

Posted: Thu Feb 28, 2008 4:37 am
by pcmattman
Update: I wrote a simple shell that supports command recall (up/down keys), basic command editing (left/write keys, always overwrite), and support for "echo" and "cd" as well as running programs.

Attached is a screenshot of it in action.

Posted: Thu Feb 28, 2008 10:55 am
by lukem95
thats pretty cool, id love to have even some of the toolchain ported to my os. maybe ill start setting up the environment when i get bored of vga fiddling

Posted: Thu Feb 28, 2008 3:46 pm
by pcmattman
t0xic wrote:Any hope of code being uploaded to your CVS for perusal? *crosses fingers*
I've just committed my code to my SVN repository (see my sig). Happy reading :D!

Posted: Fri Feb 29, 2008 10:06 am
by xyzzy
Your sig says CVS, do you mean CVS or have you moved to SVN and not updated your sig?

Posted: Sat Mar 01, 2008 2:12 am
by pcmattman
Sig updated, thanks for pointing that out.