On Apr 13, 9:49 pm, Albert van der Horst <alb...@[EMAIL PROTECTED]
>
wrote:
....snip...
> Is there a standard assembler for OS X?
Well, there's an Apple as with the gcc that came with Xcode 3.0. I'm
pretty sure this gas is under version 2.0 from memory. ( and I believe
the gcc is 4.0 but I'm not able to check at the moment). It did not
correctly identify the intel operand sequence directive.
Apple also to their credit provided an apple nasm (0.98). The main
difference of this apple version to the late 'common' versions of 0.98
is that it knows how to assemble mach-o .o's.
I built nasm 2.02 on OS X - it also appears to know mach-o's. But
given that Apple has not provided it, until I fully understand it I am
currently using the Apple one - I don't notice any significant
differences, to be quite honest.
> What happens if you feed it either the .s (gas) or the .asm (nasm)
> file?
The gas file bombs spectacularly, if I recall it was mainly because of
the lack of the intel syntax directive...
Wait, if you're talking about your beta 5 version, I've not tried
that yet - I admit.
I have a working binary based off your version 4 at the moment - most
syscalls corrected, including that nefarious difference of lseek
between bsd and unix (that one had me for a while till I realized the
offset was 64 bits on bsd)...code/kernel in text (__TEXT) _segment_
and the userspace etc in the dat (__DATA.bss) segment. (.bss is part
of the data segment at least on mach-os I believe).
http://xina.cvs.sourceforge.net/xina/xina-generic/
( excuse the chaos - still completely haven't understood how to use
cvs effectively yet )
The only differences to the source lina original are bits of
conditional assembly to LINOS, LINOS5, and certain words in the system
ie REPOSITION-FILE have had to be corrected for the lseek difference.
Notably, I've had to add an
XOS ( nx nx-1 ... n2 n1 x syscall-no -- ior ) where x is the number
or parameters to the sycall so that it can clean up the stack after -
I think the comments in the source may need updating.
From memory I think I added a few other things to the base dictionay I
kind of like like -ROT.
I'm not sure if I corrected execve yet for forking, I think I may have
corrected the vector no. but haven't tried it out yet.
The source could be cleaned up a little bit more and that will happen
as my understanding of how lina is put together improves. A lot of it
is built on uncommented forth in the form of assembly constants. I may
add comments as I go along as I think that may make things better for
whomever comes after.
Otherwise,
Basically you have a source file that will assemble conditionally on
linux (per your original) or on a mac OSX (and possibly BSD) and the
OSX linked one appears to run now fairly unbuggily - so that's an
alternative - things to fix now are the SAVE-SYSTEM and give the other
words that make syscalls a good testing. The big lseek bug is fixed.
> I'm willing to put some work into adapting the source
> to this standard assembler.
Well, then there are two choices. Apple nasm and gas. Our mutual build
tools may intersect closest on nasm 0.98, and I'll admit a personal
bias. gas you're running is version 2+ and the apple one hasn't hit
2.0 yet... but I'll do gas too if you prefer.
> I have the kernel in the text, and the buffers, stack free space etc.
> in bss.
Hmm.. interesting. May not get a chance to try your latest for another
24-48 h but will give it ago. I will see how my linker or dyld loader
likes it.
> Albert van der Horst, UTRECHT,THE NETHERLANDS
Robert Spykerman


|